Help /admins command unknown command -
alekschowee - 30.06.2016
Код:
if (strcmp("/admins", cmdtext, true, 10) == 0)
{
new admins[1024];
new ba=0;
new ta[MAX_PLAYER_NAME+70];
new an[MAX_PLAYER_NAME];
for(new i=-1;i<=GetPlayerPoolSize();i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin]!=0)
{
ba++;
GetPlayerName(i,an,sizeof(an));
format(ta,sizeof(ta),"{FFFFFF}Admin %s Level %d\n",an,PlayerInfo[i][pAdmin]);
strins(ta,admins,sizeof(admins));
}
}
}
if(ba==0)
{
SendClientMessage(playerid,-1,"{FF0000}No Admins Online!");
}
else
{
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Admins online", admins, "OK", "");
}
return 1;
}
Re: Help /admins command unknown command -
Konstantinos - 30.06.2016
Array indexes start at 0 and so player IDs. "i" needs to be 0 instead of -1.
And you keep calling GetPlayerPoolSize function, store it to a variable:
pawn Код:
for (new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
The length on strcmp would be 7 but you can remove it completely as well.
Re: Help /admins command unknown command -
CodeStyle175 - 30.06.2016
do you even know what the hell are you doing?
Re: Help /admins command unknown command -
alekschowee - 30.06.2016
Can all code
Sorry for my bad English
Re: Help /admins command unknown command -
Owen007 - 30.06.2016
if all above things didnt worked try removing
#include <zcmd> from your script
good luck
Re: Help /admins command unknown command -
alekschowee - 30.06.2016
http://prikachi.com/images.php?images/423/8818423O.jpg
Re: Help /admins command unknown command -
alekschowee - 30.06.2016
In my script
#include <a_samp>
#include <YSI\y_ini>
#include <sscanf>
Re: Help /admins command unknown command -
alekschowee - 30.06.2016
helpp
Re: Help /admins command unknown command -
jlalt - 30.06.2016
Mates you're confusing him, you're starting your loop from id -1 which will crash it and will say unknow command leme fix it for you sir
PHP код:
if (strcmp("/admins", cmdtext, true, 10) == 0)
{
new admins[1024];
new ba=0;
new ta[MAX_PLAYER_NAME+70];
new an[MAX_PLAYER_NAME];
for(new i = 0, j = GetPlayerPoolSize();i < j;i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin]!=0)
{
ba++;
GetPlayerName(i,an,sizeof(an));
format(ta,sizeof(ta),"{FFFFFF}Admin %s Level %d\n",an,PlayerInfo[i][pAdmin]);
strins(ta,admins,sizeof(admins));
}
}
}
if(ba==0)
{
SendClientMessage(playerid,-1,"{FF0000}No Admins Online!");
}
else
{
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Admins online", admins, "OK", "");
}
return 1;
}
Re: Help /admins command unknown command -
alekschowee - 30.06.2016
http://prikachi.com/images.php?images/489/8818489X.jpg