24.07.2015, 15:17
Hello, I created a /sethp command, it works fine, it just shows my HP has been set to 3284234928, while it gives the right amount of HP.
What did I do wrong?
Код:
CMD:sethp(playerid, params[])
{
static
userid,
Float:amount;
if (PlayerData[playerid][pAdmin] < 2)
return SendErrorMessage(playerid, "You don't have permission to use this command.");
if (sscanf(params, "uf", userid, amount))
return SendSyntaxMessage(playerid, "/sethp [PlayerName/PlayerID] [0-100]");
if (userid == INVALID_PLAYER_ID)
return SendErrorMessage(playerid, "You have specified an invalid player.");
SetPlayerHealth(userid, amount);
SendBlueColorMessage(playerid, "> You have set %s's Health to %d.", ReturnName(userid, 0), amount);
SendBlueColorMessage(userid, "> Admin %s has set your Health to %d.", ReturnName(playerid, 0), amount);
return 1;
}


