Icon moves with player - Help
#1

I just made that when an Admin types /track <id> the player`s name that he is tracking turns to red, but I want to make that on the Mini Map an Icon gets placed, which moves with the player, help?
Reply
#2

https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint
Reply
#3

that doesnt move with the player
Reply
#4

use SetPlayerMarkerForPlayer
Reply
#5

Quote:
Originally Posted by nickbugun
that doesnt move with the player
If you update it with a timer, it is.

either use what ZutDen said..
Reply
#6

I can`t do it.. I made /track <playerid>, and it tracks that player (tracked player) and cant make the timer:

Код:
	if(strcmp("/track",cmdtext, true, 10) == 0)
	{
    if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 7);
    tmp = strtok(cmdtext, idx);
    new trackedplayer = ReturnUser(tmp);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]");
    if(!IsPlayerConnected(trackedplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		SetTimer("Trackertimer", 1000, 0);
		SetPlayerMarkerForPlayer(playerid, trackedplayer, COLOR_DARKRED);
 		new name2[MAX_PLAYER_NAME];
  	GetPlayerName(trackedplayer, name2, sizeof(trackedplayer));
		format(string, 256, "Tracking %s : %d",trackedplayer, GetPlayerState(trackedplayer));
		SendClientMessage(playerid,COLOR_RED,string);

		return 1;
	}
Код:
public TrackerTimer(playerid, trackedplayer) {
	new trackedplayer;
	SetPlayerCheckpoint(playerid, trackedplayer);
}
The public TrackerTimer thing gives me these errors:
(5930) : warning 219: local variable "trackedplayer" shadows a variable at a preceding level
(5931) : warning 202: number of arguments does not match definition
(5931) : warning 202: number of arguments does not match definition
(5931) : warning 202: number of arguments does not match definition
Reply
#7

Quote:
Originally Posted by nickbugun
I can`t do it.. I made /track <playerid>, and it tracks that player (tracked player) and cant make the timer:

Код:
	if(strcmp("/track",cmdtext, true, 10) == 0)
	{
    if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 7);
    tmp = strtok(cmdtext, idx);
    new trackedplayer = ReturnUser(tmp);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]");
    if(!IsPlayerConnected(trackedplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
		SetTimer("Trackertimer", 1000, 0);
		SetPlayerMarkerForPlayer(playerid, trackedplayer, COLOR_DARKRED);
 		new name2[MAX_PLAYER_NAME];
  	GetPlayerName(trackedplayer, name2, sizeof(trackedplayer));
		format(string, 256, "Tracking %s : %d",trackedplayer, GetPlayerState(trackedplayer));
		SendClientMessage(playerid,COLOR_RED,string);

		return 1;
	}
Код:
public TrackerTimer(playerid, trackedplayer) {
	new trackedplayer;
	SetPlayerCheckpoint(playerid, trackedplayer);
}
The public TrackerTimer thing gives me these errors:
(5930) : warning 219: local variable "trackedplayer" shadows a variable at a preceding level
(5931) : warning 202: number of arguments does not match definition
(5931) : warning 202: number of arguments does not match definition
(5931) : warning 202: number of arguments does not match definition
remove new trackedplayer;

and check the wiki https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint

use GetPlayerPos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)