SA-MP Forums Archive
Player Checkpoint - 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)
+--- Thread: Player Checkpoint (/showthread.php?tid=607594)



Player Checkpoint - CSLangdale - 21.05.2016

Код:
 
CMD:bk(playerid,params[])
{
	new string[128], Float:X, Float:Y, Float:Z;

	if(pInfo[playerid][Faction] == 1)
	{
		GetPlayerPos(playerid, X, Y, Z);
		format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid));
		PoliceBroadcast(COLOR_DARKBLUE,string,1);
		for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
		{
	        if(pInfo[i][Faction] == 1)
	        {
				SetPlayerCheckpoint(i, X, Y, Z, 3.0);
				BackupCP[playerid] = 1;
			}
		}
	}
	return 1;
}
Can anyone tell me how to change this so that the checkpoint moves with the player instead of being in one location and having to do /bk to update the location?


Re: Player Checkpoint - luke49 - 21.05.2016

https://sampwiki.blast.hk/wiki/SetPlayerMarkerForPlayer


Re: Player Checkpoint - MBilal - 21.05.2016

Quote:
Originally Posted by CSLangdale
Посмотреть сообщение
Код:
 
CMD:bk(playerid,params[])
{
	new string[128], Float:X, Float:Y, Float:Z;

	if(pInfo[playerid][Faction] == 1)
	{
		GetPlayerPos(playerid, X, Y, Z);
		format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid));
		PoliceBroadcast(COLOR_DARKBLUE,string,1);
		for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
		{
	        if(pInfo[i][Faction] == 1)
	        {
				SetPlayerCheckpoint(i, X, Y, Z, 3.0);
				BackupCP[playerid] = 1;
			}
		}
	}
	return 1;
}
Can anyone tell me how to change this so that the checkpoint moves with the player instead of being in one location and having to do /bk to update the location?



Код:
new TimerGps[MAX_PLAYERS];
CMD:bk(playerid,params[])
{
	new string[128], Float:X, Float:Y, Float:Z;

	if(pInfo[playerid][Faction] == 1)
	{
		GetPlayerPos(playerid, X, Y, Z);
		format(string, sizeof(string), "(Police Radio): %s is requesting backup at his position.", GetName(playerid));
		PoliceBroadcast(COLOR_DARKBLUE,string,1);
		for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
		{
	        if(pInfo[i][Faction] == 1)
	        {
				SetPlayerCheckpoint(i, X, Y, Z, 3.0);
                                TimerGps[i]=SetTimerEx("playerpostion", 1000, 1,"dd",i,playerid);
				BackupCP[playerid] = 1;
			}
		}
	}
	return 1;
} 

forward playerpostion(i,playerid);
public playerpostion(i,playerid)
{
 DisablePlayerCheckpoint(i);
 new Float:x, Float:y, Float:z;
 GetPlayerPos(playerid, x, y, z);
 SetPlayerCheckpoint(i, x,y,z, 3.0);
}

CMD:dbk(playerid,params[])
{
 DisablePlayerCheckpoint(playerid);
KillTimer(TimerGps[playerid]);
return 1;
}