04.05.2011, 13:20
pawn Код:
new gTeam1[MAX_PLAYERS]; // this needs to be global
...
if (strcmp("/heal", cmdtext, true, 5) == 0)
{
if(gTeam1[playerid] == TEAM_MEDICS)
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,RED,"USAGE: /heal [playerid]");
return 1;
}
new player1;
player1 = ReturnUser(tmp);
if(IsPlayerConnected(player1))
{
SetPlayerHealth(player1,100);
GivePlayerMoney(playerid,300);
GivePlayerMoney(playerid,-300);
new pn1[24], medicname[24];
GetPlayerName(player1,pn1,sizeof(pn1));
GetPlayerName(playerid,medicname,sizeof(medicname));
new string[128];
format(string,sizeof(string),"%s has been healed by medic %s.",pn1,medicname);
SendClientMessageToAll(GREEN,string);
}
}
return 1;
}