Advertisement
Guest User

spawn

a guest
Aug 22nd, 2016
89
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- XYZ kiedy wbijemy na serwer
  2.     local spawnX, spawnY, spawnZ = 2.79301, -236.27362, 7.42969
  3. -- Bron i ammo do niej
  4.     local joinWeapon = 22
  5.     local joinAmmo = 200
  6. -- Skin jaki dostaniemy
  7.     local joinSkin = 287
  8.  
  9. -- Bron i ammo
  10.     local spawnWeapon = 4
  11.     local spawnAmmo = 30
  12.     local spawnSkin = 287
  13. -- Dostajemy skin:
  14.  
  15. -- Pieniądze za zabójstwo
  16.     local killerMoney = 300
  17. -- Zabieranie pieniędzy gdy gracz zginie
  18.     local deadPlayerMoney = 50
  19. -- Hajsik który dostaniemy po wbiciu na serwer
  20.     local joinMoney = 3500
  21.  
  22. function spawnOnJoin()
  23.     spawnPlayer(source, spawnX, spawnY, spawnZ, 287, joinSkin)
  24.     fadeCamera(source, true)
  25.     setCameraTarget(source, source)
  26.     outputChatBox(joinMessage, source)
  27.     giveWeapon(source, joinWeapon, joinAmmo)
  28.     givePlayerMoney(source, joinMoney)
  29. end
  30.  
  31. function poZalogowaniu()
  32.     konto = getPlayerAccount(source)
  33.     setElementModel(source, getAccountData(source, "skin"))
  34. end
  35.  
  36. function spawnOnDead(ammo, killer, weapon, bodypart)
  37.     konto = getPlayerAccount(source)
  38.     if konto then
  39.         if getAccountData(konto, "skin") == false or nil then
  40.             setAccountData(konto, "skin", getElementModel(source))
  41.         elseif getAccountData(konto, "skin") ~= false or nil then
  42.             if getAccountData(konto, "skin") ~= getElementModel(source) then
  43.                 setAccountData(konto, "skin", getElementModel(source))
  44.             elseif getAccountData(konto, "skin") == getElementModel(source) then
  45.                 return
  46.             end
  47.         end
  48.         outputChatBox(getPlayerName(source).." został/a zamordowany/a.")
  49.         takePlayerMoney(source, deadPlayerMoney)
  50.         if (killer) and (killer ~= source) then
  51.             givePlayerMoney(killer, killerMoney)
  52.         end
  53.         setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, 0, getAccountData(konto, "skin")
  54.         setCameraTarget(source, source)
  55.         setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo)
  56.     else
  57.         setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, 0, spawnSkin)
  58.         setCameraTarget(source, source)
  59.         setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo)
  60.     end
  61. end
  62.  
  63. function zapiszSkin()
  64.     konto = getPlayerAccount(source)
  65.     if konto then
  66.         setAccountData(konto, "skin", getElementModel(source))
  67.     else
  68.         return
  69.     end
  70. end
  71.  
  72. addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin)
  73. addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead)
  74. addEventHandler("onPlayerQuit", getRootElement(), zapiszSkin)
  75. addEventHandler("onPlayerLogout", getRootElement(), zapiszSkin)
  76. addEventHandler("onPlayerLogin", getRootElement(), poZalogowaniu)
Advertisement
RAW Paste Data Copied
Advertisement