25.05.2012, 11:38
I have tried to add "IsPlayerCloseToEnemy" in my script but it dosn't work, what is this name of the function? I mean, the player can't /armour close to a enemy..
if(IsPlayerInRzngeOfPoint(playerid, range, X, Y, Z))
stock IsPlayerCloseToEnemy(playerid)
{
new bool:returnval = false, Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); //store the players position in our Pos array
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
//check if anyone is close to that position that's on a different team
if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2]) && GetPlayerTeam(i) != GetPlayerTeam(playerid))
{
//if so, we're going to return true
returnval = true;
break;
}
}
}
//if not it's going to return false as that's what returnval defaults at
return returnval;
}
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]) && GetPlayerTeam(i) != GetPlayerTeam(playerid));
return 1;
}
GivePlayerMoney(playerid, -1000);
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, GREEN, "You have refilled your health but lost 1000.");
return 1;
}