SA-MP Forums Archive
Will that work ? (Funciton) - 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: Will that work ? (Funciton) (/showthread.php?tid=94560)



Will that work ? (Funciton) - Typhome - 30.08.2009

pawn Код:
forward AllTownCars();
pawn Код:
public OnGameModeInit()
{
AllTownCars();
return 1;
}
pawn Код:
public AllTownCars()
{
AddStaticVehicle(.....);
return 1;
}



Re: Will that work ? (Funciton) - Zeex - 30.08.2009

Why that should not work?
And you could test it yourself instead of asking us...


Re: Will that work ? (Funciton) - Yuryfury - 30.08.2009

yeah it should

I make it even better by making an include:
pawn Код:
#if defined _Vehicles_included
    #endinput
#endif
#define _Vehicles_included

forward LoadVehicles();

public LoadVehicles()
{
    AddStaticVehcile(blahblahblah);
     AddStaticVehicle(blahblahblah);
    return 1;
}
Then under OnGameModeInit I Just Put LoadVehicles(); and #include <Vehicles> at the top of the script

I also do the same with objects because objects/vehicles take up alot of lines in a script and get annoying