Advertisement
Guest User

Untitled

a guest
May 14th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 KB | None | 0 0
  1. function joinHandler()
  2.     local x = 1959.55
  3.     local y = -1714.46
  4.     local z = 15
  5.     outputChatBox("Welcome to My Server", source)
  6. end
  7. addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
  8.  
  9.  
  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. addEvent("submitLogin",true)
  32. addEventHandler("submitLogin",root,loginHandler)
  33.  
  34.  
  35. function createVehicleForPlayer(thePlayer, command, vehiclemodel, vehiclecolor)
  36.         local x,y,z = getElementPosition(thePlayer)
  37.         x= x + 2
  38.         local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)
  39.         if (createdVehicle ==false) then
  40.             outputChatBox("You Fail, try again.",thePlayer)
  41.         end
  42. end
  43. addCommandHandler("makeveh", createVehicleForPlayer)
  44.  
  45.  
  46. function playerDied(totalAmmo, killer, killerWeapon, bodypart)
  47.     outputChatBox(getPlayerName(source) .. " Fail!")
  48. end
  49. addEventHandler("onPlayerWasted",getRootElement(),playerDied)
  50.  
  51. function moveThePlayer(x,y,z,rotation)
  52.  
  53.     if x and y and z and rotation then
  54.  
  55.         local skin = getElementModel(client)
  56.  
  57.         spawnplayer(client,x,y,z,rotation,skin)
  58.  
  59.         setCameraTarget(client,client)
  60.  
  61.     end
  62. end
  63. addEvent("movePlayerToPosition",true)
  64. addEventHandler("movePlayerToPosition",root,moveThePlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement