ShowPlayerDialog ..
#1

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 , ....
Reply
#2

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

What is the errors?

EDIT: Too late (:
Reply
#4

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
Reply
#5

Why are you using case? Isn't it listitems?
Reply
#6

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 ?
Reply
#7

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
}
Reply
#8

i got repaired myself but thanks
Reply
#9

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)