Guest User

Untitled

a guest
May 14th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.16 KB | None | 0 0
  1. ----- -----  --------------------
  2. -----  KeksKing       -----
  3. --------------------------------
  4.  
  5.  
  6.  
  7.  
  8. ------------Spawn----------------------
  9. addEventHandler("onResourceStart", resourceRoot,
  10.     function()
  11.         for i,player in ipairs(getElementsByType("player")) do
  12.             spawn(player)
  13.         end
  14.     end
  15. )
  16.  
  17. function spawn(player)
  18.     if not isElement(player) then return end
  19.     repeat until spawnPlayer ( player, -82.5+math.random(0,1), 1126.3000488281+math.random(0,1), 19.700000762939, 0, math.random(9,288) )
  20.     fadeCamera(player, true)
  21.     setCameraTarget(player, player)
  22.     setPedSkin ( player, 200 )
  23. end
  24.  
  25. addEventHandler("onPlayerJoin", root,
  26.     function()
  27.         spawn(source)
  28.     end
  29. )
  30.  
  31. addEventHandler("onPlayerWasted", root,
  32.     function()
  33.         setTimer(spawn, 1800, 1, source)
  34.     end
  35. )
  36.  
  37. startpickup = createPickup (-82.199996948242, 1118.4000244141, 18.89999961853, 3, 1239, 15000 )
  38.  
  39. function startinfo(source)
  40. outputChatBox(" Welcome =D",source)
  41. end
  42. addEventHandler("onPickupHit",startpickup,startinfo)
  43. ------------Spawn----------------------
  44. -------------Teams----------------
  45. -----Cops------
  46. createBlip ( 2265, 2438.3999023438, 3.2999999523163, 30 )
  47.  
  48. setTeamFriendlyFire(teamLVPD, false)
  49.  
  50. teamLVPD = createTeam ( "LVPD", 0, 255, 0 )
  51.  
  52. function arrest (attacker, attackerweapon, bodypart, loss)
  53.   if (attackerweapon == 3) and (loss > 2 ) then
  54.   setElementPosition (source, -1616.17, 683.47, 7.18, true)
  55.   takePlayerMoney (source, 50)
  56.   givePlayerMoney (attacker, 100)
  57.   end
  58. end
  59. addEventHandler ("onPlayerDamage", getRootElement(), arrest)
  60.  
  61. function joinCopTeam ( player, commandName )
  62.   setPlayerTeam ( player, teamLVPD )
  63.   setElementPosition ( player, 2265, 2438.3999023438, 3.2999999523163 )
  64.   giveWeapon ( player, 31, 10000 )
  65.   giveWeapon ( player, 24, 10000 )
  66.   giveWeapon ( player, 25, 10000 )
  67.   giveWeapon ( player, 29, 10000 )
  68.   giveWeapon ( player, 17, 10000 )
  69.   giveWeapon ( player, 42, 10000 )
  70.   setPlayerArmor ( player, 0 )
  71.   setPlayerSkin ( player, 280 )
  72.   setPlayerNametagColor ( player, 101, 101, 215 )
  73. end
  74. addCommandHandler ( "logincop", joinCopTeam )
  75.  
  76. policeVehicles = { [598]=true,[523]=true}
  77. policeSkins = { [280]=true }
  78.  
  79. function policeenterVehicle ( player, seat, jacked )
  80.     if ( policeVehicles[getElementModel ( source )] ) and ( not policeSkins[getElementModel ( player )] ) and ( seat == 0 ) then
  81.         removePedFromVehicle ( player )
  82.         outputChatBox ( "is Copcar ;P", player )
  83.     end
  84. end
  85. addEventHandler ( "onVehicleEnter", getRootElement(), policeenterVehicle )
  86.  
  87. function respawnPlayer(player, theTeam)
  88.      if (theTeam == teamLVPD) then
  89.           spawnPlayer ( player,  2265, 2438.3999023438, 3.2999999523163 )
  90.           giveWeapon ( player, 31, 10000 )
  91.           giveWeapon ( player, 24, 10000 )
  92.           giveWeapon ( player, 25, 10000 )
  93.           giveWeapon ( player, 29, 10000 )
  94.           giveWeapon ( player, 17, 10000 )
  95.           giveWeapon ( player, 42, 10000 )
  96.           setPlayerSkin ( player, 280 )
  97.           setPlayerNametagColor ( player, 101, 101, 215 )
  98.      end
  99. end
  100.  
  101. addEventHandler( "onPlayerWasted", getRootElement(), afterWasted )
  102.  
  103. addCommandHandler ("wanted",
  104. function (thePlayer, command)
  105.   if (getPlayerCount() > 1) then
  106.     local players = getElementsByType ("player")
  107.     outputChatBox ("---", thePlayer, 0, 0, 255, false)
  108.     outputChatBox ("Wanted list.", thePlayer, 0, 0, 255, false)
  109.     for i,v in ipairs (players) do
  110.       local level = getPlayerWantedLevel (v)
  111.       if (level > 0) then
  112.         outputChatBox (getPlayerName (v) .. " - " .. level, thePlayer, 0, 0, 255, false)
  113.       end
  114.     end
  115.     outputChatBox ("---", thePlayer, 0, 0, 255, false)
  116.   else
  117.     outputChatBox ("No Wanteds :D.", thePlayer, 0, 0, 255, false)
  118.   end
  119. end)
  120. ---sms----
  121. function sms(player,command,playername,...)
  122. local pname = getPlayerName(player)
  123. local MessageContent = {...}
  124. local MessageText = table.concat(MessageContent, " ")
  125.     if (playername ~= "" and playername ~= nil) then
  126.         local otherPlayer = getPlayerFromName(playername)
  127.         if(otherPlayer ~= false) then
  128.             if (MessageText ~= "" and MessageText ~= nil) then
  129.                 outputChatBox("sms by "..pname..": "..MessageText.."",otherPlayer,0,128,255,true)
  130.                 outputChatBox("sms to "..playername.." .  5$.",player,0,128,255,true)
  131.                 takePlayerMoney(player,5)
  132.            
  133.             else
  134.                 outputChatBox("Text?!.",player,255,128,0,true)
  135.             end
  136.         else
  137.             outputChatBox("Player its wrong.",player,255,128,0,true)
  138.         end
  139.     else
  140.         outputChatBox(" /sms player text.",player,255,128,0,true)
  141.     end
  142. end
  143.  
  144. addCommandHandler("sms",sms)
  145. ---sms----
  146. ----give_money----
  147. function money_func(player,cmd,playername,money)
  148.     if playername and money then
  149.       local player2 = getPlayerFromName(playername)
  150.       if player2 then
  151.        if tonumber(money) and tonumber(money) >= 1 then
  152.            givePlayerMoney(player2,tonumber(money))
  153.            takePlayerMoney(player,tonumber(money))
  154.            outputChatBox("you have by "..getPlayerName(player).." "..tonumber(money).." $", player2)
  155.            outputChatBox("you have "..getPlayerName(player2).." "..tonumber(money).." $!", player)
  156.        end
  157.       end
  158.     else
  159.          outputChatBox("/pay player money",player)
  160.     end
  161. end
  162. addCommandHandler("pay",money_func)
Advertisement
Add Comment
Please, Sign In to add comment