Annas Posted May 12, 2015 Share Posted May 12, 2015 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
Moderators IIYAMA Posted May 12, 2015 Moderators Share Posted May 12, 2015 addCommandHandler ( "setplayergravity", setPlayerGravity ) addCommandHandler ( "setplayergravity", consoleSetPlayerGravity ) Link to comment
Annas Posted May 12, 2015 Author Share Posted May 12, 2015 working thx , now i need it if you dont have money then say "you dont have enout of money to buy this" Link to comment
Moderators IIYAMA Posted May 12, 2015 Moderators Share Posted May 12, 2015 local money = getPlayerMoney(player) if money >= 50000 then else-- not enough money outputChatBox("......",player) end Link to comment
Annas Posted May 12, 2015 Author Share Posted May 12, 2015 local money = getPlayerMoney(player) if money >= 50000 then else-- not enough money outputChatBox("......",player) end pls complete LUA and thxx <3 Link to comment
Moderators IIYAMA Posted May 12, 2015 Moderators Share Posted May 12, 2015 You must be kidding me... Why don't you try it first yourself? If it is wrong I will correct you. Link to comment
Annas Posted May 12, 2015 Author Share Posted May 12, 2015 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 IIYAMA Posted May 12, 2015 Moderators Share Posted May 12, 2015 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
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