error on making checkpoint or player marker
#1

as the title say , i have CMD:Backup to give other police coordinat where our location.
and now im using this code but if my friend do /backup , i cant see the red marker on map telling where he is

Код:
CMD:backup(playerid, params[])
{
	if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2 || PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5)
	{
		if (Backup[playerid] != 1)
		{
			new
			zone[MAX_ZONE_NAME],
			string[40 + MAX_PLAYER_NAME];

			GetPlayer3DZone(playerid, zone, sizeof(zone));
			format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "%s is requesting immediate backup at %s.", GetPlayerNameEx(playerid), zone);
			Backup[playerid] = 1;
			foreach(Player, i)
			{
				if(gTeam[i] == 2 || IsACop(i))
				{
					SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
					SendClientMessageEx(i, TEAM_BLUE_COLOR, string);
				}
			}
			SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
			SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GREY, "  You already have an active backup request!");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not a LAPD / LASD!");
	}
	return 1;
}

CMD:nobackup(playerid, params[])
{
	BackupClear(playerid, 0);
	return 1;
}

CMD:fdbackup(playerid, params[])
{
	if(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)//model
	{
		if(Backup[playerid] != 1)
		{
			new string[128];
			format(string, sizeof(string), "* %s requests backup over their radio.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			format(string, sizeof(string), "HQ: %s is requesting immediate assistance, radio for additional details. %s's location has been transmitted to your GPS [See Pink Dot].", GetPlayerNameEx(playerid), GetPlayerNameEx(playerid));
			Backup[playerid] = 1;
			foreach(Player, i)
			{
				if(gTeam[i] == TEAM_CYAN||PlayerInfo[i][pMember]==4||PlayerInfo[i][pLeader]==4)//model
				{
				    new Float:X,Float:Y,Float:Z;
				    GetPlayerPos(playerid, X, Y, Z);
					SetPlayerCheckpoint(i, X, Y, Z, 5);
					SetPlayerMarkerForPlayer(i, playerid, TEAM_CYAN_COLOR);
					SendClientMessageEx(i, TEAM_CYAN_COLOR, string);
				}
			}
			SendClientMessageEx(playerid, COLOR_WHITE, "Type /nobackup to clear your backup request.");
			SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_GREY, "  You already have an active backup request!");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD2, "   You are not in the LAFD!");
	}
	return 1;
}
what should i do ? any miss or wrong on that code ?
Reply
#2

Make sure that in OnGameModeInit, you do not have set ShowPlayerMarkers to 0. Use 1 (global) or 2 (streamed).
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Make sure that in OnGameModeInit, you do not have set ShowPlayerMarkers to 0. Use 1 (global) or 2 (streamed).
hmm , what different of (global) and (streamed) ?

before i also try to put this
Код:
					new Float:X,Float:Y,Float:Z;
					GetPlayerPos(playerid, X, Y, Z);
					SetPlayerCheckpoint(i, X, Y, Z, 5);
That works but the checkpoint is not following the Police car just stay on last he do /backup
Reply
#4

ehm , i found this code under ongamemodeinit. its correct or wrong ?

Код:
	ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
Reply
#5

Global is for globally in the map (recommended). Streamed is if the players are streamed to the cop who asked for backup (about 300 meters range).

Yes, a checkpoint indeed works but it will stay at the place it was the first time, unless you re-set it (not recommended).

EDIT: Change it to global.
pawn Код:
ShowPlayerMarkers(1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)