Quote:
Originally Posted by Kitten
got a problem here why isnt this working this when other team that is not a medic it says unknown command
pawn Код:
new index, cmd[20]; cmd = strtok(cmdtext, index); if (strcmp(cmd, "/healhim", true) == 0) if(cTeam[playerid] == TEAM_MEDIC) if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!"); else { new tmp[20], id; tmp = strtok(cmdtext, index); if (strlen(tmp)) { id = strval(tmp); if (IsPlayerConnected(id)) { SetPlayerHealth(id, 100.0); SendClientMessage(id, 0x00FF00AA, "You have been healed by a Medic Survivor"); SendClientMessage(playerid, 0x00FF00AA, "You Have Healed The player"); } else { SendClientMessage(playerid, 0xFF0000AA, "Player not found"); } } else { SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\""); } return 1; }
|
Someone correct me if i am wrong, but you put
pawn Код:
if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!")
in the wrong place..
Supposed to be like
pawn Код:
{
else if(cTeam[playerid] != TEAM_MEDIC) SendClientMessage(playerid,COLOR_WHITE,"You are not a medic!");
}
Excuse the sloppy identation