SA-MP Forums Archive
Errors. - 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: Errors. (/showthread.php?tid=275810)



Errors. - Darnell - 11.08.2011

Quote:

(435)error 029: invalid expression, assumed zero
(435) : error 017: undefined symbol "cmd_spawncar"
(435) : error 029: invalid expression, assumed zero

Above that CMD I have a dialog response & when I delete the dialog response, it complies without errors.
Dialog response code :
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
            {
                case 0:
                {
                    GivePlayerWeapon(playerid, 24, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 1:
                {
                    GivePlayerWeapon(playerid, 22, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 2:
                {
                    GivePlayerWeapon(playerid, 25, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 3:
                {
                    GivePlayerWeapon(playerid, 26, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 4:
                {
                    GivePlayerWeapon(playerid, 27, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 5:
                {
                    GivePlayerWeapon(playerid, 32, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 6:
                {
                    GivePlayerWeapon(playerid, 28, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 7:
                {
                    GivePlayerWeapon(playerid, 29, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 8:
                {
                    GivePlayerWeapon(playerid, 30, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 9:
                {
                    GivePlayerWeapon(playerid, 31, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
                case 10:
                {
                    GivePlayerWeapon(playerid, 33, 500);
                    SendClientMessage(playerid, COLOR_WHITE, "Enjoy your weapon.");
                }
            }
        }
     }
        return 1;
}



Re: Errors. - shaikh007 - 11.08.2011

Where is line 435 give us the hole dialog code with cmds


Re: Errors. - Darnell - 11.08.2011

pawn Code:
COMMAND:spawncar(playerid, params[])
{
    new vehicleid, color1, color2;
    if(!sscanf(params, "iii", vehicleid, color1, color2))
    {
       new vin;
       new Float:x, Float:y, Float:z;
       GetPlayerPos(playerid, x, y, z);
       vin=CreateVehicle(vehicleid, x, y, z, 0.0, color1, color2, -1);
       PutPlayerInVehicle(playerid, vin, 0);
    }else{
        SendClientMessage(playerid, COLOR_GREY, "ERROR: This command requires: /spawncar [vehicleid][color1][color2]");

    }
    return 1;
}
As I said, I think it's because of the dialog response & not the /spawncar.


Re: Errors. - Grim_ - 11.08.2011

You are missing a closing bracket on the OnDialogResponse callback. That is what poor indention gets you.


Re: Errors. - Darnell - 11.08.2011

Found, L&A or w/e.