SA-MP Forums Archive
help again please - 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: help again please (/showthread.php?tid=157318)



help again please - bartje01 - 06.07.2010

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;
}



Re: help again please - CAR - 06.07.2010

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


Re: help again please - Betamaster - 06.07.2010

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.


Re: help again please - bartje01 - 06.07.2010

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/