SA-MP Forums Archive
VehicleName error - 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)
+--- Thread: VehicleName error (/showthread.php?tid=314288)



VehicleName error - DarkyTheAngel - 29.01.2012

Hello again guys ! I just downloaded a gamemode and i try to compile it , but i get these errors ! :
pawn Код:
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\RO.pwn(1347) : error 017: undefined symbol "VehicleName"
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\RO.pwn(1347) : warning 215: expression has no effect
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\RO.pwn(1347) : error 001: expected token: ";", but found "]"
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\RO.pwn(1347) : error 029: invalid expression, assumed zero
C:\Users\Win7\Desktop\Stunt King Romania 0.3d\Server\gamemodes\RO.pwn(1347) : fatal error 107: too many error messages on one line
Line 1347 :
pawn Код:
format(string, sizeof(string), "Acum tu tractezi un %s",VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
Help ? Thanks


Re: VehicleName error - Johnson_boy - 29.01.2012

You are missing the VehicleName array. If it exists in your script, it's on the wrong level.
To avoid this problem, put that array before Any public functions or stocks.


Re: VehicleName error - DarkyTheAngel - 29.01.2012

Umm .. what you mean is that , the VehicleName array is missing ?In script , that array dosen't exist.


Re: VehicleName error - Konstantinos - 29.01.2012

Press Ctrl + F and type on the box "VehicleName" (without " ") and see if you have any variable.


Re: VehicleName error - DarkyTheAngel - 29.01.2012

Soo .. can someone , make me that command ? , Actual Command :
pawn Код:
if ( strcmp ( cmdtext , "/tow", true)==0){

    new Float:pX,Float:pY,Float:pZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    new Float:vX,Float:vY,Float:vZ;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
    vid++;
    GetVehiclePos(vid,vX,vY,vZ);
    if  ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
    {
    Found=1;
    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
    {
    DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid,0xFFFF00AA,"Ai deatasat masina");
    }else
    {
    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
    format(string, sizeof(string), "Acum tu tractezi un %s",VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    SendClientMessageToAll(0xFFFF00AA, string);
    }
    }
    }
    if  (!Found)
    {
    SendClientMessage(playerid,0xFFFF00AA,"Nu am gasit nici un vehicul,mergeti mai aproape de masina.");
    }
    return 1;
    }