Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. function PlayerLogin(username,password,checksave)
  2. if not (username == "") then
  3. if not (password == "") then
  4. local account = getAccount ( username,password )
  5. if ( account ~= false ) then
  6. logIn(source, account, password)
  7. setCameraTarget(source, source)
  8. triggerClientEvent (source,"Zacznij",getRootElement())
  9. toggleControl (source, "fire", false)
  10. toggleControl (source, "aim_weapon", false)
  11. end
  12. end
  13. end
  14. end
  15. addEvent("onRequestLogin",true)
  16. addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)
  17.  
  18. function registerPlayer(username,password,passwordConfirm)
  19. if not (username == "") then
  20. if not (password == "") then
  21. local account = getAccount (username,password)
  22. if (account == false) then
  23. local accountAdded = addAccount(tostring(username),tostring(password))
  24. if (accountAdded) then
  25. triggerClientEvent (source, "Zaloguj", root, source)
  26. else
  27. triggerClientEvent( source, "Konto_jest", root, source)
  28. end
  29. else
  30. triggerClientEvent ( source, "Nick_Konto", root, source)
  31. end
  32. else
  33. triggerClientEvent ( source, "Brak_Haslo", root, source)
  34. end
  35. else
  36. triggerClientEvent (source, "nick", root, source)
  37. end
  38. end
  39.  
  40. function onPlayerQuit ( )
  41.       local playeraccount = getPlayerAccount ( source )
  42.       if ( playeraccount ) and not isGuestAccount ( playeraccount ) then 
  43.             local skin = getElementModel ( source ) 
  44.             setAccountData ( playeraccount, "skinz",skin ) 
  45.       end
  46. end
  47.  
  48. function onPlayerLogin (_, playeraccount )
  49.       if ( playeraccount ) then
  50.             local skin = getAccountData ( playeraccount, "skinz" )
  51.             if ( skin ) then
  52.                   setElementModel ( source, skin )
  53.             end
  54.       end
  55. end
  56.  
  57. addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
  58. addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
  59.  
  60. addEvent("onRequestRegister",true)
  61. addEventHandler("onRequestRegister",getRootElement(),registerPlayer)
  62.  
  63. function playerLogin( thePlayer )
  64. end
  65. addEventHandler("onPlayerLogin", getRootElement(), playerLogin)
  66.  
  67. function playerJoin( thePlayer )
  68. spawnPlayer(thePlayer,0,0,0,0)
  69. end
  70. addEventHandler("onPlayerJoin", getRootElement(), playerLogin)
  71.  
  72. addEvent ("For_Spawn", true)
  73. addEventHandler ("For_Spawn", root,
  74. function ( plr )
  75. plr:spawn ( 13.96034, 1189.98108, 19.31405)
  76. end)
  77.  
  78. addEvent ("LV_Spawn", true)
  79. addEventHandler ("LV_Spawn", root,
  80. function ( plr )
  81. plr:spawn ( 2080.88647, 1285.69531, 10.82031 )
  82. end
  83. )
  84.  
  85. addEvent ("LS_Spawn", true)
  86. addEventHandler ("LS_Spawn", root,
  87. function ( plr )
  88. plr:spawn ( 1481.23022, -1749.44385, 15.44531 )
  89. end
  90. )
  91.  
  92. addEvent ("SF_Spawn", true)
  93. addEventHandler ("SF_Spawn", root,
  94. function ( plr )
  95. plr:spawn ( -1938.75,883.62,40.21 )
  96. end
  97. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement