How can i do this
#1

How could i make it so if the player has not /setadminskin and the player does /adminduty it says " You have not entered a admin skin, to do so /setadminskin "


pawn Код:
CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(PlayerData[ID][AdminDuty] == 0)
        {
            GetPlayerName(playerid, PlayerData[playerid][OriginalName], 24);
            SetPlayerName(playerid, PlayerData[playerid][AdminName]);
            PlayerData[playerid][OriginalSkin] = GetPlayerSkin(playerid);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now on admin duty");
            format(str2, sizeof(str2),"Admin %s Is now online",PlayerData[playerid][AdminName]);
            SetPlayerSkin(playerid, PlayerData[playerid][AdminSkin]);
            SetPlayerColor(playerid, COLOR_NAVY);
            SendClientMessageToAll(COLOR_GREEN,str2);
            PlayerData[playerid][AdminDuty] = 1;
        }
        else
        {
            if(PlayerData[ID][AdminDuty] == 1)
            {
                SetPlayerName(playerid, PlayerData[playerid][OriginalName]);
                SetPlayerSkin(playerid, PlayerData[playerid][OriginalSkin]);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now off admin duty");
                format(str2, sizeof(str2),"Admin %s Is now offline",PlayerData[playerid][AdminName]);
                SetPlayerColor(playerid, COLOR_WHITE);
                SendClientMessageToAll(COLOR_GREEN,str2);
                PlayerData[playerid][AdminDuty] = 0;
            }
        }
    }
    return 1;
}

Thank You


Please Help Me Please
Reply
#2

At the top of your script
pawn Код:
new adminSkinEnabled[MAX_PLAYERS];
Under /setadminskin
If the skin applies to the user
pawn Код:
adminSkinEnabled[playerid] = 1;
If the skin gets remoevd
pawn Код:
adminSkinEnabled[playerid] = 0;
Under /adminduty
pawn Код:
if(PlayerData[ID][AdminDuty] == 0)
        {
            if(adminSkinEnabled[playerid] == 0)
                return SendClientMessage(playerid, COLOR_RED, "You have not entered a admin skin, to do so /setadminskin");
Reply
#3

Quote:
Originally Posted by Pinguinn
Посмотреть сообщение
At the top of your script
pawn Код:
new adminSkinEnabled[MAX_PLAYERS];
Under /setadminskin
If the skin applies to the user
pawn Код:
adminSkinEnabled[playerid] = 1;
If the skin gets remoevd
pawn Код:
adminSkinEnabled[playerid] = 0;
Under /adminduty
pawn Код:
if(PlayerData[ID][AdminDuty] == 0)
        {
            if(adminSkinEnabled[playerid] == 0)
                return SendClientMessage(playerid, COLOR_RED, "You have not entered a admin skin, to do so /setadminskin");
My server still shuts down if i do /adminduty when the player has not choose skin or admin name


pawn Код:
new adminSkinEnabled[MAX_PLAYERS];
new adminNameCreated[MAX_PLAYER_NAME];

pawn Код:
CMD:setadminname(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        new string[128], newname[MAX_PLAYER_NAME];
        if(sscanf(params, "s", newname)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /setadminname <name>");
        format(string, sizeof(string), "You set your admin name to %s", newname);
        SendClientMessage(playerid, COLOR_ORANGE, string);
        PlayerData[playerid][AdminName] = newname;
        adminNameCreated[playerid] = 1;
    }
    return 1;
}

CMD:setadminskin(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        new string[128], newskin;
        if(sscanf(params, "i", newskin)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /setadminskin <skinid>");
        format(string, sizeof(string), "You set your admin skin to %d", newskin);
        SendClientMessage(playerid, COLOR_ORANGE, string);
        PlayerData[playerid][AdminSkin] = newskin;
        adminSkinEnabled[playerid] = 1;
    }
    return 1;
}

CMD:adminduty(playerid, params[])
{
    if(PlayerData[ID][AdminLevel] >= 1)
    {
        if(PlayerData[ID][AdminDuty] == 0)
        {
            GetPlayerName(playerid, PlayerData[playerid][OriginalName], 24);
            SetPlayerName(playerid, PlayerData[playerid][AdminName]);
            PlayerData[playerid][OriginalSkin] = GetPlayerSkin(playerid);
            if(adminSkinEnabled[playerid] == 0)
                return SendClientMessage(playerid, COLOR_RED, "You have not set your admin skin, /setadminskin");
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now on admin duty");
            format(str2, sizeof(str2),"Admin %s Is now online",PlayerData[playerid][AdminName]);
            SetPlayerSkin(playerid, PlayerData[playerid][AdminSkin]);
            SetPlayerColor(playerid, COLOR_NAVY);
            SendClientMessageToAll(COLOR_GREEN,str2);
            PlayerData[playerid][AdminDuty] = 1;
        }
        else
        {
            if(PlayerData[ID][AdminDuty] == 1)
            {
                SetPlayerName(playerid, PlayerData[playerid][OriginalName]);
                SetPlayerSkin(playerid, PlayerData[playerid][OriginalSkin]);
                if(adminNameCreated[playerid] == 0)
                    return SendClientMessage(playerid, COLOR_RED, "You have not set your admin name, /setadminname");
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "You are now off admin duty");
                format(str2, sizeof(str2),"Admin %s Is now offline",PlayerData[playerid][AdminName]);
                SetPlayerColor(playerid, COLOR_WHITE);
                SendClientMessageToAll(COLOR_GREEN,str2);
                PlayerData[playerid][AdminDuty] = 0;
            }
        }
    }
    return 1;
}

Thank You


Please Help Me Please
Reply
#4

Please Help Me Please
Reply
#5

Please Help Me Please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)