Dialog Problem
#1

All work fine with the dialogs. I add the /rules, "Accept" and "Leave" because I rewrite the gamemode to ZCMD. And I got a problem. When I accept rules, it says You have accepted our rules, and after that SERVER: Unknown command.
The dialog of rules.
pawn Код:
if(dialogid == 2) {
        if(response) {
            SendClientMessage(playerid,0x0096FFFF,"You accepted our rules!");
        }
        else if(response == 0) {
            SendClientMessage(playerid,COLOR_RED,"Therefore leave!");
            Kick(playerid);
        }
    }
    return 1;
}
I had only the /tgoto (disable goto)
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1) {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
        return 1;
    }
    return 1;
}
And when I add the dialog from the rules
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1) {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
        return 1;
    }
    if(dialogid == 2) {
        if(response) {
            SendClientMessage(playerid,0x0096FFFF,"You accepted our rules!");
        }
        else if(response == 0) {
            SendClientMessage(playerid,COLOR_RED,"Therefore leave!");
            Kick(playerid);
        }
    }
    return 1;
}
And I cannot return 1; there. What to do
Reply
#2

I had troubles with zcmd too... Are u sure u implented the two new callbacks that ces wity zcmd in ur script?
Reply
#3

ZCMD commands must at the end have

pawn Код:
return 1;
if they dont have that they will send SERVER: Unknown command

if you dont now how to fix it, pls give me cmd after whos is that message
Reply
#4

Quote:
Originally Posted by knackworst
Посмотреть сообщение
I had troubles with zcmd too... Are u sure u implented the two new callbacks that ces wity zcmd in ur script?
What do you mean, I didn't understand it.

Quote:
Originally Posted by Speed
Посмотреть сообщение
ZCMD commands must at the end have

pawn Код:
return 1;
if they dont have that they will send SERVER: Unknown command

if you dont now how to fix it, pls give me cmd after whos is that message
Well, I will post before and after /rules.
Before:
pawn Код:
CMD:tgoto(playerid, params[])
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Toggle Goto", "{00FF00}Enable\n{FF0000}Disable", "Select", "Cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1) {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
        return 1;
    }
    return 1;
}
After:
pawn Код:
CMD:tgoto(playerid, params[])
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "{FFFFFF}Toggle Goto", "{00FF00}Enable\n{FF0000}Disable", "Select", "Cancel");
    return 1;
}
CMD:rules(playerid, params[])
{
    ShowPlayerDialog(playerid,2 ,DIALOG_STYLE_MSGBOX,"{00FFFF}Rules","* Do not hack/cheat\n* Do not use Mods that will give you an advantage over other players\n* Do not be offensive to other players and admins\n* Do not use offensive or racist usernames\n* Do not spawnkill at the spawnpoints\n* Do not PM admins with requests for extra features, instead post it on the forum in Suggestions\n* Do not ask for Admin Status","Accept","Don't accept");
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1) {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
        return 1;
    }
    if(dialogid == 2) {
        if(response) {
            SendClientMessage(playerid,0x0096FFFF,"You accepted our rules!");
        }
        else if(response == 0) {
            SendClientMessage(playerid,COLOR_RED,"Therefore leave!");
            Kick(playerid);
        }
    }
    return 1;
}
Because I cannot return 1; on the end on the OnDialogResponse, it appears SERVER: Uknown comman
Reply
#5

pawn Код:
CMD:rules(playerid, params[])
{
    ShowPlayerDialog(playerid,2 ,DIALOG_STYLE_MSGBOX,"{00FFFF}Rules","* Do not hack/cheat\n* Do not use Mods that will give you an advantage over other players\n* Do not be offensive to other players and admins\n* Do not use offensive or racist usernames\n* Do not spawnkill at the spawnpoints\n* Do not PM admins with requests for extra features, instead post it on the forum in Suggestions\n* Do not ask for Admin Status","Accept","Don't accept");
    return true;
}
Reply
#6

And If I want to add more Dialogs I cannot under id 2
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1) {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
        return 1;
    }
    if(dialogid == 2) {
        if(response) {
            SendClientMessage(playerid,0x0096FFFF,"You accepted our rules!");
        }
        else if(response == 0) {
            SendClientMessage(playerid,COLOR_RED,"Therefore leave!");
            Kick(playerid);
        }
    }
    return 1;
}
//I can't more and at the end to return 1;
    return 1;
}
To let the dialogid 2 at the end and add all the others before it?
In every dialog isn't it return 1?
Reply
#7

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            if(listitem == 0)
            {
                AllowGoto[playerid] = 1;
                SendClientMessage(playerid, COLOR_ORANGE, "You have allowed other players teleporting to you!");
            }
            if(listitem == 1)
            {
                AllowGoto[playerid] = 0;
                SendClientMessage(playerid, COLOR_ORANGE, "You have disallowed other players teleporting to you!");
            }
        }
    }
    if(dialogid == 2)
    {
        if(response)
        {
            SendClientMessage(playerid,0x0096FFFF,"You accepted our rules!");
        }
        else if(response == 0)
        {
            SendClientMessage(playerid,COLOR_RED,"Therefore leave!");
            Kick(playerid);
        }
    }
    if(dialogid == /* Anoter Dialog */)
    {
        // Do your code
    }
    // More dialogs
    return 1;
}
Reply
#8

Thank you SmiT
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)