02.03.2011, 12:59
Quote:
Search for the message your recieving within your script and make sure the if statement is returning the message correcty and not just sending it.
|
pawn Код:
if(strcmp("/healplayer", cmd, true) == 0)
{
if (gTeam[playerid] == MEDIC || gTeam[playerid] == ADMIN)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_GREEN,"USAGE: /heal [id]");
}
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_BROWN,"This player is not online!");
}
new Float:X,Float:Y,Float:Z, string[128], name[MAX_PLAYER_NAME];
GetPlayerName(id,name,128);
GetPlayerPos(id,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid,3,X,Y,Z))
{
format(string,128,"[INFO] Medic/Admin %s[%d] has healed you!", name, pid);
SetPlayerHealth(id,100);
SendClientMessage(id,COLOR_YELLOWORANGE,string);
SendClientMessage(playerid, COLOR_GREEN, " You have succesfully healed the player !");
DisablePlayerCheckpoint(playerid);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not near the player!");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"You're not a Medic/Admin!");//here !
}
return 1;
}