Car plat - 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: Car plat (
/showthread.php?tid=353697)
Car plat -
Robert West - 24.06.2012
hello
im asking if it's possibol to make the plate of every car spawned her id and how
Re: Car plat -
Grand_Micha - 24.06.2012
Yo. Set a bool:cars = 1; OnGameModeInit. Then make a loop with formatting vehicleid into an integer string, SetVehicleNumberPlate with that string and SetVehicleToRespawn for every car. Now set the boolean to 0. Set a condition for OnVehicleSpawn like
if(cars ==1).
Catch my drift?
Re: Car plat -
iggy1 - 24.06.2012
OnGameModeInit.
pawn Код:
new szStr[6];
for(new i=0; i < MAX_VEHICLES; ++i)
{
format(szStr, sizeof(szStr), "%d", i);
SetVehicleNumberPlate(i, szStr);
}
Re: Car plat -
Grand_Micha - 24.06.2012
Why are you doing all the work for him?
Also, you should keep in mind that a number plate only updates if a car is restreamed or respawned.
Re: Car plat -
iggy1 - 24.06.2012
Quote:
Originally Posted by Grand_Micha
Why are you doing all the work for him?
Also, you should keep in mind that a number plate only updates if a car is restreamed or respawned.
|
All the work?? It's a simple loop.
And your wrong. Numberplates update as soon as you change them. If they are
already streamed in for a player, they need respawning but that can't happen under
OnGameModeInit.
Re: Car plat -
Grand_Micha - 24.06.2012
Yes, all the work. This loop is a whole milestone for newbies.
Also, I am no RP geek. I just quoted the wiki, so I am not wrong. Blame the wiki.
https://sampwiki.blast.hk/wiki/SetVehicleNumberPlate
Re: Car plat -
iggy1 - 24.06.2012
Quote:
Originally Posted by Grand_Micha
Yes, all the work. This loop is a whole milestone for newbies.[/url]
|
Well now he knows how to loop if he didn't before which is more help than what you posted.
You was right vehicles do need to be respawned/restreamed - if they are already streamed in. Otherwise they will be re-streamed when in view distance of a player anyway.
Re: Car plat -
Grand_Micha - 24.06.2012
Indeed, and this is the reason why he needs to know about that for the future.
Actually, I think both your and my posts helped him to some extent, which means that our work here is done.