Quote:
Originally Posted by nezo2001
PHP код:
CMD:heal(playerid, params[])
{
new
id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
else
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed");
SendClientMessage(playerid, 0x00FF00AA, "Player healed");
}
return 1;
}
Thing like that where is the code that make the player heal the other player with the id he typed ??
|
"if(sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");"
Entered player ID stored in the variable "id".
"SetPlayerHealth(id, 100.0);"
Set the player with the entered ID (stored in "id") to 100.