/admins(dialog) HELP! -
.Campionull. - 25.07.2012
(11325) : error 010: invalid function or declaration
Code:
dcmd_admins(playerid, params[])
{
#pragma unused params
new string[2048];
new sendername[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[playerid][Level] >= 3)
{
GetPlayerName(i , sendername, sizeof(sendername));
format(string, sizeof(string),"The following admin(s) are currently online:\n %s %s (ID:%d): [Level %i]\n", string,sendername, i,PInfo[playerid][Level]);
}
}
}
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...",string,"OK","Cancel");
}
else
{
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...","No administrators online","OK","Cancel");
}
}
return 1; << 11325
}
Re: /admins(dialog) HELP! -
Shockey HD - 25.07.2012
Code:
dcmd_admins(playerid, params[])
{
#pragma unused params
new string[2048];
new sendername[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[playerid][Level] >= 3)
{
GetPlayerName(i , sendername, sizeof(sendername));
format(string, sizeof(string),"The following admin(s) are currently online:\n %s %s (ID:%d): [Level %i]\n", string,sendername, i,PInfo[playerid][Level]);
}
}
}
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...",string,"OK","Cancel");
}
else
{
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...","No administrators online","OK","Cancel");
}
return 1
}
Re: /admins(dialog) HELP! -
Kindred - 25.07.2012
EDIT: To late... why!
You had one extra bracket above return 1;
Plus, properly indent your code, this looks like horse shit. And use [ pawn] and [ /pawn] tags.
pawn Code:
dcmd_admins(playerid, params[])
{
#pragma unused params
new string[2048];
new sendername[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[playerid][Level] >= 3)
{
GetPlayerName(i , sendername, sizeof(sendername));
format(string, sizeof(string),"The following admin(s) are currently online:\n %s %s (ID:%d): [Level %i]\n", string,sendername, i,PInfo[playerid][Level]);
}
}
}
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...",string,"OK","Cancel");
}
else
{
ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"Victim Online Admins List...","No administrators online","OK","Cancel");
}
return 1;
}
Re: /admins(dialog) HELP! -
.Campionull. - 25.07.2012
Thanks
Re: /admins(dialog) HELP! -
Kindred - 25.07.2012
Ohh, and btw, the way you are doing this would probably not work. If I am correct (could be wrong, tired) you are checking if YOU are admin, and then you are formatting YOUR own variable into the string.
And also, the way you are doing this would not show more than one admin (if correct), considering you are formatting the string over and over again, so it does not save the last string. You can use strcat to add onto a string, which is recommended.
Re: /admins(dialog) HELP! -
.Campionull. - 25.07.2012
:\ ShowPlayerDialog(playerid,3,DIALOG_STYLE_MSGBOX,"O nline Admins List...","No administrators online","OK","Cancel");
I cant see it the dialog its not showing
Re: /admins(dialog) HELP! -
Kindred - 25.07.2012
Obviously. You are checking if the player is connected, and if YOU aren't connected, it will show the dialog.
Re: /admins(dialog) HELP! -
.Campionull. - 25.07.2012
:\ can someone fix it