SA-MP Forums Archive
Guys pls help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Guys pls help (/showthread.php?tid=313109)



Guys pls help - rohith - 24.01.2012

Guys i wanna create a /adminduty command for Dm server but i am unable to make that so i wish that anyone will send me the /adminduty script


Re: Guys pls help - Scrillex - 24.01.2012

Just download admin system and copy past it to your script.. Look how all commands are maked and make your own so it's easy way to learn


Re: Guys pls help - rohith - 24.01.2012

In which admin script can i find /adminduty ?


Re: Guys pls help - [HK]Ryder[AN] - 24.01.2012

you wantto make that if admin is on duty he can use admin commands and if he is not he can't?


Re: Guys pls help - mhamadsaleh - 24.01.2012

Here is one for LuxAdmin you can change it to yours and btw there is a problem with the 3DTextLabel that it dose not disabear

PHP код:
new Text3D:Label[MAX_PLAYERS];
dcmd_onduty(playerid,params[])
{
    
#pragma unused params
    
if (AccInfo[playerid][Level] >= 1)
    {
        if(
AccInfo[playerid][OnDuty] == 0)
        {
            new 
string[240];
            new 
AdminName[MAX_PLAYER_NAME];
            
GetPlayerName(playeridAdminNamesizeof(AdminName));
            
AccInfo[playerid][OnDuty] = 1;
             
SetPlayerHealth(playerid,100000);
            
GivePlayerWeapon(playerid,31,100000); GivePlayerWeapon(playerid,16,100000);
             
GivePlayerWeapon(playerid,34,100000); GivePlayerWeapon(playerid,29,100000);
            
GivePlayerWeapon(playerid,38,100000); GivePlayerWeapon(playerid,24,100000);
            
GivePlayerWeapon(playerid,26,100000); GivePlayerWeapon(playerid,4,1);
            
Attach3DTextLabelToPlayer(Label[playerid], playerid0.00.01.0 );
            
Label[playerid] = Create3DTextLabel("ADMIN ON DUTY[DONT ATTACK]"red30.040.050.040.00);
            
format(stringsizeof(string),"[ADMIN]: %s is now on Admin Duty"AdminName);
            
AccInfo[playerid][God] = 1;
             return 
SendClientMessageToAll(green,string);
        }
        else
        {
            new 
string[240];
            new 
AdminName[MAX_PLAYER_NAME];
            
GetPlayerName(playeridAdminNamesizeof(AdminName));
            
AccInfo[playerid][OnDuty] = 0;
            
ResetPlayerWeapons(playerid);
            
SetPlayerHealth(playerid,100);
            
SetPlayerArmour(playerid,0);
            
Delete3DTextLabel(Label[playerid]);
            
format(stringsizeof(string),"[ADMIN]: %s is now Off Admin Duty"AdminName);
             
AccInfo[playerid][God] = 0;
             return 
SendClientMessageToAll(orange,string);
        }
    }
    return 
SendClientMessage(playerid,orange,"Your level is not high enough");




Re: Guys pls help - lordturhan - 24.01.2012

pawn Код:
CMD:aduty(playerid,params[])
{
 new string[128];
 new Name[MAX_PLAYER_NAME];
 GetPlayerName(playerid, Name, sizeof(Name));
 if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You Need To Be Rcon Admin");
 SetPlayerHealth(playerid,99999);
 format(string, sizeof(string), "%s(%d) is on admin duty", Name, playerid);
 SendClientMessageToAll(-1,string);
 return 1;
}

pawn Код:
CMD:adutyoff(playerid,params[])
{
 new string[128];
 new Name[MAX_PLAYER_NAME];
 GetPlayerName(playerid, Name, sizeof(Name));
 if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You Need To Be Rcon Admin");
 SetPlayerHealth(playerid,100);
 format(string, sizeof(string), "%s(%d) is out of admin duty", Name, playerid);
 SendClientMessageToAll(-1,string);
 return 1;
}
You will need zcmd