Jump to content

Buy flip


JoZeFSvK

Recommended Posts

Posted

Hey /flip work and !flip dont work why ? command ! i use on !fix and !nos and work and this ...

function buyflip (source) 
    rx, ry, rz = getPedRotation (source) 
    x, y, z = getElementPosition (source) 
    vehicle = getPedOccupiedVehicle (source) 
    vehicler = getPedRotation (source) 
    if ( isPedInVehicle ( source ) ) then 
    local mapName = getMapName() 
    if not (string.find (mapName,"DD")) then 
    local cashHave = tonumber(loadPlayerData(source,"cash")) 
        if (cashHave >= 500) then 
                cashToTake =  cashHave - 500 
                savePlayerData(source,"cash", cashToTake) 
                outputChatBox("#007FFF[shop]#FFFFFF" ..getPlayerName(source).. "#FFFFFF has fliped his car for #007FFF500$. (/flip,!flip)", getRootElement(), 255, 255, 0, true) 
                setVehicleRotation ( vehicle, 0, 0, vehicler, true ) 
        scoreboardRefresh(source) 
        else 
            outputChatBox("#FF0000[shop]#FFFFFFYou need at least #FF0000500$#FFFFFF to buy flip.", source, 255, 0, 0, true) 
        end 
    else 
        outputChatBox("#FF0000[shop]#FFFFFFYou can't upgrade your car in a #FF0000DD map!", source, 255, 0, 0, true) 
    end 
    else 
        outputChatBox("#FF0000[shop]#FFFFFFYou've got to be #FF0000alive#FFFFFF to buy flip!", source, 255, 0, 0, true) 
    end 
end 
  
addCommandHandler('bf', buyflip) 
addCommandHandler('flip', buyflip) 
------------------------------------------------------- 
-- comand !flip  
------------------------------------------------------- 
addEventHandler('onPlayerChat',root, 
    function(msg,msgtype) 
        if msgtype == 0 then 
            if msg == "!flip" then 
                executeCommandHandler("buyflip",source) 
            end 
        end 
    end 
) 

Posted
comand work , my car fliped , but when i use !flip dont work

Try this

addEventHandler('onPlayerChat',root, 
    function(message, messageType) 
        if messageType == 0 then 
        if message == "!flip" then 
                executeCommandHandler("buyflip",source) 
            end 
        end 
    end 
) 

PS : This is just for the second function which is !flip not the whole script.

Guest Guest4401
Posted

The commands are bf and flip, but you execute buyflip.

Guest Guest4401
Posted
again /flip work and !flip dont work

Does /buyflip work? It doesn't.

Do you know why? Because that command doesn't exist.

addEventHandler('onPlayerChat',root, 
    function(msg,msgtype) 
        if msgtype == 0 then 
            if msg == "!flip" then 
                executeCommandHandler("flip",source) 
            end 
        end 
    end 
) 

Posted
why ? :-( command dont work :(

try

    addEventHandler('onPlayerChat',root, 
        function(msg,msgtype) 
            if msgtype == 0 then 
                if msg == "!flip" then 
                    executeCommandHandler("bf",source) 
                end 
            end 
        end 
    ) 

  • Scripting Moderators
Posted

You need to give the resource access to executeCommandHandler in the acl.xml file.

Guest Guest4401
Posted
addEventHandler('onPlayerChat',root, 
    function(msg,msgtype) 
        if msgtype == 0 then 
            if msg == "!flip" then 
                buyflip(source) 
            end 
        end 
    end 
) 

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