Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- addEvent("buyNitro", true)
- addEventHandler("buyNitro", getRootElement(),
- function()
- if isPedInVehicle(source) then
- if ( getPlayerMoney (source) >= 7000 ) then
- takePlayerMoney(source, 7000)
- addVehicleUpgrade(getPedOccupiedVehicle(source),1010)
- outputChatBox("Nitro Successfully added", source, 255, 255, 0, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- else
- outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyRepair", true)
- addEventHandler("buyRepair", getRootElement(),
- function()
- if isPedInVehicle(source) then
- if ( getPlayerMoney (source) >= 5000 ) then
- takePlayerMoney(source, 5000)
- fixVehicle(getPedOccupiedVehicle(source))
- outputChatBox("Vehicle Successfully Fixed", source, 255, 255, 0, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- else
- outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyFlip", true)
- addEventHandler("buyFlip", getRootElement(),
- function()
- if isPedInVehicle(source) then
- if ( getPlayerMoney (source) >= 10000 ) then
- takePlayerMoney(source, 10000)
- rx, ry, rz = getVehicleRotation (getPedOccupiedVehicle(source))
- setVehicleRotation (getPedOccupiedVehicle(source), rx +180, ry, rz +180)
- outputChatBox("Car Successfully fliped", source, 255, 255, 0, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- else
- outputChatBox("You are not in a vehicle", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyHay", true)
- addEventHandler("buyHay", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 10000 ) then
- takePlayerMoney(source, 10000)
- x,y,z = getElementPosition( source )
- createObject ( 3374, x, y, z, 120, 0, 0 )
- outputChatBox("Hay Successfully droped", source, 255, 255, 0, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyHunter", true)
- addEventHandler("buyHunter", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 1000000 ) then
- takePlayerMoney(source, 1000000)
- x,y,z = getElementPosition( source )
- hunter = createVehicle ( 425, x, y, z )
- warpPedIntoVehicle(source,hunter)
- outputChatBox("Hunter Obtained", source, 255, 255, 0, true)
- outputChatBox( "** ALERT HUNTER DETECTED **", 255, 12, 15, true )
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyHydra", true)
- addEventHandler("buyHydra", getRootElement(),
- function()
- local pname = getPlayerName( source )
- if ( getPlayerMoney (source) >= 1500000 ) then
- takePlayerMoney(source, 1500000)
- x,y,z = getElementPosition( source )
- hydra = createVehicle ( 520, x, y, z )
- warpPedIntoVehicle(source,hydra)
- outputChatBox("Hydra Obtained", source, 255, 255, 0, true)
- outputChatBox( "** ALERT HYDRA DETECTED **", 255, 12, 15, true )
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyBarrel", true)
- addEventHandler("buyBarrel", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 12000 ) then
- takePlayerMoney(source, 12000)
- x,y,z = getElementPosition( source )
- createObject ( 1225, x, y, z, 90, 0, 0 )
- outputChatBox("Bareel Successfully droped", source, 255, 255, 0, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("Godmode", true)
- addEventHandler("Godmode", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 70000 ) then
- takePlayerMoney(source, 70000)
- outputChatBox("Godmode Successfully activated", source, 255, 255, 0, true)
- setVehicleDamageProof(getPedOccupiedVehicle(source),true)
- setTimer( setVehicleDamageProof, 60000, 1, getPedOccupiedVehicle(source), false)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyInvisible", true)
- addEventHandler("buyInvisible", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 20000 ) then
- takePlayerMoney(source, 20000)
- outputChatBox("Others cant see you now.", source, 255, 255, 0, true)
- setElementAlpha(getPedOccupiedVehicle(source),0)
- setElementAlpha(source,0)
- setPlayerNametagShowing(source, false)
- setTimer( setElementAlpha, 60000, 1, source, 500, true)
- setTimer( setElementAlpha, 60000, 1, getPedOccupiedVehicle(source), 500, true)
- setTimer( setPlayerNametagShowing, 60000, 1, source, true, true)
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyGodOfWar", true)
- addEventHandler("buyGodOfWar", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 2000000 ) then
- takePlayerMoney(source, 2000000)
- outputChatBox("All cars Successfully destroyed", source, 255, 255, 0, true)
- outputChatBox( "** ALERT GOD OF WAR ACTIVATED **", 255, 12, 15, true )
- vehicles = getElementsByType ( "vehicle" )
- for vehicleKey, vehicleValue in ipairs(vehicles) do
- blowVehicle ( vehicleValue )
- end
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("buyTimeOfIce", true)
- addEventHandler("buyTimeOfIce", getRootElement(),
- function()
- if ( getPlayerMoney (source) >= 2000000 ) then
- takePlayerMoney(source, 2000000)
- outputChatBox("All cars Successfully frozen", source, 255, 255, 0, true)
- outputChatBox( "** ALERT TIME OF ICE ACTIVATED **", 255, 12, 15, true )
- vehicles = getElementsByType ( "vehicle" )
- for vehicleKey, vehicleValue in ipairs(vehicles) do
- setVehicleFrozen ( vehicleValue, not isVehicleFrozen ( vehicleValue) )
- end
- else
- outputChatBox("Not enough money.", source, 255, 0, 0, true)
- end
- end
- )
- addEvent("sendMoney", true)
- addEventHandler("sendMoney", getRootElement(),
- function ( playerNick, amount )
- local cash = getPlayerMoney(source)
- if (cash > tonumber(amount)) then
- toWho = getPlayerFromName(playerNick)
- if (toWho ~= false) then
- givePlayerMoney(toWho,amount)
- name = getPlayerName(source)
- takePlayerMoney(source,amount)
- outputChatBox("You've given money amount of: " .. amount .. "$ to: " .. playerNick,source,255,255,150)
- outputChatBox(name .. " has given you money amount of: " .. amount .. "$!",toWho,255,255,245)
- else
- outputChatBox("Player did not exist",source,255,0,0)
- end
- else
- outputChatBox("Insufficient founds!",source,255,0,0)
- end
- end)
- function nameTagColor ( red,green,blue )
- setPlayerNametagColor ( source, red,green,blue )
- end
- addEvent( "setPlayerNameTagColor", true )
- addEventHandler ( "setPlayerNameTagColor", getRootElement(), nameTagColor)
- function setSkin ( skin )
- setPedSkin ( source, skin )
- end
- addEvent( "skin", true )
- addEventHandler ( "skin", getRootElement(), setSkin)
- function onPlayerQuit ( )
- local playeraccount = getPlayerAccount ( source )
- if ( playeraccount ) then
- local r, g, b = getPlayerNametagColor ( source )
- setAccountData ( playeraccount, "ColorRed", r )
- setAccountData ( playeraccount, "ColorGreen", g )
- setAccountData ( playeraccount, "ColorBlue", b )
- end
- end
- function onPlayerLogin ( )
- local playeraccount = getPlayerAccount ( source )
- if ( playeraccount ) then
- local tagColorRed = getAccountData ( playeraccount, "ColorRed" )
- local tagColorGreen = getAccountData ( playeraccount, "ColorGreen" )
- local tagColorBlue = getAccountData ( playeraccount, "ColorBlue" )
- if tagColorRed and tagColorGreen and tagColorBlue then
- setPlayerNametagColor ( source, tagColorRed, tagColorGreen, tagColorBlue )
- end
- end
- end
- addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
- addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
- addEvent("onPlayerDestructionDerbyWin",true)
- addEventHandler("onPlayerDestructionDerbyWin",getRootElement(),
- function (winner)
- givePlayerMoney(winner, 1200)
- outputChatBox(getPlayerName ( winner ) .. " has won $1200 as last player alive",getRootElement(),0,255,0)
- setElementData(winner,"Points",tonumber(getElementData(winner,"Points"))+5)
- setElementData(winner,"Race Wins",tonumber(getElementData(winner,"Race Wins"))+1)
- end)
- addEventHandler("onPlayerWasted",getRootElement(),
- function ()
- setElementData(source,"Race Loses",tonumber(getElementData(source,"Race Loses"))+1)
- setElementData(source,"Points",tonumber(getElementData(source,"Points"))-5)
- end)
Advertisement
Add Comment
Please, Sign In to add comment