Vehicles In Include?
#1

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
Reply
#2

anyone?
Reply
#3

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)
Reply
#4

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

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

forward LoadVehicles();

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

return 1;
}
Is this the Include FILE?
Reply
#6

Put a timer under OnGameModeInit to call the function :P
Reply
#7

Just do LoadVehicles(): Under OnGameModeInit

LoadVehicles Would be the name of the public

Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)