Jump to content

xTravax

Members
  • Posts

    665
  • Joined

  • Last visited

Everything posted by xTravax

  1. wtf you talking unpredictable?plz stop addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), function () setTimer (function () local money = getPlayerMoney (localPlayer) if (money < 0) then setPlayerMoney (localPlayer, 0) end end, 10000,0) end)
  2. hi i am trying to encode image code with tea function and then later when i need it i decode it but it doesnt work local file = fileOpen("rec.jpg") local content = fileRead(file,fileGetSize(file)) local encode = teaEncode(content,"#qa$aJOAio4jikj!") fileClose(file) fileDelete("rec.jpg") local file = fileCreate("rec.jpg") fileWrite(file,encode) fileClose(file) function restoreFile() fileDelete("rec.jpg") local image = fileCreate("rec.jpg") fileWrite(image,teaDecode(encode,"#qa$aJOAio4jikj!")) fileClose(image) end addCommandHandler("restore",restoreFile) you can try any picture and it wont work for unknown reason when it "restores" the file it makes 4 bytes long text like ˙Ř˙ŕ please help
  3. alright, thanks it works now but i got a question: isn't client always the element in 2nd argument when triggeringEvents? what about the warning of source faking on wiki for these custom events?
  4. yes player is an argument in server function and that player is localPlayer from clientside but client on the server is same as the player, and that is impossible inviter and localPlayer are two different players, and on server side they are same 1 player... why?how?help?
  5. Thanks. I like the way how you called it, 'Party Chat'. I have finished my 'party' resource (at least i thought so) I've ran into incredibly retarded bug(seriously) This is driving me nuts. -- (one part of client script) addEvent("onPlayerInvite",true) local theInviter = {} function onPartyInvite(inviter) if source == localPlayer then bindKey("k","down",triggerAccept) bindKey("l","down",triggerDecline) table.insert(theInviter,inviter) -- lets keep the inviter in table guiSetVisible(partyWindow,true) guiSetText(label,getPlayerNick(inviter).." has invited you for a party\n\nPress 'K' to accept, or 'L' to decline") guiLabelSetHorizontalAlign(label,"center") guiLabelSetVerticalAlign(label,"center") end end addEventHandler("onPlayerInvite",root,onPartyInvite) function triggerAccept() local inviter = unpack(theInviter) outputDebugString("inviter: "..getPlayerNick(inviter)) -- outputs different name than the localPlayer triggerServerEvent("onPartyAccept",inviter,localPlayer) guiSetVisible(partyWindow,false) unbindKey("k","down",triggerAccept) unbindKey("l","down",triggerDecline) theInviter = {} end -- one part of server script function onPartyAccept(player) if client == player then return error("WTF!?") end -- client is same as player, and it gives error outputChatBox(getPlayerNick(player).." has accepted your party invitation.",client,0,255,0) local id = getPlayerSerial(client) if not isPlayerInParty(client) then party[id] = {} party[id].players = {client,player} setElementData(client,"party.name",id) setElementData(client,"party.leader",true) setElementData(player,"party.name",id) setElementData(player,"party.leader",false) else table.insert(party[id].players,player) setElementData(player,"party.name",id) setElementData(player,"party.leader",false) end outputChatBox(getPlayerNick(player).." has accepted your party invitation!",client,0,255,0) end addEventHandler("onPartyAccept",root,onPartyAccept) Shortly said: I make sure that the party inviter and localPlayer are two different elements/players then i trigger a server event, and in server event they're both the person who invited another player(they're both the same player element) Please help me anyone if anyone knows why the f*** is this happening...
  6. Hello! I would like to create something similiar to group conversations. You invite a person over command, if he accepts you two merge into 1 conversation(unless if you are already with someone in conversation, then he gets in it as well) However i am not really sure how to store the conversation's data. I could use tables, but how do i do it without making conflicts? Any example how you would do it? Thank you in advance.
  7. i want above table to work on same principle like if i had this table table = { ["serial1"] = true, ["serial2"] = true, ["serial3"] = true } if table[getPlayerSerial(player)] then return true else return false end
  8. how do i look if my serial is in table if table looks that way? (sorry i never used table with [] which contains table inside table so im not sure how to do this)
  9. above thing is the full code (if you put this loop in a function, and send serial to function while there are multiple serials on few indexes, if only ONE index serial isn't the one we're comparing it to, it will return false and SKIP other indexes for checking if serial is in table)
  10. Walid, your code does same thing as mine. edit: your code would still have a bug which i also have looping through table returns only one index of table, and doesn't check all of them so if one serial isnt same with the serial that im comparing it to, it will return false and won't check other table indexes
  11. hey so i got a table which looks kinda like this table = { {"playerSerial1","somedata","someotherdata"}, {"playerSerial2","somedata2","someotherdata2"}, {"playerSerial3","somedata3","someotherdata3} } so if i want to check players serial and if he has some data i'd do for i,v in pairs(table) do if v[1] == serial then return true else return false end end however if let's say our specific player's serial is on index 2 in table, it won't ever be looped only one serial will be looped, others will be ignored i have those multiple datas in table and i want to get data from specific serial in table please help
  12. xTravax

    afk script

    as stated on wiki that function checks for how long player's position has not been changed by that function i could be considered afk while still moving my mouse around and watching everything that is happening around me
  13. xTravax

    afk script

    hey i need help here i want to make afk system so that if i both dont click any key and if i dont move my mouse at all for 30 seconds it considers me afk i know how to make this, but it isnt optimized the way i'd do it due to timer resetting alot due to onClientCursorMove event gets 2-3 times more triggered than onClientRender and if im afk and i move my mouse, or press a key, it removes me from afk mode any ideas?
  14. hey i have a problem if i create a weapon with createWeapon, it will create it only for me, but won't be synced with other players how to fix this? others can't see my custom weapon
  15. um try replacing "rhino.txd" download="false"> "rhino.dff" download="false"> with "rhino.txd" download="false" /> "rhino.dff" download="false" />
  16. You are selling this??? 10-15 euros?? what is so special about having a bomb in a vehicle? this can be done in 5 minutes seriously
  17. How in the hell do you make a new weapon using an existing original texture? By using shaders in that way you could only modify the existing weapon's texture(look) but not create/make a completely new weapon
  18. Still not up, even on the 11th. Also, for your information, their website is in Spanish. It's not exactly on 9th of Feb but approximately around 9th of Febraury, and their page is currently only in spanish because most of buyers are from latino countries and the message is saying something like "as many of you wanted us to return due to not so many good hosts for mta out there, we will be back" Originally that website is in english, and it will be when it returns(pretty soon) Also i believe its TeraCloud now, not insane hosting anymore
  19. hi it isnt giving any error and i dont see any checkbox local sw,sh = guiGetScreenSize() local width,height = 400,700 local shaderPanel = guiCreateWindow ( sw/2-width/2, sh/2-height/2, width, height, "Shader Panel", false ) local x1,y1 = guiGetPosition(shaderPanel,false) local spacing = 40 local spaceX,spaceY = spacing/1920*sw, spacing/1080*sh local cWidth,cHeight = 160/1920*sw, 40/1080*sh local checkBox1 = guiCreateCheckBox ( x1+spaceX, y1+spaceY, cWidth, cHeight, "Water Shader", true, false, shaderPanel) guiSetVisible(shaderPanel,false) function togglePanel() showCursor(not guiGetVisible(shaderPanel)) guiSetVisible(shaderPanel,not guiGetVisible(shaderPanel)) end bindKey("F3","down",togglePanel) please help
  20. Hi MTA Community! I want to suggest a feature, but before anything i would like to see what you think. I think that it would be good for servers to have ability to make their playerlist hidden(though playercount remains public) Basically the player list in that case could only be seen from inside (if a server has scoreboard) I don't really have a good reason or point why this should be implemented but one situation in which this feature would help would be preventing some banned people from daily spying on the player list. Please state your opinion about this below if you have one, no matter if its negative or positive opinion. xTravax
  21. onda bolje da krenemo svi npr na skypu da se udruzimo napravimo neki server i pocnemo radit na tome
×
×
  • Create New...