18.01.2011, 15:27
THANKS! JaTochNietDan
And O.o my code just stopped working.
when i type "/setplayerhealth" then it returns:
Usage: "setplayerhealth <playerid> <amount>"
Error: Please use |Max|: 100, |Min|: 1
(Hover the last line)
And O.o my code just stopped working.
when i type "/setplayerhealth" then it returns:
Usage: "setplayerhealth <playerid> <amount>"
Error: Please use |Max|: 100, |Min|: 1
(Hover the last line)
pawn Code:
dcmd_setplayerhealth(playerid, params[])
{
new targetid, Float:amount;
if(sscanf(params, "uf", targetid, amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/setplayerhealth <playerid> <amount>\"");
else if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
{
if(amount > 1 && amount < 101)
{
new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string, sizeof(string), "%s(%d) set %s(%d)'s health to %.0f", targetname, targetid, playername, playerid, amount);
SendClientMessageToAll(0x50FF05FF, string);
SetPlayerHealth(playerid, amount);
return 1;
} else return SendClientMessage(playerid, 0xFFFFFFFF,"Error: Please use |Max|: 100, |Min|: 1");
}
}