new index, cmd[20]; cmd = strtok(cmdtext, index); if (strcmp(cmd, "/heal", true) == 0) { 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! / Zostałeś uzdrowiony/a!"); SendClientMessage(playerid, 0x00FF00AA, "Player healed / Osoba uzdrowiona!"); } else { SendClientMessage(playerid, 0xFF0000AA, "Player not found / Gracz nieznaleziony"); } } else { SendClientMessage(playerid, 0xFF0000AA, "USAGE/UŻYCIE: /heal <playerid/idgracza>"); } return 1; }
Originally Posted by [B2K
Hustler ]
how do u define a player that is a medic, what variable do u use for this? |
gTeam[playerid] = TEAM_MEDYK; } else if(classid == 4) {
else if(classid == 51){ gTeam[playerid] = TEAM_MEDYK; GameTextForPlayer(playerid, "~w~Medyk / Medic", 2000, 3);}
#define TEAM_MEDYK 2
if (strcmp(cmd, "/heal", true) == 0)
{
new tmp[20],id;
tmp = strtok(cmdtext, index);
if(gTeam[playerid] != TEAM_MEDYK) return SendClientMessage(playerid, 0xFF0000AA, "You need to be a medic to do that!");
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed! / Zosta?es' uzdrowiony/a!");
SendClientMessage(playerid, 0x00FF00AA, "Player healed / Osoba uzdrowiona!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found / Gracz nieznaleziony");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE/UZ.YCIE: /heal <playerid/idgracza>");
}
return 1;
}