SA-MP Forums Archive
How to Disable this ? - 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: How to Disable this ? (/showthread.php?tid=520904)



How to Disable this ? - Tidzii - 20.06.2014

Hey Guys, i have a NPC on my server and i want to remove the Marker from Map, i want him to be invisible in map !!


Re: How to Disable this ? - Konstantinos - 20.06.2014

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


Re: How to Disable this ? - Jefff - 20.06.2014

or in SetPlayerColor set alpha to 00


Re: How to Disable this ? - Tidzii - 20.06.2014

i use this...
Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
  	{
    	new npcname[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
    	if(!strcmp(npcname, "Tram_Driver", true)) //Checking if the NPC's name is MyFirstNPC
    	{
      	PutPlayerInVehicle(playerid, SFTramVehicle, 0); //Putting the NPC into the vehicle we created for it.
    	}
  	}
where i gonna put the SetPlayerColor to invisible ?


Re: How to Disable this ? - Jefff - 20.06.2014

Before PutPlayerInVehicle


Re: How to Disable this ? - Tidzii - 20.06.2014

Can you Put it so i can Copy / Paste it please ?


Re : How to Disable this ? - Clad - 20.06.2014

Quote:

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Tram_Driver", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
PutPlayerInVehicle(playerid, SFTramVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
}

....


Re: How to Disable this ? - Konstantinos - 20.06.2014

That was just an example of the wiki so it's supposed you had to use a loop for all the players but Jefff's idea is better. Just set the alpha of the color:
pawn Код:
SetPlayerColor(playerid, 0x00000000);



Re: Re : How to Disable this ? - Tidzii - 20.06.2014

@Clad if i want to put Invisible for all Players on my RolePlay server how to do it ?

Like that ?
Quote:

public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Tram_Driver", true)) //Checking if the NPC's name is MyFirstNPC
{
SetPlayerMarkerForPlayer( 42, 1, 0xFFFFFF00 );
PutPlayerInVehicle(playerid, SFTramVehicle, 0); //Putting the NPC into the vehicle we created for it.
}
}

because in wiki it say :

Quote:

// Make player 42 see player 1 as a red marker

but i don't want to none see Player 1 as a red marker


Re: How to Disable this ? - Vince - 20.06.2014

Oh, for crying out load! Just use a color, any color, with 00 at the end. Like several people already told you.