aduty color
#1

Hello, if i go to /aduty then i want my name go pink
Код:
CMD:aduty(playerid, params[])
{
	new string[128];
   	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 went on admin duty.", RPN(playerid));
		SendAdminMessage(COLOR_YELLOW, 1, string);
		aDuty[playerid] = 1;
	    format(string, sizeof(string), "%s", RPALN(playerid));
		if(IsValidDynamic3DTextLabel(aDutyText[playerid]))  DestroyDynamic3DTextLabel(aDutyText[playerid]);
     if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 5) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 6) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 7) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 8) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTRED, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
	}
	else
	{
   if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
		aDuty[playerid] = 0;
	    format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
	    SendAdminMessage(COLOR_YELLOW, 1, string);
		DestroyDynamic3DTextLabel(aDutyText[playerid]);
	}
	return 1;
}
here is code
Reply
#2

SetPlayerColor(playerid, color);
Reply
#3

SetPlayerColor(playerid, Pink);
Reply
#4

pawn Код:
CMD:aduty(playerid, params[])
{
    new string[128];
    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 went on admin duty.", RPN(playerid));
        SetPlayerColor(playerid,Pink);
        SendAdminMessage(COLOR_YELLOW, 1, string);
        aDuty[playerid] = 1;
        format(string, sizeof(string), "%s", RPALN(playerid));
        if(IsValidDynamic3DTextLabel(aDutyText[playerid]))  DestroyDynamic3DTextLabel(aDutyText[playerid]);
     if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 5) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 6) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 7) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 8) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTRED, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
    }
    else
    {
   if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
        aDuty[playerid] = 0;
        format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
        SendAdminMessage(COLOR_YELLOW, 1, string);
        DestroyDynamic3DTextLabel(aDutyText[playerid]);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Kinglee
Посмотреть сообщение
pawn Код:
CMD:aduty(playerid, params[])
{
    new string[128];
    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 went on admin duty.", RPN(playerid));
        SetPlayerColor(playerid,Pink);
        SendAdminMessage(COLOR_YELLOW, 1, string);
        aDuty[playerid] = 1;
        format(string, sizeof(string), "%s", RPALN(playerid));
        if(IsValidDynamic3DTextLabel(aDutyText[playerid]))  DestroyDynamic3DTextLabel(aDutyText[playerid]);
     if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 5) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 6) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
     if(PlayerInfo[playerid][pAdmin] == 7) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 8) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTRED, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
    }
    else
    {
   if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
        aDuty[playerid] = 0;
        format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
        SendAdminMessage(COLOR_YELLOW, 1, string);
        DestroyDynamic3DTextLabel(aDutyText[playerid]);
    }
    return 1;
}
After /aduty off color stay pink, but i want it change back to white
Reply
#6

pawn Код:
CMD:aduty(playerid, params[])
{
    new string[128];
    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 went on admin duty.", RPN(playerid));
        SetPlayerColor(playerid,Pink);
        SendAdminMessage(COLOR_YELLOW, 1, string);
        aDuty[playerid] = 1;
        format(string, sizeof(string), "%s", RPALN(playerid));
        if(IsValidDynamic3DTextLabel(aDutyText[playerid]))  DestroyDynamic3DTextLabel(aDutyText[playerid]);
        if(PlayerInfo[playerid][pAdmin] == 1) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTGREEN, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 2) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIME, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 3) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 4) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 5) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_RED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 6) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 7) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_DARKRED, 0, 0, -20, 25, playerid);
        if(PlayerInfo[playerid][pAdmin] == 8) aDutyText[playerid] = CreateDynamic3DTextLabel(string, COLOR_LIGHTRED, 0, 0, -20, 25, playerid);
        Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, aDutyText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
    }
    else
    {
    if(Spec[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You can't go off admin duty while spectating someone.");
    {
        aDuty[playerid] = 0;
        format(string, sizeof(string), "AdmWarn: %s has went off admin duty.", RPN(playerid));
        SendAdminMessage(COLOR_YELLOW, 1, string);
        SetPlayerColor(playerid,-1);
        DestroyDynamic3DTextLabel(aDutyText[playerid]);
    }
    return 1;
}
Sorry for late reply
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)