Playermapicon showing up on /aduty
#1

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;
}
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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

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;
}
Reply
#6

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

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

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
Reply
#9

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.).
Reply
#10

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)