raulrobi Posted April 21, 2010 Posted April 21, 2010 hey.im back.sorry im so lazy :( but i need a example for a buy script (only buy repair and buy nitro) Thank you for help.Sorry that im so lazy
Vivalavido Posted April 21, 2010 Posted April 21, 2010 I think this is the newer way to get scripts written for themselfs, just say "Sorry" and "Im lazy" alot
Aibo Posted April 21, 2010 Posted April 21, 2010 price = {} price.nitro = 100 price.repair = 100 addCommandHandler("buy", function (player, command, item) if item == "nitro" then if getPlayerMoney(player) > price.nitro then local vehicle = getPedOccupiedVehicle(player) if vehicle then addVehicleUpgrade(vehicle, 1010) takePlayerMoney(player, price.nitro) outputChatBox("You've bought a nitro", player, 0, 222, 0, true) else outputChatBox("You are not in a vehicle", player, 222, 0, 0, true) end else outputChatBox("Not enough cash, nitro costs $"..price.nitro, player, 222, 0, 0, true) end elseif item == "repair" then if getPlayerMoney(player) > price.repair then local vehicle = getPedOccupiedVehicle(player) if vehicle then fixVehicle(vehicle) takePlayerMoney(player, price.repair) outputChatBox("You've bought a repair", player, 0, 222, 0, true) else outputChatBox("You are not in a vehicle", player, 222, 0, 0, true) end else outputChatBox("Not enough cash, repair costs $"..price.repair, player, 222, 0, 0, true) end end end ) something like that (not tested)
50p Posted April 21, 2010 Posted April 21, 2010 I think this is the newer way to get scripts written for themselfs, just say "Sorry" and "Im lazy" alot At least he is being honest. To my vision, xbost's script should work just fine.
Vivalavido Posted April 21, 2010 Posted April 21, 2010 I think this is the newer way to get scripts written for themselfs, just say "Sorry" and "Im lazy" alot At least he is being honest. To my vision, xbost's script should work just fine. True, but saying your lazy and not even have the intention to learn LUA, is just wrong imo than asking others to do it for you.
dzek (varez) Posted April 21, 2010 Posted April 21, 2010 Hmm, my thoughts: If you are lazy - just keep beeing a "player" and don't bother anyone. If you are newbie - try to think by yourself, use google, help pages, wikis, ask for help on forums.
tinnetju Posted April 23, 2010 Posted April 23, 2010 I just can't get it worked... If i run it in my race server i get HTTP Response said error! Please someone help me!
COOKIE2 Posted April 24, 2010 Posted April 24, 2010 hey i made a gui for this with 2 buttons repair and nitro how do i set the defenitions to it/
tinnetju Posted April 25, 2010 Posted April 25, 2010 Oowwh i found the error, its server side not client My mistake!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now