Teleport Dialog Errors -
Mobeen - 26.04.2014
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.
Re: Teleport Dialog Errors -
Mobeen - 27.04.2014
Anyone?
AW: Teleport Dialog Errors -
Macronix - 27.04.2014
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;
}
Respuesta: Teleport Dialog Errors -
Snoopythekill - 27.04.2014
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.
Re: Teleport Dialog Errors -
Mobeen - 27.04.2014
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.
Re: Teleport Dialog Errors -
Eth - 27.04.2014
Mobeen, that's because you didn't make the code for the other teleports.
Re: Respuesta: Teleport Dialog Errors -
Eth - 28.04.2014
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;
}