[HELP] Dialog Respone
#1

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;
}
Reply
#2

Your statements are a bit messed up.

PHP код:
CMD:teles(playeridparams[])
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SendClientMessage(playeridCOLOR_RED"ERROR: you need to be the driver of the vehicle or be onfoot to use this command");
    if(
PlayerInfo[playerid][World] == StuntWorldID)
    {
        
ShowPlayerDialog(playeridDIALOG_STUNTTELESDIALOG_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(playeridDIALOG_DMTELESDIALOG_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(playeridDIALOG_DRIFTTELESDIALOG_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)
Reply
#3

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.
Reply
#4

https://sampwiki.blast.hk/wiki/OnDialogResponse

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    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;

Reply
#5

Check my pm . and ty.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)