SA-MP Forums Archive
Litle help please - 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: Litle help please (/showthread.php?tid=202722)



Litle help please - TheArcher - 24.12.2010

Hi guys, i've got this errors:

Код:

C:\Users\Administrator\Desktop\Iron City 0.3c [2.0]\gamemodes\IC-RP.pwn(3103) : error 028: invalid subscript (not an array or too many subscripts): "OwnableVehicle"
C:\Users\Administrator\Desktop\Iron City 0.3c [2.0]\gamemodes\IC-RP.pwn(3103) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\Iron City 0.3c [2.0]\gamemodes\IC-RP.pwn(3103) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\Iron City 0.3c [2.0]\gamemodes\IC-RP.pwn(3103) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\Iron City 0.3c [2.0]\gamemodes\IC-RP.pwn(3103) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
the line 3103 is:

Код:
if(OwnableVehicle[result] == PlayerInfo[playerid][pCarKey1]) { }
Full code:

Код:
               		if(OwnableVehicleID(result))
               		{
               		    if(OwnableVehicle[result] == PlayerInfo[playerid][pCarKey1]) { }
               		    else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey2]) { }
               		    else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey3]) { }
               		    else
               		    {
			               	SendClientMessage(playerid, COLOR_GREY, "  Bagagliaio Chiuso !");
			 				return 1;
						}
					}



Respuesta: Litle help please - admantis - 24.12.2010

why you have { then } with no functions in it? if you want it to do nothing, than return 0 like
pawn Код:
// Not { }
// But { return 0; }



Re: Respuesta: Litle help please - [JnA]DukeNukem - 24.12.2010

Quote:
Originally Posted by admantis
Посмотреть сообщение
why you have { then } with no functions in it? if you want it to do nothing, than return 0 like
pawn Код:
// Not { }
// But { return 0; }
Took the word out of my mouth


Re: Litle help please - TheArcher - 24.12.2010

Doesn't works. this is my full command:

pawn Код:
COMMAND:bagagliaio(playerid, params[])
{
    new x_nr[128];
    if(sscanf(params, "s[128]", x_nr)) SendClientMessage(playerid,  COLOR_GREEN, "USA: /bagagliaio [info]");
    else
    {
        if (PlayerInfo[playerid][pPlayerLogged] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Devi Loggarti.");
        if(strcmp(x_nr, "info", true) == 0)
        {
             new counter = 0;
             new result;
             new plyName[MAX_PLAYER_NAME];

             GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
             GiveNameSpace(plyName);
             for(new i; i != MAX_VEHICLES; i++)
             {
                new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
                if(dist)
                {
                    result = i;
                    counter++;
                }
            }
            switch(counter)
            {
                case 0:
                {
                    SendClientMessage(playerid, COLOR_GREY, "   Non ci sono auto con Bagagliaio intorno a te!");
                }

                case 1:
                {
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il bagagliaio mentre sei in auto");
                        return 1;
                    }
                    if(OwnableVehicleID(result))
                    {
                        if(OwnableVehicle[result] == PlayerInfo[playerid][pCarKey1]) { return 0; }
                        else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey2]) { return 0; }
                        else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey3]) { return 0; }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY, "  Bagagliaio Chiuso !");
                            return 1;
                        }
                    }
                    if(IsNotAEngineCar(result))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "  Questo veicolo non ha un Bagagliaio !");
                        return 1;
                    }

                    default:
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   Ci sono troppe auto intorno");
                        return 1;
                    }
                }
                return 1;
            }
        }
    }
    return 1;
}



Re: Litle help please - The_Gangstas - 24.12.2010

u have default in case 1.


Re: Litle help please - TheArcher - 24.12.2010

Dont works


Re: Litle help please - TheArcher - 24.12.2010

Anyone please?


Re: Litle help please - TheArcher - 25.12.2010

Bump


Re: Litle help please - TheArcher - 30.12.2010

Bump again