SA-MP Forums Archive
Vehicles In Include? - 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: Vehicles In Include? (/showthread.php?tid=92720)



Vehicles In Include? - burgershot - 21.08.2009

Hello,

Since my GM has a lot of vehicles so I decided to put them in a separate include:

pawn Код:
#if defined _Vehicles_included
    #endinput
#endif
#define _Vehicles_included

forward LoadVehicles();

public LoadVehicles()
{
    //==============================VEHICLES==============================
     AddStaticVehicle(blablalbalbla):

    return 1;
}
It compiles without any problem but the vehicles don't load.
it is Included In My Game mode And Loads

Help Please


Re: Vehicles In Include? - burgershot - 21.08.2009

anyone?


Re: Vehicles In Include? - CAR - 21.08.2009

You mean that the vehicles stands in a include file?

Than in the GM put this:
#include <FILENAME>

FILENAME: there you must put the filename of the include (Don't set "filename.inc" but set "filename" only)


Re: Vehicles In Include? - burgershot - 21.08.2009

yeah I have it included, is there a reason for the public function not being called? I have it forwarded...


Re: Vehicles In Include? - CAR - 21.08.2009

Код:
#if defined _Vehicles_included
#endinput
#endif
#define _Vehicles_included

forward LoadVehicles();

public LoadVehicles()
{
//==============================VEHICLES==============================
     AddStaticVehicle(blablalbalbla):

return 1;
}
Is this the Include FILE?


Re: Vehicles In Include? - Fj0rtizFredde - 21.08.2009

Put a timer under OnGameModeInit to call the function :P


Re: Vehicles In Include? - Yuryfury - 21.08.2009

Just do LoadVehicles(): Under OnGameModeInit

LoadVehicles Would be the name of the public




Re: Vehicles In Include? - Donny_k - 21.08.2009

Get rid of all the include stuff and have just:

pawn Код:
AddStaticVehicle( ...............
AddStaticVehicle( ...............
AddStaticVehicle( ...............
..................
In your file then put it in your gamemodes folder instead of your include folder.

You can do this now:

pawn Код:
#include "my_vehicle_file.txt"
Under your On....Init() callback and it will compile as if you had written the code in the script at that position rather than wasting function calls and whatever.