Advertisement
Guest User

Untitled

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