Can someone correct my script please ?
#3

pawn Код:
#include <a_samp>
#include <zcmd>

public OnPlayerCommandText(playerid, cmdtext[])
// if using ZCMD

CMD:commands(playerid, params[])
{
    // using 1 for dialogid might cause conflict, change it to the next available id.
    ShowPlayerDialog(playerid, /* dialogid */ 2, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
    return 1;
}

// In OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 2 /* or the dialogid you selected */)
    {
        if(response) {
            switch(listitem) {
                case 0: {
                    SendClientMessage(playerid, -2, "*Commands* \njoindevent\n joingevent\n joinsrevent\n joinmlevent\n joinshevent\n joinsgevent\n joindmevent\n joinpdevent\n joinuzievent\n joinkevent\n joincsevent", "Cancel");
                }
                case 1: {
                    if(IsPlayerAdmin(playerid)) {
                        SendClientMessage(playerid, -2, "*Admin Commands* \ndevent\n gevent\n srevent\n mlevent\n shevent\n sgevent\n dmevent\n pdeven\n uzievent\n kevent\n csevent\n startminievent\n eh", "Cancel");
                    }
                }
            }
        }
    }
    return 0;
}
You had this line:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
without brackets and caused the errors. About the invalid character constant, you had "\" character with invalid characters. Although, using /n in client messages makes no difference only on dialogs.
Reply


Messages In This Thread
Can someone correct my script please ? - by brandypol - 28.02.2014, 16:03
Re: Can someone correct my script please ? - by iPrivate - 28.02.2014, 16:06
Re: Can someone correct my script please ? - by Konstantinos - 28.02.2014, 16:07
Re: Can someone correct my script please ? - by UnknownGamer - 28.02.2014, 16:10
Re: Can someone correct my script please ? - by brandypol - 28.02.2014, 16:12
Re: Can someone correct my script please ? - by Konstantinos - 28.02.2014, 16:16
Re: Can someone correct my script please ? - by UnknownGamer - 28.02.2014, 16:21
Re: Can someone correct my script please ? - by brandypol - 28.02.2014, 16:22

Forum Jump:


Users browsing this thread: 1 Guest(s)