Admin Duty Command
#2

PHP код:
CMD: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_RED30.040.050.040.00);
        
Attach3DTextLabelToPlayer(adminlabel[playerid], playerid0.00.00.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;
    } 
You'll also need this
PHP код:
stock GetName(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    if(
IsPlayerConnected(playerid))
    {
        
GetPlayerName(playeridNamesizeof(Name));
    }
    else
    {
        
Name "Disconnected/Nothing";
    }
    return 
Name;

Its from my gamemode, if it helped rep+?
Reply


Messages In This Thread
Admin Duty Command - by State_Trooper - 29.10.2011, 03:16
Re: Admin Duty Command - by Azzeto - 29.10.2011, 03:20
Re: Admin Duty Command - by State_Trooper - 29.10.2011, 03:26
Re: Admin Duty Command - by Azzeto - 29.10.2011, 03:29
Re: Admin Duty Command - by State_Trooper - 29.10.2011, 03:31
Re: Admin Duty Command - by Azzeto - 29.10.2011, 03:33
Re: Admin Duty Command - by Danish7 - 06.03.2014, 03:14
Re: Admin Duty Command - by XK - 06.03.2014, 04:17

Forum Jump:


Users browsing this thread: 2 Guest(s)