XeRo Posted July 23, 2015 Posted July 23, 2015 Hi Can You Help Me. I want Somebody with money such as Nitro Userpanel My Nitro Code (Server-side) addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) end end ) My Client Code (Client-side) addEventHandler("onClientGUIClick",root, function() if source == Nitro then triggerServerEvent("nitroPickup", getLocalPlayer()) local sound = playSound("pickup.mp3") setSoundVolume(sound, 0.5) end end )
XeRo Posted July 23, 2015 Author Posted July 23, 2015 any error in debugscript 3? No, There's No Problem. I want the user Panel as well as take money with Nitro I have DD server. Custom Panel I did but I want to take with the benefit of the user panel Nitro?
BluntZ Posted July 23, 2015 Posted July 23, 2015 Zero Can you use Translator ? I cant understand what you really want
XeRo Posted July 23, 2015 Author Posted July 23, 2015 Zero Can you use Translator ? I cant understand what you really want Yes . Sorry my bad English Speak User Panel in The Player's Money with Nitro Purchased take want
TheSmart Posted July 23, 2015 Posted July 23, 2015 really i didn't get you but i think you need to buy nitro by money? so then use it addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney ( player, 1000 ) outputChatBox ( "You Bought a Nitro", getRootElement(), 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end )
XeRo Posted July 23, 2015 Author Posted July 23, 2015 really i didn't get you but i think you need to buy nitro by money?so then use it addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney ( player, 1000 ) outputChatBox ( "You Bought a Nitro", getRootElement(), 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end ) User Panel of Own It creates money with Purchased take Nitro ? Pİcture ScreenShot Upload ?
XeRo Posted July 23, 2015 Author Posted July 23, 2015 what you mean really? I want to Allow Purchased with money
TheSmart Posted July 23, 2015 Posted July 23, 2015 addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney ( player, 1000 ) outputChatBox ( "You Bought a Nitro", getRootElement(), 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end )
SpecT Posted July 23, 2015 Posted July 23, 2015 addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then local account = getPlayerAccount(player) if account then if getAccountData(account,"cash") >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "You Bought a Nitro", player, 0, 0, 0, true ) else outputChatBox ( "You need 1000 to buy nitro", getRootElement(), 0, 0, 0, true ) end end end end )
The Don Posted July 23, 2015 Posted July 23, 2015 -- Client addEventHandler("onClientGUIClick",root, function() if source == Nitro then triggerServerEvent("nitroPickup", localPlayer) local sound = playSound("pickup.mp3") setSoundVolume(sound, 0.5) end end ) --Server addEvent("nitroPickup", true) addEventHandler("nitroPickup", root, function ( ) if getPlayerMoney(source) >= 1000 then if isPedInVehicle(source) then addVehicleUpgrade(getPedOccupiedVehicle(source),1010) takePlayerMoney(source,1000) else outputChatBox ("You're poor m8",source,255,0,0) end end end )
XeRo Posted July 23, 2015 Author Posted July 23, 2015 (edited) Error Please Help Me. server.lua Code addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function(player) if isPedInVehicle(source) then local account = getPlayerAccount(player) if account then if getAccountData(account,"cash") >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "Buy Nitro [$1000 ]", player, 0, 0, 0, true ) else outputChatBox ( "You enough to money", getRootElement(), 0, 0, 0, true ) end end end end ) Edited July 23, 2015 by Guest
GTX Posted July 23, 2015 Posted July 23, 2015 addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function() if isPedInVehicle(source) then local account = getPlayerAccount(source) if account then if getAccountData(account,"cash") >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",(getAccountData(account,"cash") or 0)-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "Buy Nitro [$1000 ]", source, 0, 0, 0, true ) else outputChatBox ( "You enough to money", source, 0, 0, 0, true ) end end end end )
XeRo Posted July 23, 2015 Author Posted July 23, 2015 addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function() if isPedInVehicle(source) then local account = getPlayerAccount(source) if account then if getAccountData(account,"cash") >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",(getAccountData(account,"cash") or 0)-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "Buy Nitro [$1000 ]", source, 0, 0, 0, true ) else outputChatBox ( "You enough to money", source, 0, 0, 0, true ) end end end end ) Error Please Fix .
SpecT Posted July 23, 2015 Posted July 23, 2015 Don't spam lel ... Post the server-side of the userpanel. BTW thanks GTX for editing the code I wrote (made it for 1-2 minutes cuz I had no time) and forgot to get the data and then remove the value ...
XeRo Posted July 23, 2015 Author Posted July 23, 2015 Don't spam lel ... Post the server-side of the userpanel.BTW thanks GTX for editing the code I wrote (made it for 1-2 minutes cuz I had no time) and forgot to get the data and then remove the value ... Please Fix I'm Bad
GTX Posted July 23, 2015 Posted July 23, 2015 No problem, toni And XeRo, don't spam! addEvent("nitroPickup", true) addEventHandler("nitroPickup", getRootElement(), function() if isPedInVehicle(source) then local account = getPlayerAccount(source) if account then if tonumber(getAccountData(account,"cash")) >= 1000 then --- change the string "cash" to what the money data is saved (cash,money) addVehicleUpgrade(getPedOccupiedVehicle(source),1010) setAccountData(account,"cash",(tonumber(getAccountData(account,"cash")) or 0)-1000) --- change the string "cash" to what the money data is saved (cash,money) outputChatBox ( "Buy Nitro [$1000 ]", source, 0, 0, 0, true ) else outputChatBox ( "You enough to money", source, 0, 0, 0, true ) end end end end )
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