Quote:
Originally Posted by Seif_
Quote:
Originally Posted by Serbish
Код:
if(strcmp("/health", cmd, true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_MAIN, "Type /health <ID>");
if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_MAIN, "Enter a valid player ID!");
new player = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(player, pname, sizeof(pname));
new string[256];
format(string, sizeof(string), "%s's health amount is %d!", pname, GetPlayerHealth(playerid));
SendClientMessage(playerid, COLOR_GREEN, string);
return 1;
}
|
You should at least give him a working code... indented.
Are you just doing that for a check or are you setting it to 4000 and then checking using GetPlayerHealth? If so, just store the value of the health you set in a variable.
|
You need glasses or why this code isn't working?