Teleport Dialog Errors
#1

Hello, i'm trying to make a teleport dialog with more dialogs appearing out of it too.

Код:
	if (strcmp("/t", cmdtext, true, 10) == 0)
	{
    	ShowPlayerDialog(playerid, DIALOG_TELEPORTS, 2, "{0099CC}Teleports", "Stunts\nHotspots\nInteriors\nHouses\nCities", "OK", "Cancel");
		return 1;
 }
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_TELEPORTS)
{
	switch(listitem)
{
	case 0:
	{
	ShowPlayerDialog(playerid, 65, 2, "Stunts", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
	}
	case 1:
	{
	ShowPlayerDialog(playerid, 66, 2, "Hotspots", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
	}
	case 2:
	{
	ShowPlayerDialog(playerid, 67, 2, "Interiors", "A\nA\nA", "OK", "Cancel");
	}
	case 3:
	{
	ShowPlayerDialog(playerid, 65, 2, "Houses", "CJ's House(/cj)\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
	}
	case 4:
	{
	ShowPlayerDialog(playerid, 65, 2, "Cities", "Los Santos\nSan Fierro\nLas Venturas\nLiberty City\nEl Quebrados", "OK", "Cancel");
	}
if(dialogid == 65)
{
	if(response)
{
		GameTextForPlayer(playerid, "~g~Abandoned Farm~n~~w~/af", 6000, 3);
		SetPlayerPos(playerid,-45.9522,-13.4273,5.6389);
		SetPlayerFacingAngle(playerid,245);
		SetPlayerInterior(playerid,0);

return 1;
}
I've only included up to dialog 65 as I only wanted to add the teleports to that for now.



Errors after compiling:

E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(455) : error 002: only a single statement (or expression) can follow each "case"
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(455 -- 456) : error 029: invalid expression, assumed zero
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(464) : warning 217: loose indentation
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(466) : warning 217: loose indentation
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(466) : error 029: invalid expression, assumed zero
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(466) : error 004: function "OnPlayerClickPlayer" is not implemented
E:\Program Files\GTA San Andreas\Server\gamemodes\Gamemode.pwn(470) : error 030: compound statement not closed at the end of file (started at line 457)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#2

Anyone?
Reply
#3

Try this:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TELEPORTS)
    {
        switch(listitem)
        {
            case 0:
            {
                ShowPlayerDialog(playerid, 65, 2, "Stunts", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
            }
            case 1:
            {
                ShowPlayerDialog(playerid, 66, 2, "Hotspots", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
            }
            case 2:
            {
                ShowPlayerDialog(playerid, 67, 2, "Interiors", "A\nA\nA", "OK", "Cancel");
            }
            case 3:
            {
                ShowPlayerDialog(playerid, 65, 2, "Houses", "CJ's House(/cj)\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel");
            }
            case 4:
            {
                ShowPlayerDialog(playerid, 65, 2, "Cities", "Los Santos\nSan Fierro\nLas Venturas\nLiberty City\nEl Quebrados", "OK", "Cancel");
            }
        }
    }
    if(dialogid == 65)
    {
        if(response)
        {
            GameTextForPlayer(playerid, "~g~Abandoned Farm~n~~w~/af", 6000, 3);
            SetPlayerPos(playerid,-45.9522,-13.4273,5.6389);
            SetPlayerFacingAngle(playerid,245);
            SetPlayerInterior(playerid,0);
        }
    }
    return 1;
}
Reply
#4

pawn Код:
#include "a_samp"

#define DIALOG_TELEPORTS 1


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if ( response )
{
if( dialogid == DIALOG_TELEPORTS )
{
switch( listitem )
{
case 0: ShowPlayerDialog(playerid, 65, 2, "Stunts", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 1: ShowPlayerDialog(playerid, 66, 2, "Hotspots", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 2: ShowPlayerDialog(playerid, 67, 2, "Interiors", "A\nA\nA", "OK", "Cancel" );
case 3: ShowPlayerDialog(playerid, 65, 2, "Houses", "CJ's House(/cj)\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 4: ShowPlayerDialog(playerid, 65, 2, "Cities", "Los Santos\nSan Fierro\nLas Venturas\nLiberty City\nEl Quebrados", "OK", "Cancel" );
}
}
return 1;
}

if ( dialogid == 65 )
{
if ( response )
{
GameTextForPlayer(playerid, "~g~Abandoned Farm~n~~w~/af", 6000, 3 );
SetPlayerPos(playerid,-45.9522,-13.4273,5.6389 );
SetPlayerFacingAngle(playerid,245 );
SetPlayerInterior(playerid,0 );
}
return 1;
}
return 0;
}
change the id of the dialogues that will be the only problem you will not work.
Reply
#5

Thanks Macronix and Snoopythekill, both worked but when I click on the second option in the Stunt category, it teleports me to the same one as the first option in the Stunt category, Abandoned Farm.
Reply
#6

Mobeen, that's because you didn't make the code for the other teleports.
Reply
#7

pawn Код:
#include "a_samp"

#define DIALOG_TELEPORTS 1


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if ( response )
{
if( dialogid == DIALOG_TELEPORTS )
{
switch( listitem )
{
case 0: ShowPlayerDialog(playerid, 65, 2, "Stunts", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 1: ShowPlayerDialog(playerid, 66, 2, "Hotspots", "Abandoned Farm\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 2: ShowPlayerDialog(playerid, 67, 2, "Interiors", "A\nA\nA", "OK", "Cancel" );
case 3: ShowPlayerDialog(playerid, 65, 2, "Houses", "CJ's House(/cj)\nSan Fierro Beach\nLas Venturas Airport", "OK", "Cancel" );
case 4: ShowPlayerDialog(playerid, 65, 2, "Cities", "Los Santos\nSan Fierro\nLas Venturas\nLiberty City\nEl Quebrados", "OK", "Cancel" );
}
}
return 1;
}
if(response)
{
switch(dialogid)
{
case 65://dialogid
{
switch(listitem)
{
case 0:
{
GameTextForPlayer(playerid, "~g~Abandoned Farm~n~~w~/af", 6000, 3 );
SetPlayerPos(playerid,-45.9522,-13.4273,5.6389 );
SetPlayerFacingAngle(playerid,245 );
SetPlayerInterior(playerid,0 );
}
case 1:
{
//type anything for the san fierro beach
}
case 2:
{
//Las Venturas Airport one.
                    }
                }
            }
        }
return 1;
}
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)