SA-MP Forums Archive
/backup, wont show red circel - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /backup, wont show red circel (/showthread.php?tid=78528)



/backup, wont show red circel - BraveBarry - 20.05.2009

Hello, i have a problem with my /backup command
the text works as it should do, but the red circel won't work for me.
Код:
  if(strcmp(cmd, "/backup", true) == 0)
    {
    new string[128];
    new player[MAX_PLAYER_NAME];
    if(gTeam[playerid] == TEAM_PD)
    if(GetPlayerRank(playerid) >=2)
 			{
 			new Float:X,Float:Y,Float:Z;
 			GetPlayerName(playerid, player, sizeof(player));
 			GetPlayerPos(playerid, X,Y,Z);
			SendClientMessage(playerid, TEAM_PD_COLOR, "You called for backup, continue pursuit");
 			format(string, sizeof(string), "Officer %s called for backup, nearby units report in, for the pursuit.", player);
  		    Send911Message(COLOR_PDRADIO ,string);
 		    for(new i = 0; i < MAX_PLAYERS; i ++)
			{
  			if(IsPlayerConnected(i))
				{
	  			if(gTeam[i] == TEAM_PD)
					{
  					SetPlayerCheckpoint(playerid, X, Y, Z, 10.0);
					return 1;
      			    }
    			}
		  	}
		 	
 		}
	}
when im alone on the server it works, but when another player is online it won't work.
been searching on the forum, but can't find the answer to my problem.


Re: /backup, wont show red circel - Adrik - 25.07.2009

Lolz


Re: /backup, wont show red circel - Luciano - 25.07.2009

What you want is SetPlayerRaceCheckpoint with the type as 2, so it has nothing inside of it and its big enough to see across the world and on the minimap, then your code should work just fine. Good luck!


Re: /backup, wont show red circel - Josh! - 25.09.2009

Quote:

if(strcmp(cmd, "/backup", true) == 0)
{
new string[128];
new player[MAX_PLAYER_NAME];
if(gTeam[playerid] == TEAM_PD)
if(GetPlayerRank(playerid) >=2)
{
new Float:X,Float:Y,Float:Z;
GetPlayerName(playerid, player, sizeof(player));
GetPlayerPos(playerid, X,Y,Z);
SendClientMessage(playerid, TEAM_PD_COLOR, "You called for backup, continue pursuit");
format(string, sizeof(string), "Officer %s called for backup, nearby units report in, for the pursuit.", player);
Send911Message(COLOR_PDRADIO ,string);
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i] == TEAM_PD)
{
SetPlayerCheckpoint(i, X, Y, Z, 10.0);
return 1;
}
}
}

}
}




Re: /backup, wont show red circel - BMUK - 25.09.2009

Josh why did you take the [ i ] away from gTeam? Would that even compile?


Barry: The problem was this > SetPlayerCheckpoint(i, X, Y, Z, 10.0);

You had playerid instead of i. Then it would only show for the player that typed /backup