I am having troubles making an /admins command.
#7

Quote:
Originally Posted by skaTim
Посмотреть сообщение
Wrong!

Код:
if(strcmp(cmd,"/admins",true)==0){
  new admname[MAX_STRING];
  SendClientMessage(playerid, COLOR_GREEN, "..:: Admin List ::..");
     for(new i=0;i<MAX_PLAYERS;i++){
	 if((PlayerInfo[i][power]>0 && IsPlayerConnected(i)){ // power=pAdmin
	    if(PlayerTemp[i][OnDuty]){ 
	       format(admname,sizeof(admname),"Admin %s [Level: %d] [On Duty]",PlayerName(i),PlayerInfo[i][power]);
	       SendClientMessage(playerid, COLOR_GREEN, admname);
	    }
	    else{
		format(admname,sizeof(admname),"Admin %s [Level: %d] [Off Duty]",PlayerName(i),PlayerInfo[i][power]);
		SendClientMessage(playerid, COLOR_RED, admname);
	    }
            return 1;
	}
    }
    return 1;
}
You can add 'OnDuty' to PlayerInfo if youre not really sure what it is..
your code is messy :P
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)