Advertisement
Guest User

Untitled

a guest
May 11th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.72 KB | None | 0 0
  1. addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
  2. function joinHandler()
  3.     local x = 1959.55
  4.     local y = -1714.46
  5.     local z = 15
  6.     outputChatBox("Welcome to My Server", source)
  7. end
  8. addEvent("submitLogin",true)
  9. addEventHandler("submitLogin",root,loginHandler)
  10. function loginHandler(username,password)
  11.     if username == "Misha" and password == "noob" then
  12.  
  13.         if (client) then
  14.             spawnPlayer(client, 1959.55, -1714.46, 10)
  15.             fadeCamera(client, true)
  16.             outputChatBox("Welcome", client)
  17.         end
  18.    
  19.        
  20.     elseif username == "Faberge" and password == "Faberge" then
  21.  
  22.         if(client) then
  23.             spawnplayer(client,1959.55, -1710.46, 10)
  24.             fadecamera(client, true)
  25.             outputChatBox("Welcome.", client)
  26.         end
  27.     else
  28.             outputChatBox("Failed. Relog.",client)
  29.     end
  30. end
  31.  
  32.  
  33. addCommandHandler("makeveh", createVehicleForPlayer)
  34. function createVehicleForPlayer(thePlayer, command, vehiclemodel, vehiclecolor)
  35.         local x,y,z = getElementPosition(thePlayer)
  36.         x= x + 2
  37.         local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)
  38.         if (createdVehicle ==false) then
  39.             outputChatBox("You Fail, try again.",thePlayer)
  40.         end
  41. end
  42.  
  43. addEvent("movePlayerToPosition",true)
  44. addEventHandler("movePlayerToPosition",root,moveThePlayer)
  45. function playerDied(totalAmmo, killer, killerWeapon, bodypart)
  46.     outputChatBox(getPlayerName(source) .. " Fail!")
  47. end
  48. addEventHandler("onPlayerWasted",getRootElement(),playerDied)
  49.  
  50. function moveThePlayer(x,y,z,rotation)
  51.  
  52.     if x and y and z and rotation then
  53.  
  54.         local skin = getElementModel(client)
  55.  
  56.         spawnplayer(client,x,y,z,rotation,skin)
  57.  
  58.         setCameraTarget(client,client)
  59.  
  60.     end
  61. end
  62.  
  63. addEvent("movePlayerToPosition",true)
  64. addEventHandler("movePlayerToPosition",root,moveThePlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement