Really weird problem.
#1

Hi there -

trying to script a /admins command:

pawn Код:
dcmd_admins(playerid,params[])
{
    new adminstring[500],temps[64],tempname[24],dutystring[12];
    strins(adminstring,"Admin: Megan | Level: BOT | ON DUTY | ID: -1",0);

    for(new i=0; i<MAX_PLAYERS; i++)
  {
    if(aduty[i] == 0) format(dutystring,sizeof(dutystring),"Off duty");
    if(aduty[i] == 1) format(dutystring,sizeof(dutystring),"ON DUTY");
    if(PlayerInfo[i][Level] >= 2 && IsPlayerConnected(i))
    {
        GetPlayerName(i,tempname,sizeof(tempname));
        format(temps,sizeof(temps),"Admin: %s | Level: %d | %s | ID: %d",tempname,PlayerInfo[i][Level],dutystring,i);
        new leng = strlen(adminstring);
        strins(adminstring,temps,leng+1);
        }
  }
    return ShowPlayerDialog(playerid,4542,DIALOG_STYLE_LIST,"Admins online",adminstring,"Okay","Cancel");
}
Something must be wrong in here, If I only place ShowPlayerDialog it works, but if I place the whole command it returns "Unknown command"
Reply
#2

Doublepost, sorry.
Reply
#3

Someone?
Reply
#4

Put print just before that return ShowPlayerDialog(playerid,... and see if that print is shown in server log.

EDIT: I have a better idea. Put "\n" after each line because now you have it all in 1 line.

pawn Код:
format(temps,sizeof(temps),"Admin: %s | Level: %d | %s | ID: %d \n",tempname,PlayerInfo[i][Level],dutystring,i);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)