13.01.2016, 10:47
Hey again,
I made a command that will set the gravity to G Forces (1G = 0.008 gravity). But it bugs in a way I can't explain.
I need help with fixing or re-making this. I basically want a command that sets the gravity to G Forces. So "/setgravity 2" will set it to 0.016. Can anyone help me with this?
Ps. I also need to be able to use decimal numbers in the command ("/setgravity 0.5")...
I made a command that will set the gravity to G Forces (1G = 0.008 gravity). But it bugs in a way I can't explain.
PHP код:
COMMAND:setgravity(playerid, params[])
{
new GForce;
if(level[playerid] >= 4)
{
if(sscanf(params, "f", GForce)) return SendClientMessage(playerid, COLOR_RED, "Usage: /setgravity [50 to -50]");
else if(GForce > 50 || GForce < -50)
{
{
new Float:Gravity;
Gravity = floatmul(0.008, GForce);
SetGravity(Gravity);
}
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR : Gravity cant be above 50 or under -50!");
}
else return SendClientMessage(playerid, COLOR_RED, "ERROR : You have to be Administrator level 4 to use this command!");
return 1;
}
Ps. I also need to be able to use decimal numbers in the command ("/setgravity 0.5")...