18.10.2011, 19:02
Quote:
Thats because '0.008' is a float, and not an integer.
Change the 'else if(sscanf(params,"d",gravity))' to 'else if(sscanf(params,"f",gravity))' |
pawn Код:
CMD:changegravity(playerid,params[]){
new Float:gravity, string[128];
if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid,COLOR_GRAY,"Error: You're not on admin duty!");
else if(PlayerInfo[playerid][pAdmin] < 4) return AdminRefuse(playerid);
else if(sscanf(params,"f",gravity)) return SendClientMessage(playerid,COLOR_GRAY,"Syntax: /changegravity [gravity]");
else
{
format(string,sizeof(string),"Admin %s has set the gravity to %f",GetName(playerid),gravity);
SendClientMessageToAll(COLOR_YELLOW,string);
}
return 1;
}