/admins
#1

Could someone make me a small /admins command??
I mean, not from GM's, i need something i can put into my new.pwn.
Reply
#2

Код:
if(!strcmp(cmdtext, "/admins", true))
	{
	  SendClientMessage(playerid, AAD_COLOR_RED, "* Admins ONLINE");
		new count=0;
		for(new i=0; i<MAX_PLAYERS; i++)
		{
	  	if(IsPlayerConnected(i))
	  	{
          if(IsPlayerAdmin(i))
					{
						new str[255];
						new pname[24];
						GetPlayerName(i, pname, 24);
						format(str, 255, "Admin %s", pname);
						SendClientMessage(playerid, AAD_COLOR_RED, str);
						count++;
					}
				}
			}
		if(count == 0)
		{
	  	SendClientMessage(playerid, AAD_COLOR_RED, "* Admins not online!");
		}
		return 1;
	}
Reply
#3

thx
Reply
#4

Also, how do i make a function like, SendTeamMessage??
or, would this work?

if(GetPlayerTeam(playerid) == TEAM_COP)
{
SendClientMessage(playerid, COLOR_BLUE, "A officer has gone on duty!");
}
Reply
#5

Quote:
Originally Posted by laser50
Also, how do i make a function like, SendTeamMessage??
or, would this work?

if(GetPlayerTeam(playerid) == TEAM_COP)
{
SendClientMessage(playerid, COLOR_BLUE, "A officer has gone on duty!");
}
You have to create a loop :P
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
 if(GetPlayerTeam(i) == TEAM_COP)
 {
 SendClientMessage(i, COLOR_BLUE, "A officer has gone on duty!");
 }
}
(I think)
Reply
#6

thanks, Also..

I have a /duty command, and if you do that command, their should be a small textdraw witch will keep standing there, "You are now On Duty" or "You are now Off Duty!"
How do i make it, that if he does /duty again, the off duty message comes up?
Reply
#7

Hide the on duty and show the off duty?
Reply
#8

but, how does the system knows when hes off duty then?
Reply
#9

Make a duty variable?
Reply
#10

Or just make a command /onduty and a /offduty and than make 2 textdraws?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)