SA-MP Forums Archive
Playermapicon showing up on /aduty - 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: Playermapicon showing up on /aduty (/showthread.php?tid=414083)



Playermapicon showing up on /aduty - AlexanderG - 08.02.2013

Hello, I am currently using a zgaming script which i am slowy almost redoing the whole script with a team, But i've found a problem which i can't seem to locate when you /aduty a player mapicon shows up and it's ID is 99 but we tried and i think almost removed the map icon and this is how it looks now

Код:
CMD:aduty(playerid, params[])
{
	new string[128], file[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid])
	{
        format(string, sizeof(string), "AdmWarn: %s has gone on admin duty.", RPN(playerid));
	      	SendAdminMessage(COLOR_GREEN, 1, string);
		      aDuty[playerid] = 1;
	       GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
	       format(string, sizeof(string), "%s", RPALN(playerid));
        SetPlayerArmour(playerid, 9999999);
       	SetPlayerHealth(playerid, 9999999);
       	SetPlayerColor(playerid,0xAA3333FF);

 }
	else
	{
	    if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
	    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		   aDuty[playerid] = 0;
	    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    format(string, sizeof(string), "AdmWarn: %s has gone off admin duty.", RPN(playerid));
	    SendAdminMessage(COLOR_DARKRED, 1, string);
    	SetPlayerArmour(playerid, 0);
    	SetPlayerHealth(playerid, 100);
		//Delete3DTextLabel(aDutyText[playerid]);
     SetPlayerColor(playerid, TRANSPARENT_WHITE);
	}
	return 1;
}



Re: Playermapicon showing up on /aduty - AlexanderG - 08.02.2013

I've been messing around with it but i never tested it yet but i added another line, Could someone tell me if i did it correctly or you can't actully do this since i added ''RemovePlayerMapIcon(i, 99);'' under the players color when they /aduty

Код:
CMD:aduty(playerid, params[])
{
	new string[128], file[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid])
	{
        format(string, sizeof(string), "AdmWarn: %s has gone on admin duty.", RPN(playerid));
	      	SendAdminMessage(COLOR_GREEN, 1, string);
		      aDuty[playerid] = 1;
	       GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
	       format(string, sizeof(string), "%s", RPALN(playerid));
        SetPlayerArmour(playerid, 9999999);
       	SetPlayerHealth(playerid, 9999999);
       	SetPlayerColor(playerid,0xAA3333FF);
       	RemovePlayerMapIcon(i, 99);

 }
	else
	{
	    if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
	    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		   aDuty[playerid] = 0;
	    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    format(string, sizeof(string), "AdmWarn: %s has gone off admin duty.", RPN(playerid));
	    SendAdminMessage(COLOR_DARKRED, 1, string);
    	SetPlayerArmour(playerid, 0);
    	SetPlayerHealth(playerid, 100);
		//Delete3DTextLabel(aDutyText[playerid]);
     SetPlayerColor(playerid, TRANSPARENT_WHITE);
	}
	return 1;
}



Re: Playermapicon showing up on /aduty - Djean - 08.02.2013

Quote:
Originally Posted by AlexanderG
Посмотреть сообщение
I've been messing around with it but i never tested it yet but i added another line, Could someone tell me if i did it correctly or you can't actully do this since i added ''RemovePlayerMapIcon(i, 99);'' under the players color when they /aduty

Код:
CMD:aduty(playerid, params[])
{
	new string[128], file[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid])
	{
        format(string, sizeof(string), "AdmWarn: %s has gone on admin duty.", RPN(playerid));
	      	SendAdminMessage(COLOR_GREEN, 1, string);
		      aDuty[playerid] = 1;
	       GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
	       format(string, sizeof(string), "%s", RPALN(playerid));
        SetPlayerArmour(playerid, 9999999);
       	SetPlayerHealth(playerid, 9999999);
       	SetPlayerColor(playerid,0xAA3333FF);
       	RemovePlayerMapIcon(i, 99);

 }
	else
	{
	    if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
	    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		   aDuty[playerid] = 0;
	    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    format(string, sizeof(string), "AdmWarn: %s has gone off admin duty.", RPN(playerid));
	    SendAdminMessage(COLOR_DARKRED, 1, string);
    	SetPlayerArmour(playerid, 0);
    	SetPlayerHealth(playerid, 100);
		//Delete3DTextLabel(aDutyText[playerid]);
     SetPlayerColor(playerid, TRANSPARENT_WHITE);
	}
	return 1;
}
This should work fine now.


Re: Playermapicon showing up on /aduty - AlexanderG - 08.02.2013

Quote:
Originally Posted by Djean
Посмотреть сообщение
This should work fine now.
i tried but the mapicon still shows.


Re: Playermapicon showing up on /aduty - AlexanderG - 11.02.2013

Anyone else that could help me, We are using a zgaming script but we are slowy redoing everything and we seem to not be able to find the reason to why a marker pops up when someone goes on aduty

We have tried this but it didn't work

Код:
CMD:aduty(playerid, params[])
{
	new string[128], file[32];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid])
	{
        format(string, sizeof(string), "AdmWarn: %s has gone on admin duty.", RPN(playerid));
	      	SendAdminMessage(COLOR_GREEN, 1, string);
		      aDuty[playerid] = 1;
	       GetPlayerIp(playerid, PlayerInfo[playerid][pIP], 16);
	       format(string, sizeof(string), "%s", RPALN(playerid));
        SetPlayerArmour(playerid, 9999999);
       	SetPlayerHealth(playerid, 9999999);
       	SetPlayerColor(playerid,0xAA3333FF);
       	RemovePlayerMapIcon(i, 99);

 }
	else
	{
	    if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
	    format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
		   aDuty[playerid] = 0;
	    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    format(string, sizeof(string), "AdmWarn: %s has gone off admin duty.", RPN(playerid));
	    SendAdminMessage(COLOR_DARKRED, 1, string);
    	SetPlayerArmour(playerid, 0);
    	SetPlayerHealth(playerid, 100);
		//Delete3DTextLabel(aDutyText[playerid]);
     SetPlayerColor(playerid, TRANSPARENT_WHITE);
	}
	return 1;
}



Re: Playermapicon showing up on /aduty - LeBoyce - 11.02.2013

You could use 0xAA333300 instead of 0xAA3333FF so the opacity is invisible.


Re: Playermapicon showing up on /aduty - MP2 - 12.02.2013

When you say map icon, are you talking about map icons (SetPlayerMapIcon - look on the wiki) or the player blips?


Re: Playermapicon showing up on /aduty - AlexanderG - 12.02.2013

Quote:
Originally Posted by MP2
Посмотреть сообщение
When you say map icon, are you talking about map icons (SetPlayerMapIcon - look on the wiki) or the player blips?
Player blips


Re: Playermapicon showing up on /aduty - MP2 - 12.02.2013

I have a function for this, but I'm in bed right now on my iPad. It will have to wait until tomorrow.

You have to do something special if you want their colour to stay the same (in chat, scoreboard, kill feed, name tag etc.).


Re: Playermapicon showing up on /aduty - Zex Tan - 12.02.2013

Alex, I found out the problem.

pawn Код:
public OnGameModeInit()
{
    CheckFiles();
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    EnableStuntBonusForAll(0);
    DisableInteriorEnterExits();
    ShowPlayerMarkers(1);
Try changing:
pawn Код:
ShowPlayerMarkers(1);
to
pawn Код:
ShowPlayerMarkers(0);