SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/02/2020, 02:17 PM   #1
D1am0nd
Big Clucker
 
Join Date: May 2014
Posts: 134
Reputation: 6
Default Help with dialog

Hello. So I'm having a problem with dialog response on missions for trucker class.

When I select first delivery, it kicks me from the server, saying "You've been kicked for typing wrong password!", even though that's the login part.

It happens only when I choose the first delivery.

Here's the code:

PHP Code:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 2)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 1;
                
SetPlayerCheckpoint(playerid,-69.7976,-1120.2092,1.07813.0);
                
SendClientMessage(playerid, -1"Deliver Sand to Glass Factory");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 2;
                
SetPlayerCheckpoint(playerid2433.3452,-2113.8091,13.5469,3.0);
                
SendClientMessage(playerid, -1"Deliver Rocks to the Smeltery");
            }
        }
    }
    if(
dialogid == 3)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 3;
                
SetPlayerCheckpoint(playerid,1923.8414,-1319.1575,16.43853.0);
                
SendClientMessage(playerid, -1"Deliver Planks to Los Santos Construction Site");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 4;
                
SetPlayerCheckpoint(playerid326.5647,869.9084,20.3990,3.0);
                
SendClientMessage(playerid, -1"Deliver Planks to San Fierro Construction Site");
            }
        }
    }
    if(
dialogid == 4)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 5;
                
SetPlayerCheckpoint(playerid,-1704.9644,14.6946,3.55473.0);
                
SendClientMessage(playerid, -1"Deliver Scrap Metal to San Fierro Import/Export Company");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 6;
                
SetPlayerCheckpoint(playerid, -2081.6560,230.5117,35.5137,3.0);
                
SendClientMessage(playerid, -1"Deliver Garbage to Las Venturas Quarry");
            }

        }
    }
    if(
dialogid == 5)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 7;
                
SetPlayerCheckpoint(playerid,2410.4470,-1425.5830,23.98253.0);
                
SendClientMessage(playerid, -1"Deliver Tools to Los Santos Wood Processing Facility");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 8;
                
SetPlayerCheckpoint(playerid326.5647,869.9084,20.3990,3.0);
                
SendClientMessage(playerid, -1"Deliver Tools to Las Venturas Quarry");
            }
            if(
listitem == 2)
            {
                
Ccp[playerid] = 9;
                
SetPlayerCheckpoint(playerid1923.8414,-1319.1575,16.4385,3.0);
                
SendClientMessage(playerid,-1"Deliver Tools to Los Santos Construction Site");
            }
            if(
listitem == 3)
            {
                
Ccp[playerid] = 10;
                
SetPlayerCheckpoint(playerid,-2081.6560,230.5117,35.5137,3.0);
                
SendClientMessage(playerid,-1"Deliver Tools to San Fierro Construction Site");
            }
        }
    }
    if(
dialogid == 6)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 11;
                
SetPlayerCheckpoint(playerid,2197.9055,-2656.3906,13.54693.0);
                
SendClientMessage(playerid, -1"Deliver Metal to Los Santos Workshop");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 12;
                
SetPlayerCheckpoint(playerid1923.8414,-1319.1575,16.4385,3.0);
                
SendClientMessage(playerid, -1"Deliver Metal to Los Santos Construction Site");
            }
            if(
listitem == 2)
            {
                
Ccp[playerid] = 13;
                
SetPlayerCheckpoint(playerid, -2081.6560,230.5117,35.5137,3.0);
                
SendClientMessage(playerid, -1"Deliver Metal to San Fierro Construction Site");
            }
        }
    }
    if(
dialogid == 7)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 14;
                
SetPlayerCheckpoint(playerid,2182.9985,-2259.2625,13.38853.0);
                
SendClientMessage(playerid, -1"Deliver Tools to Los Santos Storage Unit");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 15;
                
SetPlayerCheckpoint(playerid, -1851.9323,-190.6102,18.3750,3.0);
                
SendClientMessage(playerid, -1"Deliver Tools to San Fierro Storage Unit");
            }
        }
    }
    if(
dialogid == 8)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 16;
                
SetPlayerCheckpoint(playerid,2433.3452,-2113.8091,13.54693.0);
                
SendClientMessage(playerid, -1"Deliver Chemicals to Los Santos Smeltery");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 17;
                
SetPlayerCheckpoint(playerid2410.4470,-1425.5830,23.9825,3.0);
                
SendClientMessage(playerid, -1"Deliver Chemicals to Los Santos Wood Processing Facility");
            }
        }
    }
    if(
dialogid == 9)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 18;
                
SetPlayerCheckpoint(playerid,-2081.6560,230.5117,35.51373.0);
                
SendClientMessage(playerid, -1"Deliver Tools to San Fierro Construction Site");
            }
            if(
listitem == 1)
            {
                
Ccp[playerid] = 19;
                
SetPlayerCheckpoint(playerid1923.8414,-1319.1575,16.4385,3.0);
                
SendClientMessage(playerid, -1"Deliver Tools to Los Santos Construction Site");
            }
        }
    }
    if(
dialogid == 10)
    {
        if(
response)
        {
            if(
listitem == 0)
            {
                
Ccp[playerid] = 20;
                
SetPlayerCheckpoint(playerid,2104.2332,-2074.1304,13.55443.0);
                
SendClientMessage(playerid, -1"Deliver Waste Material to Los Santos Recycle Center");
            }
            return 
1;
        }
    }
    if (
dialogid == DIALOG_REGISTER)
    {
        if (!
response) return pkick(playerid);
        if(
response)
        {
            if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""COL_WHITE"Registering",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
            new 
INI:File INI_Open(UserPath(playerid));
            
INI_SetTag(File,"data");
            
INI_WriteInt(File,"Password",udb_hash(inputtext));
            
INI_WriteInt(File,"Cash",0);
            
INI_WriteInt(File,"Admin",0);
            
INI_WriteInt(File,"Kills",0);
            
INI_WriteInt(File,"Work",0);
            
INI_WriteInt(File,"Convoy",0);
            
INI_WriteInt(File,"Deaths",0);
            
INI_WriteInt(File,"Class",0);
            
INI_WriteInt(File,"License",0);
            
INI_Close(File);

            
SendClientMessage(playerid0xFF0000FF"Your account has been registered succesfully. Please go to the next step by chosing your class.");
        }
    }

    if (
dialogid == DIALOG_LOGIN)
    {
        if ( !
response ) return pkick(playerid);
        if( 
response )
        {
            if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
            {
                
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"You've been kicked for typing wrong password!");
                
pkick(playerid);
            }
            return 
1;
        }
    }
    return 
1;


EDIT: The problem doesn't appear when I remove the lines related to wrong password and kick,but then player can login back with any password
D1am0nd is offline   Reply With Quote
Old 17/02/2020, 02:20 PM   #2
Beckett
High-roller
 
Beckett's Avatar
 
Join Date: Feb 2012
Location: www.finalnights-rp.com
Posts: 1,786
Reputation: 104
Default Re: Help with dialog

This means the dialogid is conflicting with that of the login dialog. Redefine DIALOG_LOGIN into another ID. Right now its id 2.
__________________
Final Nights Roleplay
The first SA-MP server that is not regulated by administrators.
No OOC hierarchy. Strictly directed by players. Utopian vision.

El primer servidor SA-MP que no está regulado por los administradores.
Sin jerarquías OOC. Estrictamente dirigido por jugadores. Visión utópica.

Primul server de SA-MP care nu este regulat de administratori.
Fără ierarhie OOC. Strict dictat de jucători. Visiune utopică.

Yöneticiler tarafından düzenlenmeyen ilk SA-MP sunucusu.
OOC hiyerarşisi yok. Kesinlikle oyuncular tarafından yönetiliyor. Ütopik görme.


Become a Member of our Discord Channel
Beckett is offline   Reply With Quote
Old 17/02/2020, 02:32 PM   #3
D1am0nd
Big Clucker
 
Join Date: May 2014
Posts: 134
Reputation: 6
Default Re: Help with dialog

Quote:
Originally Posted by Beckett View Post
This means the dialogid is conflicting with that of the login dialog. Redefine DIALOG_LOGIN into another ID. Right now its id 2.
Oh silly me, didn't notice that one. Thanks for the help!
D1am0nd is offline   Reply With Quote
Old 18/02/2020, 04:09 AM   #4
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,046
Reputation: 115
Default Re: Help with dialog

Use enum to manage dialogids. You dont have to worry about them this way.
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS is offline   Reply With Quote
Old 23/02/2020, 05:24 PM   #5
Beckett
High-roller
 
Beckett's Avatar
 
Join Date: Feb 2012
Location: www.finalnights-rp.com
Posts: 1,786
Reputation: 104
Default Re: Help with dialog

Or you can use easydialog, my favorite include for the most efficient usage of dialogs. Personally I recommend it, and always used it in all of my gamemodes.
__________________
Final Nights Roleplay
The first SA-MP server that is not regulated by administrators.
No OOC hierarchy. Strictly directed by players. Utopian vision.

El primer servidor SA-MP que no está regulado por los administradores.
Sin jerarquías OOC. Estrictamente dirigido por jugadores. Visión utópica.

Primul server de SA-MP care nu este regulat de administratori.
Fără ierarhie OOC. Strict dictat de jucători. Visiune utopică.

Yöneticiler tarafından düzenlenmeyen ilk SA-MP sunucusu.
OOC hiyerarşisi yok. Kesinlikle oyuncular tarafından yönetiliyor. Ütopik görme.


Become a Member of our Discord Channel
Beckett is offline   Reply With Quote
Old 23/02/2020, 06:29 PM   #6
jasperschellekens
Gangsta
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Gehenna
Posts: 803
Reputation: 79
Default Re: Help with dialog

DIALOG_LOGIN is assigned to an integer which is also being used by your truck system resulting in this to happen.
__________________
Coming soon (5-21-2020):

Undead Wasteland Roleplay - Heavily mapped desert zombie apocalypse roleplay
Official Live Beta Release Date: 21th of May, 2020
Discord
jasperschellekens is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CLEO - Automatically select from DIALOG, when DIALOG is opened, and click the first button. AlaDyn172 Scripting Help 0 05/12/2019 01:43 AM
[DIALOG]How i Create A dialog Whent Player Login To Enter in Dialog The Password donhu789 Scripting Help 8 29/09/2013 07:15 AM
Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID Blackazur Scripting Help 1 30/04/2013 06:25 PM
[19:58:45] Warning: PlayerDialogResponse PlayerId: 28 dialog ID doesn't match last sent dialog ID, what it means? niels44 Scripting Help 6 13/06/2012 05:53 PM
Big problem (PlayerDialogResponse PlayerId: 57 dialog ID doesn't match last sent dialog ID) RingoRus Server Support 3 12/06/2012 05:54 PM


All times are GMT. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.