How i can make this work?
#1

ShowDialog(playerid, 54, DIALOG_STYLE_LIST, "Teams", "Yellow\nGreen\nPurple\nRed\nBlue", "Select", "Cancel");
if(dialogid == 54)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 4, );
SendClientMessage(playerid, , "");
SetPlayerPos(playerid, 734.76, -1294.02, 13.56);
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 4, );
SendClientMessage(playerid, , "");
SetPlayerPos(playerid, );
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 4, );
SetPlayerPos(playerid, );
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 4, );
SetPlayerPos(playerid, );
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 4, );
SetPlayerPos(playerid, );
}
}
}
Reply
#2

What is wrong with this ? What's the problem.. ?
Reply
#3

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
What is wrong with this ? What's the problem.. ?
When i put it in my Gm i get errors

[5:01:05 PM] eblood 1: C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14106) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14107) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14109) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14111) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14117) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14123) : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(1412 : error 010: invalid function or declaration
C:\Users\Administrator\Desktop\Extreme Stunting\gamemodes\StuntGM_XS.pwn(14133) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (coffee) 1997-2006, ITB CompuPhase


8 Errors.
Reply
#4

Can you tell which lines have errors ? on the script..
Reply
#5

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
Can you tell which lines have errors ? on the script..
This
showDialog(playerid, 54, DIALOG_STYLE_LIST, "Teams", "Yellow\nGreen\nPurple\nRed\nBlue", "Select", "Cancel");
Reply
#6

Replace showDialog with ShowPlayerDialog
Reply
#7

You shouldn't use them outside of callbacks, custom functions etc..

pawn Код:
// Where you want to show the dialog
ShowDialog(playerid, 54, DIALOG_STYLE_LIST, "Teams", "Yellow\nGreen\nPurple\nRed\nBlue", "Select", "Cancel");
and the rest goes into OnDialogResponse. Also switch is faster.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    // some other dialogs
    switch(dialogid)
    {
        case 54:
        {
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        GivePlayerWeapon(playerid, 4, );
                        SendClientMessage(playerid, , "");
                        SetPlayerPos(playerid, 734.76, -1294.02, 13.56);
                    }
                    case 1:
                    {
                        GivePlayerWeapon(playerid, 4, );
                        SendClientMessage(playerid, , "");
                        SetPlayerPos(playerid, );
                    }
                    case 2:
                    {
                        GivePlayerWeapon(playerid, 4, );
                        SetPlayerPos(playerid, );
                    }
                    case 3:
                    {
                        GivePlayerWeapon(playerid, 4, );
                        SetPlayerPos(playerid, );
                    }
                    case 4:
                    {
                        GivePlayerWeapon(playerid, 4, );
                        SetPlayerPos(playerid, );
                    }
                }
            }
        }
    }
    return 0;
}
Don't forget to add the x, y, z to SetPlayerPos (I just copied your code).
Reply
#8

still get errors , maybe im putting stuff wrong :/
Reply
#9

Show the errors, it will assist us.

Change this:
pawn Код:
ShowDialog(playerid, 54, DIALOG_STYLE_LIST, "Teams", "Yellow\nGreen\nPurple\nRed\nBlue", "Select", "Cancel");
to this:

pawn Код:
ShowPlayerDialog(playerid, 54, DIALOG_STYLE_LIST, "Teams", "Yellow\nGreen\nPurple\nRed\nBlue", "Select", "Cancel");
Reply
#10

Now it works but when i click on yellow it takes me to the place but the dialog wont come off
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)