[HELP] Dialog Respone - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Dialog Respone (
/showthread.php?tid=576851)
[HELP] Dialog Respone -
Mordekaiser - 07.06.2015
Why when i press Cancel it still teleports the person , why? and how i fix it?
Ive already tryed to put OnDialogRespone , But mybe i did something wrong?
pawn Код:
//Teles CMD
CMD:teles(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "ERROR: you need to be the driver of the vehicle or be onfoot to use this command");
{
ShowPlayerDialog(playerid, DIALOG_DRIFTTELES, DIALOG_STYLE_LIST, "Drift Teleports", "/drift 1\n/drift 2\n/drift 3\n/drift 4\n/drift 5\n/drift 6\n/drift 7\n/drift 8\n/drift 9\n/drift 10\ndrift 11\n/arch\n/loco\n/lstune\n/sftune\n/lvtune\n/lounge\n/grove", "Ok", "Cancel");
}
else if(PlayerInfo[playerid][World] == StuntWorldID)
{
ShowPlayerDialog(playerid, DIALOG_STUNTTELES, DIALOG_STYLE_LIST, "Stunt Teleports", "/bp\n/boatpark\n/bs\n/bayside\n/xmas(only during xmas)\n/woods\n/superrace\n/loop\n/mc\n/derby\n/sfa\n/lsa\n/lva\n/aa\n/lounge\n/grove\n/skyfall\n/halfpipe", "Ok", "Cancel");
}
else if(PlayerInfo[playerid][World] == SkillWorldID)
else if(PlayerInfo[playerid][World] == DMWorldID)
{
ShowPlayerDialog(playerid, DIALOG_DMTELES, DIALOG_STYLE_LIST, "Death Match Teleports", "/dm\n/dms\n/nrgdm\n/boxing2\n/dildodm\n/mgdm\n/warehousedm\n/boxing\n/hilldm\n/roofdm\n/glass\n/desertdm\n/islanddm", "Ok", "Cancel");
}
return 1;
}
Re: [HELP] Dialog Respone -
Konstantinos - 07.06.2015
Your statements are a bit messed up.
PHP код:
CMD:teles(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playerid, COLOR_RED, "ERROR: you need to be the driver of the vehicle or be onfoot to use this command");
if(PlayerInfo[playerid][World] == StuntWorldID)
{
ShowPlayerDialog(playerid, DIALOG_STUNTTELES, DIALOG_STYLE_LIST, "Stunt Teleports", "/bp\n/boatpark\n/bs\n/bayside\n/xmas(only during xmas)\n/woods\n/superrace\n/loop\n/mc\n/derby\n/sfa\n/lsa\n/lva\n/aa\n/lounge\n/grove\n/skyfall\n/halfpipe", "Ok", "Cancel");
}
else if(PlayerInfo[playerid][World] == SkillWorldID || PlayerInfo[playerid][World] == DMWorldID)
{
ShowPlayerDialog(playerid, DIALOG_DMTELES, DIALOG_STYLE_LIST, "Death Match Teleports", "/dm\n/dms\n/nrgdm\n/boxing2\n/dildodm\n/mgdm\n/warehousedm\n/boxing\n/hilldm\n/roofdm\n/glass\n/desertdm\n/islanddm", "Ok", "Cancel");
}
else ShowPlayerDialog(playerid, DIALOG_DRIFTTELES, DIALOG_STYLE_LIST, "Drift Teleports", "/drift 1\n/drift 2\n/drift 3\n/drift 4\n/drift 5\n/drift 6\n/drift 7\n/drift 8\n/drift 9\n/drift 10\ndrift 11\n/arch\n/loco\n/lstune\n/sftune\n/lvtune\n/lounge\n/grove", "Ok", "Cancel");
return 1;
}
and in OnDialogResponse, if the dialogid is one of those 3, check if response is 1 and then teleport them.
PS: SkillWorldID has nothing and I thought it's same as DMing. If not and it's referring to drifting then remove it from that statement and change "else" to "else if(PlayerInfo[playerid][World] == SkillWorldID)
Re: [HELP] Dialog Respone -
Mordekaiser - 07.06.2015
Bro i dont really understand can you give me an example of a 100% working OnDialogResponse?
And yeah , i removed some stuff , editing at the moment , so i forgot to delete some stuff.
Re: [HELP] Dialog Respone -
Konstantinos - 07.06.2015
https://sampwiki.blast.hk/wiki/OnDialogResponse
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_STUNTTELES:
{
if (response)
{
// teleport to stunting locations
}
}
case DIALOG_DMTELES:
{
if (response)
{
// teleport to DMing locations
}
}
case DIALOG_DRIFTTELES:
{
if (response)
{
// teleport to drifting locations
}
}
// rest.. same as above..
default: return 0;
}
return 1;
}
Re: [HELP] Dialog Respone -
Mordekaiser - 07.06.2015
Check my pm . and ty.