Jump to content

Dudalus

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Dudalus

  1. Hey, thank you for the reply, it works fine with tables. onPlayerSpawn isn't that problem, because I call (trigger) an own function
  2. Hi I use element data's for saving my playerstats, but the problem is, that they aren't safe (Clienthack), so my plan is to use a table. My first idea was to block all (player-element) changes from from client to the server (onElementDataChange) and use an own setPlayerElementData function. Before I use a clientside getElementData function , I sync the data from the server. But this solution has an overhead, and tables look much better Is there a good way to use a table ?
  3. Hi My problem was to detect if the player has an account or not (serverside function). So my solution is onClientResourceStart - I trigger a serverside function, check for an existing account and trigger a clientside login or register function and create a dialoge. Then I trigger a serverside function and create an account or spawn the player. Now the system works fine Thanks
  4. Hi I wrote gamemodes for SA-MP and am new to the MTA scene - so maybe my understanding about the element tree is wrong. I want to call a client function from serverside and output a simple message - but I don't see a message (the trigger should be ok, there is no error in the server console). Both scripts are added to the meta.xml Serverside: function callFoo() triggerClientEvent("foo", getRootElement()) end addEventHandler("onPlayerJoin", getRootElement(), callFoo) Clientside: function foo() outputChatBox("Hello", source) end addEvent("foo", true) addEventHandler("foo", getRootElement(), foo) Is this code right ? source is always the object which triggered an event ? There is a variable called "client", is this the clientside version ? Thanks
  5. Hello Sorry for my english, I`m from Switzerland. Ok, my problem ist, that this command doesnt react. I can fill in /makeleader but I dont see anything (I cant see the else Code). The script is loaded serverside, is this my mistake ? Heres the code: function makeleader(thePlayer, command, tempPlayer, frakid) local invPlayer = getPlayerFromName(tempPlayer) local adminPlayer = getElementData(thePlayer, "AdminLevel") if (tempPlayer) and (frakid) then if tonumber(adminPlayer) == 3 then if (tonumber(frakid) > 0) and (tonumber(frakid) <= 12) then outputChatBox("Du hast den Spieler erfolgreich zum Leader gemacht", thePlayer, 0,255,0) outputChatBox("Du wurdest erfolgreich zum Leader gemacht", tempPlayer, 0,255,0) setElementData(tempPlayer, "Fraktion", tonumber(frakid() setElementData(tempPlayer, "Rank", 5) else outputChatBox("Die Fraktion muss zwischen 0 und 12 liegen", thePlayer,255,0,0) end else outputChatBox("Du bist kein Admin Level 3", thePlayer,255,0,0) end else outputChatBox("Ungültige Eingaben", thePlayer, 255,0,0) end end addCommandHandler("makeleader", makeleader)
×
×
  • Create New...