Help for DialogBox !! +1 REP !!
#1

HEY gUYS,
im Making a scrip like this:
Код:
#include <a_samp>

#define classes 1
#define pilot 2
#define airforce 3

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" All Dialogs");
	print("--------------------------------------\n");

	public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes,DIALOG_STYLE_LIST,"Class Select"," Pilot\n Air Force","Select", "Cancel");
	return 1;
}
	
	public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
            }
        }
        return 1;
    }
    if(dialogid == pilot)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935,1258.7944,10.8203,359.1960);//LVA
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995,18.6769,14.1484,140.7841);//SFA
            }
            if(listitem == 2)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378,-2453.3921,13.5469,93.1549);//LSA
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412,2023.7921,22.6406,94.1359);//area51
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959,497.1472,18.2344,358.6761);//SFC
            }
            
        }
        return 1;
        #endif
I Compiled it and its successfully complied but when i connect in-game it does not show any Dialog Box why ?

Thanks in-Advance
Avi.
Reply
#2

i wonder how it got complied , you missed 3 or 4 brackets
try this
pawn Код:
#include <a_samp>

#define classes 1
#define pilot 2
#define airforce 3

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" All Dialogs");
    print("--------------------------------------\n");
}
main(){}

#endif
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes,DIALOG_STYLE_LIST,"Class Select"," Pilot\n Air Force","Select", "Cancel");
    return 1;
}
   
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
            }
        }
        return 1;
    }
    if(dialogid == pilot)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935,1258.7944,10.8203,359.1960);//LVA
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995,18.6769,14.1484,140.7841);//SFA
            }
            if(listitem == 2)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378,-2453.3921,13.5469,93.1549);//LSA
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412,2023.7921,22.6406,94.1359);//area51
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959,497.1472,18.2344,358.6761);//SFC
            }
           
        }
        return 1;
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
i wonder how it got complied , you missed 3 or 4 brackets
try this
pawn Код:
#include <a_samp>

#define classes 1
#define pilot 2
#define airforce 3

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" All Dialogs");
    print("--------------------------------------\n");
}
main(){}

#endif
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes,DIALOG_STYLE_LIST,"Class Select"," Pilot\n Air Force","Select", "Cancel");
    return 1;
}
   
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
            }
        }
        return 1;
    }
    if(dialogid == pilot)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935,1258.7944,10.8203,359.1960);//LVA
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995,18.6769,14.1484,140.7841);//SFA
            }
            if(listitem == 2)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378,-2453.3921,13.5469,93.1549);//LSA
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412,2023.7921,22.6406,94.1359);//area51
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959,497.1472,18.2344,358.6761);//SFC
            }
           
        }
        return 1;
    }
    return 1;
}
Getting errors:
Код:
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(48) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(53) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(58) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(71) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(76) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Help !
Thanks
Avi.
Reply
#4

and when i tested it, its just show Pilot and Air Force then i selected Pilot it just spawned me at LS Airport instead of showing another dialog box to select a Airport

Sorry for double post.
Reply
#5

Quote:
Originally Posted by Avi57
Посмотреть сообщение
Getting errors:
Код:
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(48) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(53) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(58) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(71) : warning 202: number of arguments does not match definition
C:\Documents and Settings\User\Desktop\server\filterscripts\alldialogs.pwn(76) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
Help !
Thanks
Avi.
SetPlayerPos(playerid,x,y,z,a)
It should be SetPlayerPos(playerid,x,y,z);
For facing angle, use SetPlayerFacingAngle(playerid,a);
Reply
#6

pawn Код:
#include <a_samp>

#define classes 1000
#define pilot 1001
#define airforce 1002

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" All Dialogs");
    print("--------------------------------------\n");
}
main(){}

#endif
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes, DIALOG_STYLE_LIST, "Class Select", "Pilot\n Air Force", "Select", "Cancel");
    return 1;
}
   
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0: ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 1: ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
        }
        return 1;
    }
    if(dialogid == pilot)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935, 1258.7944, 10.8203);//LVA
                SetPlayerFacingAngle(playerid, 359.1960);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995, 18.6769, 14.1484);//SFA
                SetPlayerFacingAngle(playerid, 140.7841);
            }
            case 2:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378, -2453.3921, 13.5469);//LSA
                SetPlayerFacingAngle(playerid, 93.1549);
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412, 2023.7921, 22.6406);//area51
                SetPlayerFacingAngle(playerid, 94.1359);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959, 497.1472, 18.2344);//SFC
                SetPlayerFacingAngle(playerid, 358.6761);
            }
        }
        return 1;
    }
    return 1;
}
Reply
#7

edit: nvm late

try this one
pawn Код:
#include <a_samp>

#define classes 1
#define pilot 2
#define airforce 3

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" All Dialogs");
    print("--------------------------------------\n");
}
main(){}

#endif
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes,DIALOG_STYLE_LIST,"Class Select"," Pilot\n Air Force","Select", "Cancel");
    return 1;
}
   
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
            }
        }
    }
    if(dialogid == pilot)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935,1258.7944,10.8203);//LVA
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995,18.6769,14.1484);//SFA
            }
            if(listitem == 2)
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378,-2453.3921,13.5469);//LSA
            }
        }
    }

    if(dialogid == airforce)
    {
        if(response)
        {
            if(listitem == 0)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412,2023.7921,22.6406);//area51
            }
            if(listitem == 1)
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959,497.1472,18.2344);//SFC
            }
           
        }
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by aRoach
Посмотреть сообщение
pawn Код:
#include <a_samp>

#define classes 1000
#define pilot 1001
#define airforce 1002

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" All Dialogs");
    print("--------------------------------------\n");
}
main(){}

#endif
public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, classes, DIALOG_STYLE_LIST, "Class Select", "Pilot\n Air Force", "Select", "Cancel");
    return 1;
}
   
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == classes)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0: ShowPlayerDialog(playerid, pilot, DIALOG_STYLE_LIST, "Select Airport", "Las Venturas\nSan Fierro\nLos Santos", "Select", "Cancel");
            case 1: ShowPlayerDialog(playerid, airforce, DIALOG_STYLE_LIST, "Select Airport", "Area 51\nSan Fierro Carrier", "Select", "Cancel");
        }
        return 1;
    }
    if(dialogid == pilot)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 1318.5935, 1258.7944, 10.8203);//LVA
                SetPlayerFacingAngle(playerid, 359.1960);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, -1268.1995, 18.6769, 14.1484);//SFA
                SetPlayerFacingAngle(playerid, 140.7841);
            }
            case 2:
            {
                SetPlayerSkin(playerid, 61);
                SetPlayerPos(playerid, 2005.6378, -2453.3921, 13.5469);//LSA
                SetPlayerFacingAngle(playerid, 93.1549);
            }
        }
        return 1;
    }

    if(dialogid == airforce)
    {
        if(!response) return 0;
       
        switch(listitem)
        {
            case 0:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, 346.9412, 2023.7921, 22.6406);//area51
                SetPlayerFacingAngle(playerid, 94.1359);
            }
            case 1:
            {
                SetPlayerSkin(playerid, 287);
                SetPlayerPos(playerid, -1347.8959, 497.1472, 18.2344);//SFC
                SetPlayerFacingAngle(playerid, 358.6761);
            }
        }
        return 1;
    }
    return 1;
}
Thx it works but when i select pilot then Like Las Venturas it dont spawn me there and it show me this after i select Air Force > Any Airport .




i wanna Know when i click the airport why it doesn't spawn at that airport ? and how can i remove that spawn option thats in pic 2 ??
Thanks
Avi.
Reply
#9

bump need Help ASAP !!!
Reply
#10

have you try firs spawn player and show him Airport dialog ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)