Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.76 KB | None | 0 0
  1. --SERWER SIDE ( nie cały )
  2. function callTo()
  3.         --local klikniecie = playSound ( "client/cli.wav" )
  4.         stopSound( dzwiek )
  5.         dzwiek = nil
  6.         toUser = guiGetText( GDI['username:edit'])
  7.         toPass = guiGetText( GDI['password:edit'])
  8.         triggerServerEvent  (
  9.                              "ifthisplayer", getRootElement(),  toUser, toPass
  10.                              )
  11. end
  12.  
  13. --CLIENT SIDE
  14.  
  15. function ifthisplayer(toUser,toPass,element)
  16.         setElementData(source,"player:zalogowany",false)
  17.         setElementData(source,"player:dostepny",false)
  18.         setElementData(source,"player:logowanie",false)
  19.         _G["toPass"] = toPass
  20.         _G["toUser"] = toUser
  21.         _G["element"]= element
  22.         PreSpawnChecking(source)
  23. end
  24. addEvent( "ifthisplayer", true )
  25. addEventHandler( "ifthisplayer", getRootElement(), ifthisplayer )
  26.  
  27.  
  28. function PreSpawnChecking(gracz)
  29.     -- if PreSpawnChecking and source == client then -- ale masakra ;p
  30.         local data = exports.t_sql:query_assoc_single( "SELECT postac, haslo, ck, ban, warnow FROM characters WHERE postac = '" .. toUser .. "' AND haslo = '" .. md5(toPass) .. "'" )
  31.         if data then
  32.             if toUser == data.postac and data.ban == 0 and data.ck == 0 and data.warnow < 6 then
  33.                 setElementData(gracz,"player:zalogowany",true)
  34.                 triggerClientEvent ( gracz, "showLobbyRoomClient", getRootElement() )
  35.                 SpawnPlayerAtStart() -- ciekawe czy to Ci dziala o_O
  36.                 --getPlayerCharacter(data.postac,data.haslo)
  37.             elseif toUser == data.postac and data.ck == 1 then
  38.                 --kickPlayer ( player, "Twoja postac jest usmiercona." )
  39.             elseif toUser == data.postac and  data.ban >0 then
  40.                 --kickPlayer ( player, "Twoja postac jest zbanowana." )
  41.             elseif toUser == data.postac and  data.warnow >= 6 then
  42.                 --kickPlayer ( player, "Zbyt duza liczba warnow - 6/6." )
  43.             end
  44.         end
  45.     -- end
  46. end
  47.  
  48.  
  49. --itd....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement