Dialog help
#1

I've got a dialog but when i typee the command it does not show up, can anyone help me please
Код:
ACMD:cmds(playerid, params[])
{
	new str[300], str1[1000];
	if (pInfo[playerid][Adminlevel] < 0) return 0;
	format(str, sizeof(str), "PLAYER COMMANDS");
	strcat(str1, str);
	format(str, sizeof(str), "/player - check a player\n");
	strcat(str1, str);
	if (pInfo[playerid][Adminlevel] < 2) return 0;
	{
		format(str, sizeof(str), "MOD COMMANDS");
		strcat(str1, str);
		format(str, sizeof(str), "/a - Admin Chat\n");
		strcat(str1, str);
		format(str, sizeof(str), "/spec - Spectate a player\n");
		strcat(str1, str);
	}
	if (pInfo[playerid][Adminlevel] < 3) return 0;
	{
		format(str, sizeof(str), "ADMIN COMMANDS");
		strcat(str1, str);
		format(str, sizeof(str), "/wank - test");
		strcat(str1, str);
		format(str, sizeof(str), "/hello - hello world");
		strcat(str1, str);
	}
	if (pInfo[playerid][Adminlevel] < 4) return 0;
	{
		format(str, sizeof(str), "LEAD ADMIN COMMANDS");
		strcat(str1, str);
		format(str, sizeof(str), "/ok - ok msg");
		strcat(str1, str);
		format(str, sizeof(str), "/no - say no to world");
		strcat(str1, str);
	}
	if (pInfo[playerid][Adminlevel] < 5) return 0;
	{
		format(str, sizeof(str), "OWNER COMMANDS");
		strcat(str1, str);
		format(str, sizeof(str), "/what - what the fuck");
		strcat(str1, str);
		format(str, sizeof(str), "/die - kill a nigga\n");
		strcat(str1, str);
	}
	ShowPlayerDialog(playerid, DIALOG_CMD, DIALOG_STYLE_MSGBOX, "Commands", str1, "Close", "");
	return 1;
}
It just pops up with unknown command (These commands are just test commands, not real ones)
Reply
#2

Try like this:
pawn Код:
ACMD:cmds(playerid, params[])
{
    new str[300], str1[1000];
    if (pInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid, -1, "You are not Admin.");
    format(str, sizeof(str), "PLAYER COMMANDS");
    strcat(str1, str);
    format(str, sizeof(str), "/player - check a player\n");
    strcat(str1, str);
    if (pInfo[playerid][Adminlevel] >= 1)
    {
        format(str, sizeof(str), "MOD COMMANDS");
        strcat(str1, str);
        format(str, sizeof(str), "/a - Admin Chat\n");
        strcat(str1, str);
        format(str, sizeof(str), "/spec - Spectate a player\n");
        strcat(str1, str);
    }
    if (pInfo[playerid][Adminlevel] >= 2)
    {
        format(str, sizeof(str), "ADMIN COMMANDS");
        strcat(str1, str);
        format(str, sizeof(str), "/wank - test");
        strcat(str1, str);
        format(str, sizeof(str), "/hello - hello world");
        strcat(str1, str);
    }
    if (pInfo[playerid][Adminlevel] >= 3)
    {
        format(str, sizeof(str), "LEAD ADMIN COMMANDS");
        strcat(str1, str);
        format(str, sizeof(str), "/ok - ok msg");
        strcat(str1, str);
        format(str, sizeof(str), "/no - say no to world");
        strcat(str1, str);
    }
    if (pInfo[playerid][Adminlevel] >= 4)
    {
        format(str, sizeof(str), "OWNER COMMANDS");
        strcat(str1, str);
        format(str, sizeof(str), "/what - what the fuck");
        strcat(str1, str);
        format(str, sizeof(str), "/die - kill a nigga\n");
        strcat(str1, str);
    }
    ShowPlayerDialog(playerid, DIALOG_CMD, DIALOG_STYLE_MSGBOX, "Commands", str1, "Close", "");
    return 1;
}
PS: You don't need to format "str" as you are not using any variable on it.
Using:
pawn Код:
strcat(str1, "Line here");
would work just fine.
Reply
#3

Thank you EzeHermes, it now working, thanks once again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)