Admin Commands - 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: Admin Commands (
/showthread.php?tid=562744)
Admin Commands -
FinStar - 11.02.2015
Hello friends, I have a little problem and I do not know what to do.
Errors:
pawn Код:
Commands.pwn (47): error 029: invalid expression, assumed zero
Commands.pwn (47): warning 215: expression has no effect
Commands.pwn (47): error 001: The expected token: ";", but found "]"
Commands.pwn (47): error 029: invalid expression, assumed zero
Commands.pwn (47): fatal error 107: too many error messages on one line
Line:
Re: Admin Commands -
HazardouS - 11.02.2015
As far as I know, PAWN doesn't support pointers by default. Also, you're missing a closing bracket after "(playerid)", so it should be GetAdminRankName(GetPlayerAdminLevel(playerid)).
Re: Admin Commands -
doreto - 11.02.2015
PHP код:
format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i); // how it should be
Re: Admin Commands -
FinStar - 11.02.2015
And how to fix that showed the dialog admins online?
Re: Admin Commands -
FinStar - 11.02.2015
It works, but I want to show only the administrators. how to do?
do not want players to appear in / admins
How do unless admin to hide in / admins
Re: Admin Commands -
ATGOggy - 11.02.2015
What variable do you use for admin levels?
Re: Admin Commands -
FinStar - 11.02.2015
pawn Код:
CheckAdminLevel(playerid)
{
for(new i; i < admin_Total; i++)
{
if(!strcmp(gPlayerName[playerid], admin_Data[i][admin_Name]))
{
admin_Level[playerid] = admin_Data[i][admin_Rank];
break;
}
}
}
or
pawn Код:
stock GetPlayerAdminLevel(playerid)
{
if(!IsPlayerConnected(playerid))
return 0;
return admin_Level[playerid];
}
Re: Admin Commands -
FinStar - 11.02.2015
Bump..
Re: Admin Commands -
ReD_HunTeR - 11.02.2015
pawn Код:
CMD:admins(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(admin_level[playerid] >= 1)
{
new string[128];
format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i);
Dialog_Show(playerid, DIALOG_STYLE_MSGBOX, "lol", string, "Closed", "");
}
}
}
return 1;
}
Re: Admin Commands -
FinStar - 11.02.2015
Quote:
Originally Posted by ReD_HunTeR
pawn Код:
CMD:admins(playerid, params[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(admin_level[playerid] >= 1) { new string[128]; format(string,sizeof(string), "lol: %s lol: %P\n",GetAdminRankName(GetPlayerAdminLevel(playerid)),i); Dialog_Show(playerid, DIALOG_STYLE_MSGBOX, "lol", string, "Closed", ""); } } } return 1; }
|
Really thanks
+ REP