Quote:
Originally Posted by Konstantinos
As the above members already suggested, ZCMD and sscanf is a very good combination for commands.
PHP код:
CMD:sethealth(playerid, params[])
{
new
id,
Float: amount;
if (sscanf(params, "rf", id, amount)) return SendClientMessage(playerid, -1, "Usage: /sethealth <ID/Part Of Name> <amount>");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player");
//if (!(0.0 <= amount <= 100.0)) return SendClientMessage(playerid, -1, "You can set an amount of health between 0.0 and 100.0");
SetPlayerHealth(id, amount);
return 1;
}
@Jamester: "h" specifier is for hex.
|
since samp 0.3 the SetPlayerHealth amount is not float. As I know