help again please
#1

Hey guys. I made a backup command yesterday but i didn't came out.

now I made another one that works. I did it with a mapicon. But I want this map Icon to follow you.
How to do this?
My script:
Код:
if(strcmp(cmd, "/backup", true)==0)
{
	if(sapd[playerid] >= 1)
	{
		for(new i; i<MAX_PLAYERS; i++)
		{
			new Float:X,Float:Y,Float:Z;
  			GetPlayerPos(i,X,Y,Z);
			SetPlayerMapIcon(i, 0, X, Y, Z, 30, 0 );
			

		}
	}
	else
	{
		SendClientMessage(playerid,COLOR_RED,"You are not part of the sapd");
	}
	return 1;
}
Reply
#2

Hmm, maybe I was yesterday wrong, but this has to work (I hope now)

pawn Код:
public OnPlayerConnect(playerid)
{
   for(new i; i<MAX_PLAYERS; i++);
   {
      // Make the players marker an invisible white (chat will be white but marker will be gone).
      SetPlayerMarkerForPlayer(i, playerid, 0xFFFFFF00 );
   }
   return 1;
}
Green text from WIKI^^

And the /backup:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   
   if(!strcmp("/backup", cmdtext, true, 10))
   {
      for(new i; i<MAX_PLAYERS; i++)
      {
         SetPlayerMarkerForPlayer(playerid, i, 0xFF0000); // some color..
      }
      return 1;
   }
   return 0;
}
I hope this will work

Oh and a mapicon, you can maybe move it, but then you need to update the position, so hide, show, hide, show, everytime with another position
Reply
#3

Quote:
Originally Posted by CAR
Посмотреть сообщение
Oh and a mapicon, you can maybe move it, but then you need to update the position, so hide, show, hide, show, everytime with another position
That is correct. You can make these update calls via a timer or using OnPlayerUpdate with position checks. If you only want to track a player if they are in a vehicle, you could also use SetVehicleParamsForPlayer and change the objective however you cannot change what the minimap icon would look like.
Reply
#4

Can one of you make that command good for me with the timer at onplayerupdate or something xD? I don't really understand how to do it. I tried with a timer but failed/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)