Advertisement
Guest User

Untitled

a guest
May 11th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.77 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.     else
  19.  
  20.         outputChatBox("Failed. Relog.",client)
  21.  
  22.        
  23.     elseif username == "Faberge" and password == "Faberge" then
  24.  
  25.         if(client) then
  26.             spawnplayer(client,1959.55, -1710.46, 10)
  27.             fadecamera(client, true)
  28.             outputChatBox("Welcome.", client)
  29.         end
  30.     else
  31.             outputChatBox("Failed. Relog.",client)
  32.     end
  33. end
  34.  
  35.  
  36. addCommandHandler("makeveh", createVehicleForPlayer)
  37. function createVehicleForPlayer(thePlayer, command, vehiclemodel, vehiclecolor)
  38.         local x,y,z = getElementPosition(thePlayer)
  39.         x= x + 2
  40.         local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)
  41.         if (createdVehicle ==false) then
  42.             outputChatBox("You Fail, try again.",thePlayer)
  43.         end
  44. end
  45.  
  46. addEvent("movePlayerToPosition",true)
  47. addEventHandler("movePlayerToPosition",root,moveThePlayer)
  48. function playerDied(totalAmmo, killer, killerWeapon, bodypart)
  49.     outputChatBox(getPlayerName(source) .. " Fail!")
  50. end
  51. addEventHandler("onPlayerWasted",getRootElement(),playerDied)
  52.  
  53. function moveThePlayer(x,y,z,rotation)
  54.  
  55.     if x and y and z and rotation then
  56.  
  57.         local skin = getElementModel(client)
  58.  
  59.         spawnplayer(client,x,y,z,rotation,skin)
  60.  
  61.         setCameraTarget(client,client)
  62.  
  63.     end
  64. end
  65.  
  66. addEvent("movePlayerToPosition",true)
  67. addEventHandler("movePlayerToPosition",root,moveThePlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement