/admins - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /admins (
/showthread.php?tid=141485)
/admins -
laser50 - 13.04.2010
Could someone make me a small /admins command??
I mean, not from GM's, i need something i can put into my new.pwn.
Re: /admins -
crone - 13.04.2010
Код:
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;
}
Re: /admins -
laser50 - 13.04.2010
thx
Re: /admins -
laser50 - 13.04.2010
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!");
}
Re: /admins -
Fj0rtizFredde - 13.04.2010
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)
Re: /admins -
laser50 - 13.04.2010
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?
Re: /admins -
Naxix - 13.04.2010
Hide the on duty and show the off duty?
Re: /admins -
laser50 - 13.04.2010
but, how does the system knows when hes off duty then?
Re: /admins -
Desert - 13.04.2010
Make a duty variable?
Re: /admins -
Naxix - 13.04.2010
Or just make a command /onduty and a /offduty and than make 2 textdraws?