Dialogs error
#1

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid == 1) // Lookup the dialogid
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
                return 1; // We processed it
            }

            switch(listitem) // This is far more efficient than using an if-elseif-else structure
            {
                case 0: // Listitems start with 0, not 1
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                }
                case 1:
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                }
                case 2:
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
                }
                case 3:// Add the rest of your listitems for dialog 1 here
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                }
                case 4:// Add the rest of your listitems for dialog 1 here
                {
                    new vid = GetPlayerVehicleID(playerid);
                    if(vid != INVALID_VEHICLE_ID) {
                    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vid,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
                }

            }

        }
        // Add the rest of your dialogs here

    }
    return 0; // If you put return 1 here the callback will not continue to be called in other scripts (filterscripts, etc.).
Код:
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : warning 217: loose indentation
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : error 014: invalid statement; not in switch
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : error 001: expected token: ";", but found ":"
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\Raven's Roleplay 0.3c\filterscripts\Datascript.Weapons.pwn(212) : fatal error 107: too many error messages on one line
Reply


Messages In This Thread
Dialogs error - by 01 - 06.03.2011, 11:04
Re: Dialogs error - by Calgon - 06.03.2011, 11:07
Re: Dialogs error - by omer5198 - 06.03.2011, 11:23
Re: Dialogs error - by Bumbis - 06.03.2011, 11:29
Re: Dialogs error - by Calgon - 06.03.2011, 11:34
Re: Dialogs error - by omer5198 - 06.03.2011, 11:35
Re: Dialogs error - by Calgon - 06.03.2011, 11:39

Forum Jump:


Users browsing this thread: 1 Guest(s)