Advertisement
Guest User

Untitled

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