Need a little help. - 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)
+--- Thread: Need a little help. (
/showthread.php?tid=309632)
Need a little help. -
ricardo178 - 08.01.2012
Hello. Well, this might look stupid, but i came back on scripting, and i don't remember somethings. I need a little help making /admins cmd...
I am using PlayerInfo[playerid][AdminLevel] to define and check admin status.
ZCMD cmd processor. I really don't remember how to do it.
Thank you.
Re: Need a little help. -
§с†¶e®РµРe - 08.01.2012
EDITED - Sorry guys!
Re: Need a little help. -
Konstantinos - 08.01.2012
pawn Код:
#include <zcmd>
#include <foreach>
CMD:admins(playerid, params[])
{
new string[128], CountAdmins, Name[MAX_PLAYER_NAME];
foreach(Player, i) {
GetPlayerName(i, Name, sizeof(Name));
if(PlayerInfo[i][AdminLevel] >= 1) {
CountAdmins = 1;
}
}
if(CountAdmins == 1) {
SendClientMessage(playerid, COLOR, "Admins Online List");
foreach(Player, i) {
if(PlayerInfo[i][AdminLevel] >= 1) {
format(string, sizeof(string), "Admin: %s (ID: %d) - Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
SendClientMessage(playerid, COLOR, string);
}
}
}
if(CountAdmins == 0) SendClientMessage(playerid, COLOR, "There are no currently Admins online!");
CountAdmins = 0;
return 1;
}
Quote:
Originally Posted by §с†¶e®РµРe
|
The command was /admins, not /setadmin
Re : Need a little help. -
ricardo178 - 08.01.2012
Thank you very much. You helped me much.
Re: Need a little help. -
§с†¶e®РµРe - 08.01.2012
Quote:
Originally Posted by Dwane
pawn Код:
#include <zcmd> #include <foreach>
CMD:admins(playerid, params[]) { new string[128], CountAdmins, Name[MAX_PLAYER_NAME]; foreach(Player, i) { GetPlayerName(i, Name, sizeof(Name)); if(PlayerInfo[playerid][AdminLevel] >= 1) { CountAdmins = 1; } } if(CountAdmins == 1) { SendClientMessage(playerid, COLOR, "Admins Online List"); foreach(Player, i) { if(PlayerInfo[playerid][AdminLevel] >= 1) { format(string, sizeof(string), "Admin: %s (ID: %d) - Level: %d", Name, i, PlayerInfo[i][AdminLevel]); SendClientMessage(playerid, COLOR, string); } } } if(CountAdmins == 0) SendClientMessage(playerid, COLOR, "There are no currently Admins online!"); CountAdmins = 0; return 1; }
The command was /admins, not /setadmin
|
:O
Sorry i misread.
I am really sorry for the mistake
Re: Need a little help. -
Konstantinos - 08.01.2012
No problem ricardo178!
Don't worry §с†¶e®РµРe, mistakes happen everyday.