01.08.2015, 15:15
Hmm alright but heres another issue Im having with it, it keeps searching for that player I think.
Whats wrong with this code then
It keeps making the infinite loop or something
Whats wrong with this code then
pawn Код:
public CheckPlayersInRangeOfAA(playerid)
{
new
near = GetClosestPlayerToPlayer(playerid),
Float:NearPos[3],
Float:x,Float:y,Float:z,
string[128];
if(pInfo[playerid][Team] != pInfo[near][Team]) /* If their teams dont match, aka not same team*/
{
GetPlayerPos(near,NearPos[0],NearPos[1],NearPos[2]); /* Getting that player position that we are going to shoot */
if(IsPlayerInRangeOfPoint(playerid,200,x,y,z)) /* Checking if playerid is in of Near */
{
GetPlayerPos(playerid,x,y,z); /* Getting player positions to create object that we are going to move*/
AAC = CreateObject(18647,x,y,z,0,0,0,0); /* Creating the object */
SetObjectToFaceCords(AAC, NearPos[0],NearPos[1],NearPos[2]); /* Setting the object to face other player*/
MoveObject(AAC,NearPos[0],NearPos[1],NearPos[2],100); /* moving the object */
format(string,sizeof(string),"Send a rocket towards %s",GetName(near));
}
}
return true;
}