How can I make admins available on map when they go on-duty with the color cyan?
#1

How can I make admins visible on map when they go on-duty with the color cyan?

Here is the CMD (aduty):

Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "** This is an admin only command!");
	if(PlayerInfo[playerid][pAdminDuty] == 0)
	{

		SendClientMessageEx(playerid, COLOR_YELLOW, "{FFFFFF} ** You are now on administrative duty! Remember to check /reports!");
		PlayerInfo[playerid][pAdminDuty] = 1;
		SetPlayerHealth(playerid, 100000);
		SetPlayerArmour(playerid, 100000);
		PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
		SetPlayerSkin(playerid, 217);
		PlayerInfo[playerid][pModel] = 217;
		
            if(PlayerInfo[playerid][pAdmin] == 1)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
		    }
			if(PlayerInfo[playerid][pAdmin] == 2)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
		    }
		    if(PlayerInfo[playerid][pAdmin] == 3)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
			}
		    if(PlayerInfo[playerid][pAdmin] == 4)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
			}
		    if(PlayerInfo[playerid][pAdmin] == 1337)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
			}
			if(PlayerInfo[playerid][pAdmin] == 1338)
		    {
            	SetPlayerColor(playerid,COLOR_CYAN);
			}
			if(PlayerInfo[playerid][pAdmin] == 99998)
		    {
                SetPlayerColor(playerid,COLOR_CYAN);
			}
			if(PlayerInfo[playerid][pAdmin] == 99999)
		    {
                SetPlayerColor(playerid,COLOR_CYAN);
			}
			new string[256];
			format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay* {FFFFFF}%s {32CD32}Its in admin service {00AFA8}to provide support. (/report for assistance)", GetPlayerNameEx(playerid));
			SendClientMessageToAllEx(COLOR_RED, string);
	}
	else
	{
            new string[256];
	        format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay*  {FFFFFF}%s {FF0000}Its no more in admin service {00AFA8}and now its in Role!", GetPlayerNameEx(playerid));
            SendClientMessageToAllEx(COLOR_RED, string);
			SetPlayerColor(playerid, TEAM_HIT_COLOR);
			SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 0);
			PlayerInfo[playerid][pAdminDuty] = 0;
	}
    return 1;
}
The CYAN color is COLOR_CYAN
Reply
#2

Someone?
Reply
#3

i dont understand you mean they are invisible on the radar or Visible ?
Reply
#4

Just to let you know, you can also remove all these 15-20 lines which are annoying and replace them with:
pawn Код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "** This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{

SendClientMessageEx(playerid, COLOR_YELLOW, "{FFFFFF} ** You are now on administrative duty! Remember to check /reports!");
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 217);
PlayerInfo[playerid][pModel] = 217;

if (PlayerInfo[playerid][pAdmin] >= 1)
{
    SetPlayerColor(playerid,COLOR_CYAN);
}
new string[256];
format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay* {FFFFFF}%s {32CD32}Is in admin service {00AFA8}to provide support. (/report for assistance)", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_RED, string);
}
else
{
new string[256];
format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay* {FFFFFF}%s {FF0000}Its no more in admin service {00AFA8}and now its in Role!", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_RED, string);
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
return 1;
}
I recommend you to re and re-read your grammar

What I did is.
Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
{
    SetPlayerColor(playerid,COLOR_CYAN);
}
Instead of if(Playerinfo[playerid][pAdmin] == 1)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
ETC.............................................
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Just to let you know, you can also remove all these 15-20 lines which are annoying and replace them with:
pawn Код:
CMD:aduty(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, -1, "** This is an admin only command!");
if(PlayerInfo[playerid][pAdminDuty] == 0)
{

SendClientMessageEx(playerid, COLOR_YELLOW, "{FFFFFF} ** You are now on administrative duty! Remember to check /reports!");
PlayerInfo[playerid][pAdminDuty] = 1;
SetPlayerHealth(playerid, 100000);
SetPlayerArmour(playerid, 100000);
PlayerInfo[playerid][pChar] = GetPlayerSkin(playerid);
SetPlayerSkin(playerid, 217);
PlayerInfo[playerid][pModel] = 217;

if (PlayerInfo[playerid][pAdmin] >= 1)
{
    SetPlayerColor(playerid,COLOR_CYAN);
}
new string[256];
format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay* {FFFFFF}%s {32CD32}Is in admin service {00AFA8}to provide support. (/report for assistance)", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_RED, string);
}
else
{
new string[256];
format(string, sizeof(string), ""OFICIAL_COLOR"*Voltage-Gaming-Roleplay* {FFFFFF}%s {FF0000}Its no more in admin service {00AFA8}and now its in Role!", GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_RED, string);
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 0);
PlayerInfo[playerid][pAdminDuty] = 0;
}
return 1;
}
I recommend you to re and re-read your grammar

What I did is.
Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
{
    SetPlayerColor(playerid,COLOR_CYAN);
}
Instead of if(Playerinfo[playerid][pAdmin] == 1)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
ETC.............................................
Didnt get you... ...
Reply
#6

Quote:
Originally Posted by Gogorakis
Посмотреть сообщение
Didnt get you... ...
What she did was replace All of your un-neccessary lines, which check if the player is an admin.
You had each line check each level, which is un-needed, since anyone's admin level whom is higher than 1 is considered an admin.
So she replaced:
if(/*check if player is admin level 1*/)

pawn Код:
if(Playerinfo[playerid][pAdmin] == 1)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
if(Playerinfo[playerid][pAdmin] == 2)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
....
//ETC
With a shorter Code, which is also more efficient:
pawn Код:
if(Playerinfo[playerid][pAdmin] >= 1) // DIFFERENCE LIES HERE! INSTEAD OF " Playerinfo == 1 --> Playerinfo == 2" etc, she put: playerinfo >=1
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
As for your main question, you will have to set the player's marker as visible, I believe it should work when you add this code in:

pawn Код:
new i;
for(i=0; i< MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if( i != playerid)
{
SetPlayerMarkerForPlayer(playerid, i, YOUR_COLOR);
}
}
}
Reply
#7

Quote:
Originally Posted by Elie1996
Посмотреть сообщение
What she did was replace All of your un-neccessary lines, which check if the player is an admin.
You had each line check each level, which is un-needed, since anyone's admin level whom is higher than 1 is considered an admin.
So she replaced:
if(/*check if player is admin level 1*/)

pawn Код:
if(Playerinfo[playerid][pAdmin] == 1)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
if(Playerinfo[playerid][pAdmin] == 2)
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
....
//ETC
With a shorter Code, which is also more efficient:
pawn Код:
if(Playerinfo[playerid][pAdmin] >= 1) // DIFFERENCE LIES HERE! INSTEAD OF " Playerinfo == 1 --> Playerinfo == 2" etc, she put: playerinfo >=1
{
 SetPlayerColor(playerid,COLOR_CYAN);
}
As for your main question, you will have to set the player's marker as visible, I believe it should work when you add this code in:
I dont mean to change player's color. I mean:

When an admin goes on duty , all players can found him on the radar (map) (Marked with the color cyan)
Reply
#8

Then do what SHE/HE said , that's the right code for what you want.
Reply
#9

Dude Its Impossible Cyan is An Invisible Color You Can't Do Anything Just Change The Color
Reply
#10

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

Check those examples, they pretty much do what you're asking for.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)