SA-MP Forums

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 17/02/2020, 02:17 PM   #1
D1am0nd
Big Clucker
 
Join Date: May 2014
Posts: 136
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
 

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 04:41 PM.


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