SA-MP Forums Archive
HELP, DIALOG. - 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: HELP, DIALOG. (/showthread.php?tid=193001)



HELP, DIALOG. - BigAl - 24.11.2010

pawn Код:
C:\Users\Ross\Desktop\G2x andreas\gamemodes\G2x_Freeroam.pwn(126) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Ross\Desktop\G2x andreas\gamemodes\G2x_Freeroam.pwn(126) : warning 215: expression has no effect
C:\Users\Ross\Desktop\G2x andreas\gamemodes\G2x_Freeroam.pwn(127) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_RED, "You cancelled!");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "You cannot afford this!");
                    else {
                    new Float:X, Float:Y, Float:Z, Float:ROT;
                    GetPlayerPos(playerid,X,Y,Z);
                    GetPlayerFacingAngle (playerid,ROT);
                    SpawnedVehicles[playerid] = CreateVehicle(400,X,Y,Z,ROT,-1,-1,60);
                }
            }
         }
    return 1;
}
HMMM... please help?


Re: HELP, DIALOG. - BigAl - 24.11.2010

BUMP!?!? please help?


Re: HELP, DIALOG. - TheXIII - 24.11.2010

You're missing a closing bracket for else.

EDIT: In fact, you could simply remove the "else {" altogether and remain with same functionality and remove the errors.


Re: HELP, DIALOG. - BigAl - 24.11.2010

Oh okay, thanks!