Another problem..
#1

Someone help me with this? lol...

It's a dialog problem.

Errors.
Код:
C:\Users\MIKE\Desktop\Working\filterscripts\S-Skins.pwn(223) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\MIKE\Desktop\Working\filterscripts\S-Skins.pwn(223 -- 224) : error 029: invalid expression, assumed zero
C:\Users\MIKE\Desktop\Working\filterscripts\S-Skins.pwn(225) : error 014: invalid statement; not in switch
C:\Users\MIKE\Desktop\Working\filterscripts\S-Skins.pwn(225) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Script.
Код:
#define FILTERSCRIPT
#include <a_samp>
#include <ZCMD>

//Dialogs
#define DIALOG_MAIN         1
#define DIALOG_GROVE        2
#define DIALOG_BALLA        3


//Colors
#define COLOR_GREY          0xAD9797FF

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}


public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

//ZCMD Command Processing.
CMD:getskin(playerid, params[])
{
	ShowPlayerDialog(playerid, DIALOG_MAIN, DIALOG_STYLE_LIST, "Skin help panel", "Grove\nBallas", "Select", "Close");
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(DIALOG_MAIN)// Lookup the dialogid
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_GREY, "You have exitted the main menu.");
                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
                {
                    ShowPlayerDialog(playerid, DIALOG_GROVE, DIALOG_STYLE_LIST, "Grove Street Family Skin Panel", "Family 1\nFamily 2\nFamily 3", "Select", "Back");// What should happen when they click on the first item?
                }
                case 1:
                {
                    ShowPlayerDialog(playerid, DIALOG_BALLA, DIALOG_STYLE_LIST, "Ballas Skin Panel", "Balla 1\nBalla 2\nBalla 3", "Select", "Back");// And the second item?
                }
                // Add the rest of your listitems for dialog 1 here

            }

        }

	switch(DIALOG_GROVE)// Lookup the dialogid
    {
        case 1;
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_GREY, "You have exitted the Grove Skin Menu");
                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
                {
                    SetPlayerSkin(playerid, 105);// What should happen when they click on the first item?
                }
                case 1:
                {
                    SetPlayerSkin(playerid, 106);// And the second item?
                }
                case 2:
                {
                    SetPlayerSkin(playerid, 107);// We can keep going on here ;)
                }
                // Add the rest of your listitems for dialog 1 here

            }

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

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Issues.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(DIALOG_MAIN)// Lookup the dialogid
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_GREY, "You have exitted the main menu.");
                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
                {
                    ShowPlayerDialog(playerid, DIALOG_GROVE, DIALOG_STYLE_LIST, "Grove Street Family Skin Panel", "Family 1\nFamily 2\nFamily 3", "Select", "Back");// What should happen when they click on the first item?
                }
                case 1:
                {
                    ShowPlayerDialog(playerid, DIALOG_BALLA, DIALOG_STYLE_LIST, "Ballas Skin Panel", "Balla 1\nBalla 2\nBalla 3", "Select", "Back");// And the second item?
                }
                // Add the rest of your listitems for dialog 1 here

            }

        }

	switch(DIALOG_GROVE)// Lookup the dialogid
    {
        case 1;
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_GREY, "You have exitted the Grove Skin Menu");
                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
                {
                    SetPlayerSkin(playerid, 105);// What should happen when they click on the first item?
                }
                case 1:
                {
                    SetPlayerSkin(playerid, 106);// And the second item?
                }
                case 2:
                {
                    SetPlayerSkin(playerid, 107);// We can keep going on here ;)
                }
                // Add the rest of your listitems for dialog 1 here

            }

        }    // 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.).
}
Reply
#2

You can switch the dialog IDs. not the every id.
pawn Код:
switch( dialogid )
{
    case DIALOG_MAIN:
    {
        // Code
    }
    case DIALOG_GROVE:
    {
        // Code
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)