SA-MP Forums Archive
How i can make this work? - 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: How i can make this work? (/showthread.php?tid=468703)



How i can make this work? - eblood1 - 09.10.2013

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, );
}
}
}


Re: How i can make this work? - xVIP3Rx - 09.10.2013

What is wrong with this ? What's the problem.. ?


Re: How i can make this work? - eblood1 - 09.10.2013

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.


Re: How i can make this work? - xVIP3Rx - 09.10.2013

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


Re: How i can make this work? - eblood1 - 09.10.2013

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");


Re: How i can make this work? - xVIP3Rx - 09.10.2013

Replace showDialog with ShowPlayerDialog


Re: How i can make this work? - Konstantinos - 09.10.2013

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).


Re: How i can make this work? - eblood1 - 09.10.2013

still get errors , maybe im putting stuff wrong :/


Re: How i can make this work? - iZN - 09.10.2013

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");



Re: How i can make this work? - eblood1 - 09.10.2013

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