ShowPlayerDialog Help Please!
#1

Ok Guys Listen Up i have my DIALOG up but how can i make it so if i click "/SF" on the dialog it teleports me without typing plz tell me!
Reply
#2

Show us your code so we can help
Reply
#3

Quote:
Originally Posted by XFlawless
Посмотреть сообщение
Show us your code so we can help
Ok here it is:

DIALOG:if(strcmp( cmd, "/Teleports1", true ) == 0 )
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"You Must Type them"," /LS\r\n /SF\r\n /LV\r\n /UFO\r\n","Cancel", ": D");

new string[64];
new playa1[256];
GetPlayerName(playerid, playa1, sizeof(playa1));
format(string, sizeof(string)," [ %s Has Checked our teleport List1 (/teleports 1)",playa1);
SendClientMessageToAll(orange,string);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0);
return 1;
}







I wanna Make so that If i press any of them i teleport to it
Reply
#4

OnDialogresponce
Reply
#5

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
OnDialogresponce
Man plzz give me code i really DO NOT! understand it((
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleports1", cmdtext, true, 10) == 0)
{
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST,"Choose where you want to be teleported!", LS\nSF\nLV\nUFO"", "Teleport", "Cancel");
    }
That comes when you type /teleports1
____________________________________

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    {
    if(dialogid == 1)
        {
            if(!response)
            {
                ShowPlayerDialog(playerid, -1, DIALOG_STYLE_LIST, "-1", "-1", "-1", "-1");
            }
            else
            {
                switch(listitem)
                {
                    case 0:// IF CHOOSED LS!
                    {
                            SetPlayerPos(playerid, COORDINATES HERE!!!);
                                                //Add here under this if you want to add something else
                    }
                    case 1: //IF CHOOSED SF!
                    {
                        SetPlayerPos(playerid, COORDINATES HERE!!!);
                                                //other stuff
                    }
                    case 2: // LV
                    {
                        SetPlayerPos(playerid, COORDINATES HERE);
               
                    }
                    case 3: //if choosed UFO!!
                    {
                                        SetPlayerPos(playerid, COORDINATES HERE!!!!);                
                    }
            }
        }
    }
    return 1;
}
}
That should work, making it took 15 minutes off me <<

Anyway, where reads (ADD COORDINATES HERE!!!) means you have to add the coordinates to there.


And PLEASE!
Dont just copy that, try to learn from it! Its the only way to learn scripting!
Reply
#7

few fixes to GNG:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(!response) return 0;
        switch(listitem)
        {
            case 0:// IF CHOOSED LS!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
            case 1: //IF CHOOSED SF!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
            case 2: // LV
            {
                SetPlayerPos(playerid, COORDINATES HERE);

            }
            case 3: //if choosed UFO!!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
        }
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by RobinOwnz
Посмотреть сообщение
few fixes to GNG:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(!response) return 0;
        switch(listitem)
        {
            case 0:// IF CHOOSED LS!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
            case 1: //IF CHOOSED SF!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
            case 2: // LV
            {
                SetPlayerPos(playerid, COORDINATES HERE);

            }
            case 3: //if choosed UFO!!
            {
                SetPlayerPos(playerid, COORDINATES HERE);
            }
        }
    }
    return 1;
}






OMG!!!!!!!!!!!!!!!!!!!!




C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(482) : error 017: undefined symbol "SendPVarListToPlayer"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(745) : warning 217: loose indentation
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(745) : error 029: invalid expression, assumed zero
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(745) : error 004: function "OnDialogResponse" is not implemented
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(74 : error 017: undefined symbol "dialogid"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(750) : error 017: undefined symbol "response"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(756) : error 017: undefined symbol "listitem"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(760) : error 029: invalid expression, assumed zero
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(760) : warning 215: expression has no effect
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(786) : warning 225: unreachable code
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(789) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(790) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(803) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(804) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(817) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(81 : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(841) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(842) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(864) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(865) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(887) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(88 : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(911) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(912) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(936) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(937) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(95 : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(959) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(981) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(982) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1005) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1006) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1020) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1021) : warning 219: local variable "playa1" shadows a variable at a preceding level
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1039) : warning 225: unreachable code
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1039) : error 017: undefined symbol "SendPVarListToPlayer"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1049) : error 017: undefined symbol "Util_GetPVarEntryAsString"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1060) : error 029: invalid expression, assumed zero
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1060) : error 017: undefined symbol "Util_GetPVarEntryAsString"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1066) : error 017: undefined symbol "ret"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1066) : warning 215: expression has no effect
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1066) : error 001: expected token: ";", but found "]"
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1066) : error 029: invalid expression, assumed zero
C:\Users\Sh00t3R\Desktop\Server\filterscripts\CMDS .pwn(1066) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


15 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)