#Whit3^ Posted December 20, 2012 Share Posted December 20, 2012 (edited) Ho cercato nei forum e ho trovato questo funziona ma ma Come Faccio A Fare Che Queste Due Funzioni Si possono Fare Sono una volta ogni mappa [DM]? Hunter è sempre relativo all'userpanel di Nextreme function buyNitro(p) if (isPedInVehicle(p)) then local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local v = getPedOccupiedVehicle(p) if playerCash >= RepairCost then outputChatBox(getPlayerName(p).." Has bought Nitro for 4000$", getRootElement(), 0, 255, 0) savePlayerData(thePlayer,"cash",playerCash-RepairCost) addVehicleUpgrade(v, 1008) scoreboardRefresh(thePlayer) else outputChatBox("You don't have enought money!", p, 255, 0, 0) end else outputChatBox("You need to be in vehicle!", p, 255, 0, 0) end end function buyRepair(p) if (isPedInVehicle(p)) then local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local v = getPedOccupiedVehicle(p) if playerCash >= RepairCost then outputChatBox(getPlayerName(p).." Has bought a Repair for 4000$", getRootElement(), 0, 255, 0, true) fixVehicle(v) savePlayerData(thePlayer,"cash",playerCash-RepairCost) scoreboardRefresh(thePlayer) else outputChatBox("You don't have enought money!", p, 255, 0, 0) end else outputChatBox("You need to be in vehicle!", p, 255, 0, 0) end end addCommandHandler("br", buyRepair) addCommandHandler("bn", buyNitro) Edited December 21, 2012 by Guest Link to comment
3NAD Posted December 20, 2012 Share Posted December 20, 2012 function buyNitro ( thePlayer ) if isPedInVehicle ( thePlayer ) then local playerCash = tonumber ( loadPlayerData ( thePlayer, "cash" ) ) local v = getPedOccupiedVehicle ( thePlayer ) if playerCash >= RepairCost then outputChatBox ( getPlayerName ( thePlayer ).." Has bought Nitro for 4000$", root, 0, 255, 0, true ) savePlayerData ( thePlayer, "cash", playerCash - RepairCost ) addVehicleUpgrade ( v, 1008 ) scoreboardRefresh ( thePlayer ) else outputChatBox ( "You don't have enought money!", thePlayer, 255, 0, 0, true ) end else outputChatBox ( "You need to be in vehicle!", thePlayer, 255, 0, 0, true ) end end function buyRepair ( thePlayer ) if isPedInVehicle ( thePlayer ) then local playerCash = tonumber ( loadPlayerData ( thePlayer, "cash" ) ) local v = getPedOccupiedVehicle ( thePlayer ) if playerCash >= RepairCost then outputChatBox ( getPlayerName ( thePlayer ).." Has bought a Repair for 4000$", root, 0, 255, 0, true) fixVehicle ( v ) savePlayerData ( thePlayer, "cash", playerCash - RepairCost ) scoreboardRefresh ( thePlayer ) else outputChatBox ( "You don't have enought money!", thePlayer, 255, 0, 0, true ) end else outputChatBox ( "You need to be in vehicle!", thePlayer, 255, 0, 0, true ) end end addCommandHandler ( "br", buyRepair ) addCommandHandler ( "bn", buyNitro ) Link to comment
#Whit3^ Posted December 20, 2012 Author Share Posted December 20, 2012 Who is The Error? Link to comment
HunT Posted December 21, 2012 Share Posted December 21, 2012 Devi usare una variabile,te l'ho mostrata 10 mila volte variabile = 0 variabile = 1 or variabile = true variabile = false Non devi far altro che checcare la variabile e settarla check 0 set 1 onMapStarting set 0 per resettare la variabile. Piu di questo non posso aiutarti perche il codice non è tuo e in più hai anche il coraggio di dire " Ho appena Fatto questo ",in verità non hai fatto un cazzo perche la variabile e molto più semplice della funzione che dici di aver fatto . Se invece eri sincero maybe potevo aiutarti Link to comment
#Whit3^ Posted December 21, 2012 Author Share Posted December 21, 2012 Guarda che fatto io non è difficile fare sta cosa basta che copi uno script ci cambi delle cose cambi il testo e via poi il resto del save account data oppure (playerCash - RepairCost ) non è difficile cmq GRazie Funge I love u Link to comment
xShocKz Posted December 22, 2012 Share Posted December 22, 2012 copiare e modificare qualcosina non è "fatto io" Link to comment
HunT Posted December 22, 2012 Share Posted December 22, 2012 copiare e modificare qualcosina non è "fatto io" Se ci fai caso ha editato il primo post perché prima era "Ho appena fatto questo" e non "ho trovato questo" Link to comment
#Whit3^ Posted December 24, 2012 Author Share Posted December 24, 2012 Not Work How To fix? function buyRepair(p) if repairset == false then if (isPedInVehicle(p)) then local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local v = getPedOccupiedVehicle(p) if playerCash >= RepairCost then outputChatBox(getPlayerName(p).." Has bought a Repair for 4000$", getRootElement(), 0, 255, 0, true) fixVehicle(v) repairset = thePlayer savePlayerData(thePlayer,"cash",playerCash-RepairCost) scoreboardRefresh(thePlayer) else outputChatBox("You don't have enought money!", p, 255, 0, 0) end else outputChatBox("You need to be in vehicle!", p, 255, 0, 0) end outputChatBox("You most be wait a nextmap for buy another repair!", p, 255, 0, 0) end addCommandHandler("br", buyRepair) Link to comment
xShocKz Posted December 24, 2012 Share Posted December 24, 2012 non è roba tua, non ti aiuterò mai. Link to comment
HunT Posted December 24, 2012 Share Posted December 24, 2012 Per l'ennesima volta ti mostro la variabile Non ti entra proprio in testa. repairset = true -- puoi usare anche 0 ed 1 function buyRepair(p) if (isPedInVehicle(p)) and repairset == true then -- quando il repairset e true local playerCash = tonumber(loadPlayerData(thePlayer,"cash")) local v = getPedOccupiedVehicle(p) if playerCash >= RepairCost then outputChatBox(getPlayerName(p).." Has bought a Repair for 4000$", getRootElement(), 0, 255, 0, true) fixVehicle(v) repairset = false -- settiamo false savePlayerData(thePlayer,"cash",playerCash-RepairCost) scoreboardRefresh(thePlayer) else outputChatBox("You don't have enought money!", p, 255, 0, 0) end else outputChatBox("You need to be in vehicle!", p, 255, 0, 0) end outputChatBox("You most be wait a nextmap for buy another repair!", p, 255, 0, 0) end addCommandHandler("br", buyRepair) Per ritornare al valore true puoi usare onMapStarting. Link to comment
#Whit3^ Posted December 24, 2012 Author Share Posted December 24, 2012 Ok Grz Scusa Padrone losai che ti amo asd(poi cancella sta cazzata ) Link to comment
HunT Posted December 24, 2012 Share Posted December 24, 2012 Cmq mi sono confuso Ci vuole la variabile certo ma dal punto di vista del player. Quindi devi usare setElementData true false oppure 0 1 if getElementData etc.. Link to comment
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