Guest User

Script server kavalsky

a guest
Jul 28th, 2010
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.83 KB | None | 0 0
  1. addEvent("buyNitro", true)
  2. addEventHandler("buyNitro", getRootElement(),
  3.   function()
  4.     if isPedInVehicle(source) then
  5.       if ( getPlayerMoney (source) >= 7000 ) then
  6.         takePlayerMoney(source, 7000)
  7.         addVehicleUpgrade(getPedOccupiedVehicle(source),1010)
  8.         outputChatBox("Nitro Successfully added", source, 255, 255, 0, true)
  9.       else
  10.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  11.       end    
  12.     else
  13.       outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
  14.     end
  15.   end
  16. )
  17.  
  18. addEvent("buyRepair", true)
  19. addEventHandler("buyRepair", getRootElement(),
  20.   function()
  21.     if isPedInVehicle(source) then
  22.       if ( getPlayerMoney (source) >= 5000 ) then
  23.         takePlayerMoney(source, 5000)
  24.         fixVehicle(getPedOccupiedVehicle(source))
  25.         outputChatBox("Vehicle Successfully Fixed", source, 255, 255, 0, true)
  26.       else
  27.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  28.       end    
  29.     else
  30.       outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
  31.     end
  32.   end
  33. )
  34.  
  35. addEvent("buyFlip", true)
  36. addEventHandler("buyFlip", getRootElement(),
  37.   function()
  38.     if isPedInVehicle(source) then
  39.       if ( getPlayerMoney (source) >= 10000 ) then
  40.         takePlayerMoney(source, 10000)
  41.         rx, ry, rz = getVehicleRotation (getPedOccupiedVehicle(source))    
  42.         setVehicleRotation (getPedOccupiedVehicle(source), rx +180, ry, rz +180)
  43.         outputChatBox("Car Successfully fliped", source, 255, 255, 0, true)
  44.       else
  45.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  46.       end    
  47.     else
  48.       outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
  49.     end
  50.   end
  51. )
  52.  
  53. addEvent("buyHay", true)
  54. addEventHandler("buyHay", getRootElement(),
  55. function()
  56.       if ( getPlayerMoney (source) >= 10000 ) then
  57.         takePlayerMoney(source, 10000)
  58.         x,y,z = getElementPosition( source )
  59.         createObject ( 3374, x, y, z, 120, 0, 0 )
  60.         outputChatBox("Hay Successfully droped", source, 255, 255, 0, true)
  61.       else
  62.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  63.     end
  64.   end
  65. )
  66.  
  67. addEvent("buyHunter", true)
  68. addEventHandler("buyHunter", getRootElement(),
  69. function()
  70.       if ( getPlayerMoney (source) >= 1000000 ) then
  71.         takePlayerMoney(source, 1000000)
  72.         x,y,z = getElementPosition( source )
  73.         hunter = createVehicle ( 425, x, y, z )
  74.         warpPedIntoVehicle(source,hunter)
  75.         outputChatBox("Hunter Obtained", source, 255, 255, 0, true)
  76.         outputChatBox( "** ALERT HUNTER DETECTED **", 255, 12, 15, true )
  77.       else
  78.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  79.     end
  80.   end
  81. )
  82.  
  83. addEvent("buyHydra", true)
  84. addEventHandler("buyHydra", getRootElement(),
  85. function()
  86.   local pname = getPlayerName( source )
  87.       if ( getPlayerMoney (source) >= 1500000 ) then
  88.         takePlayerMoney(source, 1500000)
  89.         x,y,z = getElementPosition( source )
  90.         hydra = createVehicle ( 520, x, y, z )
  91.         warpPedIntoVehicle(source,hydra)
  92.         outputChatBox("Hydra Obtained", source, 255, 255, 0, true)
  93.         outputChatBox( "** ALERT HYDRA DETECTED **", 255, 12, 15, true )
  94.       else
  95.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  96.     end
  97.   end
  98. )
  99.  
  100. addEvent("buyBarrel", true)
  101. addEventHandler("buyBarrel", getRootElement(),
  102. function()
  103.       if ( getPlayerMoney (source) >= 12000 ) then
  104.         takePlayerMoney(source, 12000)
  105.         x,y,z = getElementPosition( source )
  106.         createObject ( 1225, x, y, z, 90, 0, 0 )
  107.         outputChatBox("Bareel Successfully droped", source, 255, 255, 0, true)
  108.       else
  109.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  110.     end
  111.   end
  112. )
  113.  
  114. addEvent("Godmode", true)
  115. addEventHandler("Godmode", getRootElement(),
  116. function()
  117.       if ( getPlayerMoney (source) >= 70000 ) then
  118.         takePlayerMoney(source, 70000)
  119.         outputChatBox("Godmode Successfully activated", source, 255, 255, 0, true)
  120.         setVehicleDamageProof(getPedOccupiedVehicle(source),true)
  121.         setTimer( setVehicleDamageProof, 60000, 1, getPedOccupiedVehicle(source), false)
  122.       else
  123.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  124.     end
  125.   end
  126. )
  127.  
  128. addEvent("buyInvisible", true)
  129. addEventHandler("buyInvisible", getRootElement(),
  130. function()
  131.       if ( getPlayerMoney (source) >= 20000 ) then
  132.         takePlayerMoney(source, 20000)
  133.         outputChatBox("Others cant see you now.", source, 255, 255, 0, true)
  134.         setElementAlpha(getPedOccupiedVehicle(source),0)
  135.         setElementAlpha(source,0)
  136.         setPlayerNametagShowing(source, false)
  137.         setTimer( setElementAlpha, 60000, 1, source, 500, true)
  138.         setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true)
  139.         setTimer( setPlayerNametagShowing, 60000, 1, source, true, true)
  140.       else
  141.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  142.     end
  143.   end
  144. )
  145.  
  146. addEvent("buyGodOfWar", true)
  147. addEventHandler("buyGodOfWar", getRootElement(),
  148. function()
  149.        if ( getPlayerMoney (source) >= 2000000 ) then
  150.         takePlayerMoney(source, 2000000)
  151.         outputChatBox("All cars Successfully destroyed", source, 255, 255, 0, true)
  152.         outputChatBox( "** ALERT GOD OF WAR ACTIVATED **", 255, 12, 15, true )
  153.         vehicles = getElementsByType ( "vehicle" )
  154. for vehicleKey, vehicleValue in ipairs(vehicles) do
  155.     blowVehicle ( vehicleValue )
  156. end    
  157.       else
  158.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  159.     end
  160.   end
  161. )
  162.  
  163. addEvent("buyTimeOfIce", true)
  164. addEventHandler("buyTimeOfIce", getRootElement(),
  165. function()
  166.        if ( getPlayerMoney (source) >= 2000000 ) then
  167.         takePlayerMoney(source, 2000000)
  168.         outputChatBox("All cars Successfully frozen", source, 255, 255, 0, true)
  169.         outputChatBox( "** ALERT TIME OF ICE ACTIVATED **", 255, 12, 15, true )
  170.         vehicles = getElementsByType ( "vehicle" )
  171. for vehicleKey, vehicleValue in ipairs(vehicles) do
  172.     setVehicleFrozen ( vehicleValue, not isVehicleFrozen ( vehicleValue) )
  173. end    
  174.       else
  175.         outputChatBox("Not enough money.", source, 255, 0, 0, true)
  176.     end
  177.   end
  178. )
  179.  
  180. addEvent("sendMoney", true)
  181. addEventHandler("sendMoney", getRootElement(),
  182. function ( playerNick, amount )
  183. local cash = getPlayerMoney(source)
  184. if (cash > tonumber(amount)) then
  185. toWho = getPlayerFromName(playerNick)
  186. if (toWho ~= false) then
  187. givePlayerMoney(toWho,amount)
  188. name = getPlayerName(source)
  189. takePlayerMoney(source,amount)
  190. outputChatBox("You've given money amount of: " .. amount .. "$ to: " .. playerNick,source,255,255,150)
  191. outputChatBox(name .. " has given you money amount of: " .. amount .. "$!",toWho,255,255,245)
  192. else
  193. outputChatBox("Player did not exist",source,255,0,0)
  194. end
  195. else
  196. outputChatBox("Insufficient founds!",source,255,0,0)
  197.   end
  198. end)
  199.  
  200. function nameTagColor ( red,green,blue )
  201.     setPlayerNametagColor ( source, red,green,blue )
  202. end
  203. addEvent( "setPlayerNameTagColor", true )
  204. addEventHandler ( "setPlayerNameTagColor", getRootElement(), nameTagColor)
  205.  
  206. function setSkin ( skin )
  207.     setPedSkin ( source, skin )
  208. end
  209. addEvent( "skin", true )
  210. addEventHandler ( "skin", getRootElement(), setSkin)
  211.  
  212. function onPlayerQuit ( )
  213.       local playeraccount = getPlayerAccount ( source )
  214.       if ( playeraccount ) then
  215.          local r, g, b = getPlayerNametagColor ( source )
  216.             setAccountData ( playeraccount, "ColorRed", r )
  217.             setAccountData ( playeraccount, "ColorGreen", g )
  218.             setAccountData ( playeraccount, "ColorBlue", b )           
  219.       end
  220. end
  221.  
  222. function onPlayerLogin ( )
  223.       local playeraccount = getPlayerAccount ( source )
  224.       if ( playeraccount ) then
  225.             local tagColorRed = getAccountData ( playeraccount, "ColorRed" )
  226.             local tagColorGreen = getAccountData ( playeraccount, "ColorGreen" )           
  227.             local tagColorBlue = getAccountData ( playeraccount, "ColorBlue" )         
  228.             if tagColorRed and tagColorGreen and tagColorBlue then
  229.                  setPlayerNametagColor ( source, tagColorRed, tagColorGreen, tagColorBlue )
  230.             end
  231.       end
  232. end
  233.  
  234. addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
  235. addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
  236.  
  237. addEvent("onPlayerDestructionDerbyWin",true)
  238. addEventHandler("onPlayerDestructionDerbyWin",getRootElement(),
  239. function (winner)
  240.         givePlayerMoney(winner, 1200)
  241.         outputChatBox(getPlayerName ( winner ) .. " has won $1200 as last player alive",getRootElement(),0,255,0)
  242.         setElementData(winner,"Points",tonumber(getElementData(winner,"Points"))+5)    
  243.         setElementData(winner,"Race Wins",tonumber(getElementData(winner,"Race Wins"))+1)      
  244. end)
  245.  
  246. addEventHandler("onPlayerWasted",getRootElement(),
  247. function ()
  248.         setElementData(source,"Race Loses",tonumber(getElementData(source,"Race Loses"))+1)
  249.         setElementData(source,"Points",tonumber(getElementData(source,"Points"))-5)    
  250. end)
Advertisement
Add Comment
Please, Sign In to add comment