Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SERWER SIDE ( nie cały )
- function callTo()
- --local klikniecie = playSound ( "client/cli.wav" )
- stopSound( dzwiek )
- dzwiek = nil
- toUser = guiGetText( GDI['username:edit'])
- toPass = guiGetText( GDI['password:edit'])
- triggerServerEvent (
- "ifthisplayer", getRootElement(), toUser, toPass
- )
- end
- --CLIENT SIDE
- function ifthisplayer(toUser,toPass,element)
- setElementData(source,"player:zalogowany",false)
- setElementData(source,"player:dostepny",false)
- setElementData(source,"player:logowanie",false)
- _G["toPass"] = toPass
- _G["toUser"] = toUser
- _G["element"]= element
- PreSpawnChecking(source)
- end
- addEvent( "ifthisplayer", true )
- addEventHandler( "ifthisplayer", getRootElement(), ifthisplayer )
- function PreSpawnChecking(gracz)
- -- if PreSpawnChecking and source == client then -- ale masakra ;p
- local data = exports.t_sql:query_assoc_single( "SELECT postac, haslo, ck, ban, warnow FROM characters WHERE postac = '" .. toUser .. "' AND haslo = '" .. md5(toPass) .. "'" )
- if data then
- if toUser == data.postac and data.ban == 0 and data.ck == 0 and data.warnow < 6 then
- setElementData(gracz,"player:zalogowany",true)
- triggerClientEvent ( gracz, "showLobbyRoomClient", getRootElement() )
- SpawnPlayerAtStart() -- ciekawe czy to Ci dziala o_O
- --getPlayerCharacter(data.postac,data.haslo)
- elseif toUser == data.postac and data.ck == 1 then
- --kickPlayer ( player, "Twoja postac jest usmiercona." )
- elseif toUser == data.postac and data.ban >0 then
- --kickPlayer ( player, "Twoja postac jest zbanowana." )
- elseif toUser == data.postac and data.warnow >= 6 then
- --kickPlayer ( player, "Zbyt duza liczba warnow - 6/6." )
- end
- end
- -- end
- end
- --itd....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement