Help, Please?
#1

Код:
if (strcmp(cmd, "/staff", true) == 0)
{
  SendClientMessage(playerid, COLOR_GREY, "Admins Online:");
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pAdmin] > 0)
    {
      GetPlayerName(i, sendername, sizeof(sendername));
      format(string, 256, "%s - %s", sendername,PlayerInfo[i][pAdminDuty]);
      SendClientMessage(playerid, COLOR_WHITE, string);
    }
  return 1;
	}
}
I'm needing it to say example:

Spencer_Hunt [On Duty] if they're on duty,
and
Spencer_Hunt [Off Duty] if they're off duty.

Thanks!

- Eric

P.S:

If pAdminDuty is 0 they're off duty.
If pAdminDuty is 1 they're on duty.

Thanks!
Reply
#2

Bump; This is rather important.
Reply
#3

I don't completely understand what you want...

Does "Spencer_Hunt [On Duty]" or "Spencer_Hunt [Off Duty]" have to be their name?
Reply
#4

pawn Код:
if(strcmp("/onduty", cmdtext, true, 7) == 0)
{
 if(IsPlayerAdmin(playerid)){
 new name[MAX_PLAYER_NAME];
 GetPlayerName(playerid, name, sizeof(name));
 new string[56];
 format(string, sizeof(string), "%s is now on duty!", name);
 SendClientMessageToAll(Color, string);
 return 1;
}
Reply
#5

Код:
if(strcmp("/duty", cmdtext, true, 5) == 0)
{
if(!IsPlayerCop[playerid]) return SendClientMessage(playerid,0x0000ffaa,"You are not a COP"); //just an eg, check if a player is a cop or whatever
 new name[MAX_PLAYER_NAME];
 GetPlayerName(playerid, name, sizeof(name));
 new string[128]; new tmp[56], Index;
 tmp=strtok(cmdtext,Index);
 if(!strcmp(tmp,"on",true,2))
 {
 format(string, sizeof(string), "%s is now on duty!", name);
 }
 else if(!strcmp(tmp,"off",true,3))
 {
 format(string, sizeof(string), "%s is now off duty!", name);
 }
 SendClientMessageToAll(Color, string);
 return 1;
}
Reply
#6

i think he ment if ya write /staff,you can see whos on duty and whos not
Reply
#7

Aye, What Fog said;

I'm not needing an command to go on duty, i'm needing a command that shows online staff and who's on duty, and who's not.
Reply
#8

Oh yeah my bad

Код:
if (!strcmp(cmdtext, "/staff", true, 6))
{
	new sendername[128], string[128];
	SendClientMessage(playerid, COLOR_GREY, "Admins Online:");
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] > 0)
		{
			GetPlayerName(i, sendername, sizeof(sendername));
			if(PlayerInfo[i][pAdminDuty]==0)
			{
				format(string, sizeof(string), "%s is off duty.", sendername);
			}
			else if(PlayerInfo[i][pAdminDuty]==1)
			{
				format(string, sizeof(string), "%s is on duty.", sendername);
			}
			SendClientMessage(playerid, COLOR_WHITE, string);
		}
	}
	return 1;	
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)