Jump to content

help


DonOmar

Recommended Posts

Posted

Very simple

if tonumber (ammo) > tonumber (vip) then return end  

You create all of this and you don't know how to prevent players from converting more than they have.

Posted

Lol using 3 server names inside the same code :fp:, and you said that it's your code.

function convert(player, cmd, ammo) 
    if player and isElement(player) then  
        local vip = getElementData(player, "CIFvip") or 0 
        if tonumber(ammo) then  
            if (vip > 0) then 
                if tonumber(ammo) < vip then  
                    local cash = math.ceil(tonumber(ammo)*10000 ) 
                    exports.CIFvip:removePlayerDonator(getAccountName(getPlayerAccount(player)),ammo) 
                    exports.CRPaccounts:GPM(player, cash, "converted "..ammo.." VIP Hours for "..cash) 
                    outputChatBox("You have successfully converted "..exports.CORmisc:formatNumber(ammo).." VIP hours to "..exports.CORmisc:formatNumber(cash).."", player, 0, 255, 0) 
                else 
                    outputChatBox("You don't have VIP hours to convert!", player, 255, 0, 0) 
                end 
            end 
        end  
    end  
end 
addCommandHandler("convertviptomoney", convert) 

Posted

Dude thank you for ur help and u don't know that CIF firstly was COR then CRP then became CIF just it it's our scripts and thank you for ur much help.

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