[Help] Admin duty command not working
#1

I need help on making the admin duty command i tried and it gives me errors. Other Simpler Commands go fine but this.

The Command Working Fine.
pawn Код:
dcmd_aweapons(playerid, params[])
{
        #pragma unused params
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
        SCM(playerid, COLOR_SKYBLUE, "* Admin Weapons.");
        GivePlayerWeapon(playerid, 9, 99999);
        GivePlayerWeapon(playerid, 16, 99999);
        GivePlayerWeapon(playerid, 22, 99999);
        GivePlayerWeapon(playerid, 26, 99999);
        GivePlayerWeapon(playerid, 28, 99999);
        GivePlayerWeapon(playerid, 31, 99999);
        GivePlayerWeapon(playerid, 26, 99999);
        GivePlayerWeapon(playerid, 34, 99999);
        GivePlayerWeapon(playerid, 38, 99999);
        GivePlayerWeapon(playerid, 18, 99999);
        return 1;
}
pawn Код:
dcmd_aduty(playerid, params[])
    new string[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid,500000);
        SetPlayerColor(playerid,COLOR_CYAN);
        PlayerInfo[playerid][pAdminDuty] = 1;
        adminlabel[playerid] = Create3DTextLabel("Admin on duty\n Do Not Attack!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(adminlabel[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
        Delete3DTextLabel(adminlabel[playerid]);
    }
    return 1;
    }

Other Information: I use dcmd for my commands. Please help
Reply
#2

What Errors?
Reply
#3

Try This
pawn Код:
dcmd_aduty(playerid, params[])
{
    #pragma unused params
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 0) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid,500000);
        SetPlayerColor(playerid,COLOR_CYAN);
        PlayerInfo[playerid][pAdminDuty] = 1;
        adminlabel[playerid] = Create3DTextLabel("Admin on duty\n Do Not Attack!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(adminlabel[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
        Delete3DTextLabel(adminlabel[playerid]);
    }
    return 1;
    }
}
Reply
#4

it says symbol is never used
Reply
#5

What symbol? We cannot help if you don't post the errors.
Reply
#6

Quote:
Originally Posted by Youssef214
Посмотреть сообщение
Try This
pawn Код:
dcmd_aduty(playerid, params[])
{
    #pragma unused params
    new string[128];
    if(PlayerInfo[playerid][pAdmin] < 0) return SendClientMessage(playerid,COLOR_GRAY,"You're not an admin!");
    if(PlayerInfo[playerid][pAdminDuty] == 0)
    {
        format(string,sizeof(string),"%s has just went on Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_GREEN,string);
        SetPlayerHealth(playerid,500000);
        SetPlayerColor(playerid,COLOR_CYAN);
        PlayerInfo[playerid][pAdminDuty] = 1;
        adminlabel[playerid] = Create3DTextLabel("Admin on duty\n Do Not Attack!", COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(adminlabel[playerid], playerid, 0.0, 0.0, 0.7);
    }
    else
    if(PlayerInfo[playerid][pAdminDuty] == 1)
    {
        format(string,sizeof(string),"%s has just went off Admin Duty",GetName(playerid));
        SendClientMessageToAll(COLOR_RED,string);
        PlayerInfo[playerid][pAdminDuty] = 0;
        ResetPlayerWeapons(playerid);
        SetPlayerColor(playerid,COLOR_WHITE);
        SetPlayerHealth(playerid,0);
        ForceClassSelection(playerid);
        Delete3DTextLabel(adminlabel[playerid]);
    }
    return 1;
    }
}
give me reasons please, it says symbol never used
Reply
#7

Did you even read my post..?
Reply
#8

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Did you even read my post..?
G:\Script 2\gamemodes\Dm.pwn(567) : warning 217: loose indentation
G:\Script 2\gamemodes\Dm.pwn(1169) : warning 203: symbol is never used: "dcmd_aduty"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#9

doesn't work still
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)