Will this cause lag in the mod? - 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 this cause lag in the mod? (
/showthread.php?tid=149268)
Will this cause lag in the mod? -
Nakash - 21.05.2010
I want to create a timer for 1 second that will check if the player is driving a vehicle ID 100 for example, if he does and he's not member of ID 3 he will be removed from the vehicle. I know how to do that, but I don't know about actually making it, I mean will it cause lag? I usually play with 130 players.
Re: Will this cause lag in the mod? -
deather - 21.05.2010
Surely it will!!
Re: Will this cause lag in the mod? -
Nakash - 21.05.2010
Quote:
Originally Posted by |)ЂΩ†{−}ЂR™ – Dare To Die
Surely it will!!
|
Okay, thank you!
Re: Will this cause lag in the mod? -
Babul - 21.05.2010
if the vehicles amount to be checked is small enough, it could be done with a timer. there is no need to loop rhrough all players tho, but i agree at avoiding timers whereever possible.
you could use the OnPlayerStateChange() callback and check if a player enters a certain VehicleModelID and trigger the (custom) eject-player routine. this could be possible w/o loops and w/o cycling through maybe 20 (forbidden) vehicles by setting a gVariableForbiddenForACertainTeam[212]=1; - if its set, then simply eject that player...