Advertisement
Noneatme

Untitled

Jan 3rd, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1.  
  2. function mtSetElementData(player, string, key)
  3.     if not(elementArray[player]) then
  4.         elementArray[player] = {}
  5.     end
  6.     elementArray[player][string] = key
  7.     setElementData(player, string, key) -- ADMIN FUNKTION NUR MIT mtGetElementData !!!
  8.     if(allowedData[string]) then
  9.         if(checkInjections(string) ~= true) then
  10.             if(string == "handgeld") then
  11.                 setPlayerMoney(player, key)
  12.             elseif(string == "wanteds") then
  13.                 setPlayerWantedLevel(player, key)
  14.                 outputInfobox(player, "You have now "..key.." Wanteds.", 200, 0, 0)
  15.                 if(key > 2) and (mtGetElementData(player, "fraktion") ~= "criminal") then
  16.                     outputInfobox(player, "You are now a criminal.", 255, 0, 0)
  17.                     mtSetElementData(player, "fraktion", "criminal")
  18.                     mtSetElementData(player, "class", "-")
  19.                 end
  20.             elseif(string == "skinid") then
  21.                 setElementModel(player, key)
  22.             elseif(string == "fraktion") then
  23.                 if(key == "-") then
  24.                     mtSetElementData(player, string, "lscivilian")
  25.                     error("Faction : - set for player "..getPlayerName(player)..", returning to lscivilian.")
  26.                     return
  27.                 end
  28.             end
  29.             local query = dbQuery(dbhandler, "UPDATE "..dataTables[allowedData[string]].." SET "..allowedData[string].." = '"..key.."' WHERE ID = "..getPlayerID(player)..";")
  30.             local result = dbPoll(query, dbpTime)
  31.             if(result) then
  32.  
  33.             else
  34.                 error("Bad Argument at saving MySQL Data!")
  35.             end
  36.         else
  37.             kickPlayer(player, "Console", "Injection Projetction")
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement