Really weird problem. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Really weird problem. (
/showthread.php?tid=116968)
Really weird problem. -
Striker_Moe - 30.12.2009
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"
Re: Really weird problem. -
Striker_Moe - 30.12.2009
Doublepost, sorry.
Re: Really weird problem. -
Striker_Moe - 30.12.2009
Someone?
Re: Really weird problem. -
MadeMan - 30.12.2009
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);