SA-MP Forums Archive
ShowPlayerDialog .. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ShowPlayerDialog .. (/showthread.php?tid=253416)



ShowPlayerDialog .. - Renks554 - 06.05.2011

I created dialog about tuning car's . but i got 4 errors. What's wrong with the script ?
Quote:
Originally Posted by Renks554
Посмотреть сообщение
Under OnDialogResponse:

case 3:
{
switch(listitem)
{
case 0:
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0x33AA33AA, "Auto tuunitud!");
AddVehicleComponent(VehicleID, 1087); //hidraulic
return 1;
}
}
case 1:
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0x33AA33AA, "Auto tuunitud!");
AddVehicleComponent(VehicleID, 107; // wheels
return 1;
}
}
case 2:
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0x33AA33AA, "Auto tuunitud!");
AddVehicleComponent(VehicleID, 1010); //nos 10x
return 1;
}
}
case 3:
{
new VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0x33AA33AA, "Auto tuunitud!");
AddVehicleComponent(VehicleID, 101; //exaust
return 1;
}
}
return 1;
}
I Have Case 3 because i have other's cases too , ....


Re: ShowPlayerDialog .. - Biesmen - 06.05.2011

Show us the errors and please, don't use quotes. Use PAWN tags.


Re: ShowPlayerDialog .. - Laronic - 06.05.2011

What is the errors?

EDIT: Too late (:


Re: ShowPlayerDialog .. - Renks554 - 06.05.2011

fatal error 107: too many error messages on one line
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found ":"
warning 215: expression has no effect
error 014: invalid statement; not in switch
warning 217: loose indentation


Re: ShowPlayerDialog .. - Biesmen - 06.05.2011

Why are you using case? Isn't it listitems?


Re: ShowPlayerDialog .. - Renks554 - 06.05.2011

yes , listofitems ..

if(strcmp(cmdtext, "/tuuniauto", true) == 0)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Mida tahad tuunida?", "Hьdraulika \nIlukilp \nNitro \nSumbuti", "Vali", "Katkesta");
return 1;
}

Im estonian !

how i can use tags ?


Re: ShowPlayerDialog .. - Biesmen - 06.05.2011

Don't use case.

use it like this way:
pawn Код:
if(listitem == 0) // This is "Hьdraulika".
{
   //Your code here
}
if(listitem == 1) // This is "Ilukilp"
{
   //Your code here
}
if(listitem == 2) // This is "Nitro"
{
   // Your code here
}
if(listitem == 3) // This is "Sumbuti"
{
   //Your code here
}



Re: ShowPlayerDialog .. - Renks554 - 06.05.2011

i got repaired myself but thanks


Re: ShowPlayerDialog .. - Laronic - 06.05.2011

Should work

pawn Код:
#define DIALOG_1    1

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_1: //First dialogid
        {
            switch(listitem)
            {
                case 0: // "Hьdraulika"
                {
                    //Stuff
                }
                case 1: // "Ilukilp"
                {
                    //Stuff
                }
                case 2: // "Nitro"
                {
                    //Stuff
                }
                case 3: // "Sumbuti"
                {
                    //Stuff
                }
            }
        }
    }
    return 1;
}
pawn Код:
if(strcmp(cmdtext, "/tuuniauto", true) == 0)
{
    ShowPlayerDialog(playerid, DIALOG_1, DIALOG_STYLE_LIST, "Mida tahad tuunida?", "Hьdraulika \nIlukilp \nNitro \nSumbuti", "Vali", "Katkesta");
}

EDIT: Too late, Again


Re: ShowPlayerDialog .. - Renks554 - 06.05.2011

ty but i want to know how i can teleport with car's ? when i teleport , the car doesn't come with me .


Bad english ..