SA-MP Forums Archive
loop - 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: loop (/showthread.php?tid=260289)



loop - BaubaS - 08.06.2011

How can I loop ONLY created vehicles? Because counting and updating MAX_VEHICLES is TOTAL stupidity.:/


Re: loop - PGTips - 08.06.2011

yes do new

new NAMEOFCRS[numberofvehiclesyouhave]

underongamemodeinit

NAMEOFCAR[0] = AddStaticVehicleEx(infohere,respawntime);


Re: loop - BaubaS - 08.06.2011

Then I would need update [numberofvehiclesyouhave] -.-


Re: loop - PGTips - 08.06.2011

while then if your that worried about updateing set max vehicles to 999999 or somthing it does no harm


Re: loop - BaubaS - 08.06.2011

Quote:
Originally Posted by PGTips
Посмотреть сообщение
while then if your that worried about updateing set max vehicles to 999999 or somthing it does no harm
Example please?


Re: loop - PGTips - 08.06.2011

#define MAX_VEHICLES 999999

it does no harm it just mean you can have infinate vehicles


Re: loop - BaubaS - 08.06.2011

1. As I know, max vehicle limit is 2.000
2. I think you don't understand what do I need.


Re: loop - PGTips - 08.06.2011

you just need to change the max vehicles and if max is 2000 my mega old script is kina fucked then because i did

new PEDCAR[999999999]; gave me no troubles


Re: loop - BaubaS - 08.06.2011

You really dont understand what do I need exactly.


Re: loop - Vince - 08.06.2011

@PGTips: Hahaha, smartass. Now go look at the size of your AMX.
@OP: Use this:

pawn Код:
new MaxVehicles;

// GameModeInit
/*
    other vehicles go here
*/

MaxVehicles = AddStaticVehicle(...); // Last vehicle
If you use CreateVehicle in your gamemode (through command, for example), you'll need to set the new value accordingly;
pawn Код:
MaxVehicles = CreateVehicle(...);