Jump to content

SetPedGravity - Only who do this command can do it |HELP PLS


Annas

Recommended Posts

i try to make (gravity) only Ped(player) have gravity , (no vehicles, no aircrafts)

function consoleSetPlayerGravity ( player, commandName, level ) 
    if ( player ) then          
        local success = setPedGravity ( player, tonumber ( 0.0060 ) ) 
        takePlayerMoney ( player, 50000) 
        if (not success) then 
            outputConsole( "Failed to set player gravity", player ) 
        end 
    end 
end 
addCommandHandler ( "setplayergravity", setPlayerGravity ) 
  

but idk why it not work + i wanna only who do this command "setplayergravity" can be in this type of gravity ."0.0060"

Link to comment
You must be kidding me...

Why don't you try it first yourself? If it is wrong I will correct you.

Sure i do :)

function consoleSetPlayerGravity ( player, commandName, level ) 
    if ( player ) then   
        local money = getPlayerMoney(player) 
        if money >= 15000 then 
        takePlayerMoney ( player, 15000) 
        else 
        outputChatBox("You dont have enough of money to use weed",player, 255, 0, 0) 
    end       
        local success = setPedGravity ( player, tonumber ( 0.0055 ) ) 
        if (not success) then 
            outputConsole( "Failed to set player gravity", player ) 
            outputChatBox("Weed is now Activated (it will auto Disabled when you Disconnect)",player, 255, 171, 0) 
        end 
    end 
end 
addCommandHandler ( "sb", consoleSetPlayerGravity ) 

but the probelem it not showed this when you buy it:

outputChatBox("Weed is now Activated (it will auto Disabled when you Disconnect)",player, 255, 171, 0)

HELP

Link to comment
  • Moderators
function consoleSetPlayerGravity ( player, commandName, level ) 
    if ( player ) then   
        local money = getPlayerMoney(player) 
        if money >= 15000 then 
            local success = setPedGravity ( player, tonumber ( 0.0055 ) ) 
            if (not success) then 
                outputConsole( "Failed to set player gravity", player ) 
            else -- success! 
                outputChatBox("Weed is now Activated (it will auto Disabled when you Disconnect)",player, 255, 171, 0) 
                takePlayerMoney ( player, 15000) 
            end 
             
        else -- not enought money 
            outputChatBox("You dont have enough of money to use weed", player, 255, 0, 0) 
        end       
    end 
end 
addCommandHandler ( "sb", consoleSetPlayerGravity ) 

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