Jump to content

Mini COsa


Recommended Posts

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 by Guest
Link to comment
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

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 :mrgreen: .

Se invece eri sincero maybe potevo aiutarti :wink:

Link to comment

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...