26.12.2013, 11:49
The "SERVER: Unknown command." message?
strcmp is slow though, ZCMD or y_commands is recommended.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
// other commands..
if(!strcmp(cmdtext, "/cursa", true))
{
if(cursa[playerid] == 1)
{
new Str[400];
format(Str, sizeof(Str), "\n{FFFFFF}** {50AC40}Transporti: {815FDC}%s\n\n{FFFFFF}** {50AC40}Incarci marfa la {815FDC}%d\n\n{FFFFFF}** {50AC40}Descarci marfa la {815FDC}%d\n\n",
MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
ShowPlayerDialog(playerid, CURSA, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informatii cursa", Str, "Ok", "");
format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {50AC40}%s {B1BBBE}a folosit {FFFFFF}'{815FDC}/cursa{FFFFFF}'.", sendername);
SAM(c_alb, string);
}
else SCM(playerid, c_alb, "{FFFFFF}[{815FDC}System{FFFFFF}] {50AC40}Nu ai inceput vreo cursa{FFFFFF}.");
return 1;
}
// other commands..
return 0;
}