duty command
#1

i have this Without error but not works in zadmin.can you help me?

Код:
dcmd_onduty(playerid,params[])
#pragma unused params
{
    if(GetPVarInt(playerid,"onduty")) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already on duty!");
    {
	    if(Account[playerid][pAdminlevel]< 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You do not have permission to use this command!");
	    {
		    if(Account[playerid][pAdminlevel]== 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need admin level 2 for use this command!");
			{
					if(Account[playerid][pAdminlevel]>= 2)
			    	{
			        oldcolor[ playerid ] = GetPlayerColor( playerid );
			  		oldskin[ playerid ] = GetPlayerSkin( playerid );
			  		ResetPlayerWeapons(playerid);
			  		SendClientMessage(playerid,COLOR_RED,"Your duty now on!");
					SetPVarInt(playerid,"onduty",true);
					SetPlayerSkin(playerid,217);
					SetPlayerColor(playerid,0xEC0EECFF);
					GivePlayerWeapon(playerid,38,9999);
					SetPlayerHealth(playerid,99999);
					}
			}
		}
	}
    return 1;
}

dcmd_offduty(playerid,params[])
#pragma unused params
{
    if(GetPVarInt(playerid,"offduty")) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already off duty!");
    {
	    if(Account[playerid][pAdminlevel]< 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You do not have permission to use this command!");
	    if(Account[playerid][pAdminlevel]== 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need admin level 2 for use this command!");
	    if(Account[playerid][pAdminlevel]>= 2)
	    	{
	        SetPlayerSkin(playerid,oldskin[playerid]);
	  		SetPlayerColor(playerid,oldcolor[playerid]);
	  		ResetPlayerWeapons(playerid);
	  		SendClientMessage(playerid,COLOR_RED,"Your duty now off!");
			SetPVarInt(playerid,"offduty",true);
			SetPlayerHealth(playerid,100);
			}
	}
    return 1;
}
Reply
#2

i change it to this:
Код:
CMD:onduty(playerid,params[])
{
    if(GetPVarInt(playerid,"onduty")) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already on duty!");
    {
	    if(Account[playerid][pAdminlevel]< CmdsOptions[onduty]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You do not have permission to use this command!");
		{
    		oldcolor[ playerid ] = GetPlayerColor( playerid );
  			oldskin[ playerid ] = GetPlayerSkin( playerid );
  			ResetPlayerWeapons(playerid);
  			SendClientMessage(playerid,COLOR_RED,"Your duty now on!");
			SetPVarInt(playerid,"onduty",true);
			SetPlayerSkin(playerid,217);
			SetPlayerColor(playerid,0xEC0EECFF);
			GivePlayerWeapon(playerid,38,9999);
			SetPlayerHealth(playerid,99999);
			DeletePVar(playerid,"offduty");
		}
	}
	return 1;
}

CMD:offduty(playerid,params[])
{
    if(GetPVarInt(playerid,"offduty")) return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already off duty!");
    {
	    if(Account[playerid][pAdminlevel]< CmdsOptions[offduty]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You do not have permission to use this command!");
   		{
	        SetPlayerSkin(playerid,oldskin[playerid]);
	  		SetPlayerColor(playerid,oldcolor[playerid]);
	  		ResetPlayerWeapons(playerid);
	  		SendClientMessage(playerid,COLOR_RED,"Your duty now off!");
			SetPVarInt(playerid,"offduty",true);
			SetPlayerHealth(playerid,100);
		}
	}
    return 1;
}
but now one problem!!i want if player on duty and type in chat = [Admin] name: id text.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)