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



Problems2 - madalin912 - 12.06.2014

What to do spawn cars every payday?


Re: Problems2 - nmader - 12.06.2014

Could you please re-word your question for us?


Re: Problems2 - madalin912 - 12.06.2014

How do I give every payday to automatically respawn all cars


Re: Problems2 - Laure - 12.06.2014

Put this under your paycheck, and that will respawn all unused vehicles on every paycheck, also change it to your own variable to avoid errors.
pawn Код:
for(new i=0; i<MAX_VEHICLES; i++)
        {
                                new vehs;
                foreach(Player, x)
                {
                    if(GetPlayerVehicleID(x) == i)
                    {
                        vehs = 1;
                    }
                }
                if(!vehs)
                {
                    SetVehicleToRespawn(i);
                }
                vehs = 0;
        }
PS: U should have foreach include and hope you already have it.