[FilterScript] [FS] Spike Strips
#19

This is VERY inefficient. I wouldn't recommend using this. It can loop over 2000 times per second, per player. It has a 200 iteration loop inside OnPlayerUpdate, which can get called up 10x a second per player.


If your server had only 10 players connected, it could loop up 20,000 times a second. Considering how slow pawn is your server would be unplayable. Not to mention the calculations in place to check if a player is in range of the spikes.

I released a spike strip about a year ago. I'm going to be rewriting part of it and releasing it shortly. It will be much faster and efficient than this.

Some other problems I've just noticed:

Quote:
Originally Posted by OnPlayerUpdate
if(!IsPlayerConnected(playerid)) return 0;
Although I doubt this function is in anyway inefficient, it's a useless check. There obviously has to be a connected player for it to call OnPlayerUpdate.

Quote:
Originally Posted by OnPlayerUpdate loop
if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
{
if(SpikeInfo[i][sCreated] == 1)
Why are you calculating if the player is in range of the strip before even knowing if the strip exists or not?

Quote:
Originally Posted by OnPlayerUpdate: tyre popping
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
return 0;
Why are you returning 0 here, which would result in the player being de synced if they're hovering over the spike strip?
Reply


Messages In This Thread
[FS] Spike Strips - by FreshKilla - 29.03.2010, 17:16
Re: [FS] Spike Strips - by gtagangsta22 - 29.03.2010, 17:17
Re: [FS] Spike Strips - by MPKaboose - 29.03.2010, 17:19
Re: [FS] Spike Strips - by [03]Garsino - 29.03.2010, 17:25
Re: [FS] Spike Strips - by XRVX - 29.03.2010, 17:45
Re: [FS] Spike Strips - by Mr L - 29.03.2010, 18:17
Re: [FS] Spike Strips - by Fre$hKidd - 29.03.2010, 18:19
Re: [FS] Spike Strips - by Scream[SM] - 29.03.2010, 18:23
Re: [FS] Spike Strips - by Joe Staff - 29.03.2010, 18:24
Re: [FS] Spike Strips - by rephex - 29.03.2010, 19:17
Re: [FS] Spike Strips - by jasonnw666 - 29.03.2010, 19:23
Re: [FS] Spike Strips - by Correlli - 29.03.2010, 19:24
Re: [FS] Spike Strips - by XxJoexX - 29.03.2010, 20:15
Re: [FS] Spike Strips - by [03]Garsino - 29.03.2010, 21:11
Re: [FS] Spike Strips - by Mr187 - 29.03.2010, 22:16
Re: [FS] Spike Strips - by Postalityjr - 30.03.2010, 04:08
Re: [FS] Spike Strips - by [MK]Soprano - 30.03.2010, 06:09
Re: [FS] Spike Strips - by Anthonyx3' - 30.03.2010, 12:41
Re: [FS] Spike Strips - by Jay_ - 30.03.2010, 12:50
Re: [FS] Spike Strips - by [03]Garsino - 30.03.2010, 12:50
Re: [FS] Spike Strips - by panzerdeni - 30.03.2010, 14:04
Re: [FS] Spike Strips - by Anthonyx3' - 30.03.2010, 15:45
Re: [FS] Spike Strips - by Malkinu - 31.03.2010, 21:48
Re: [FS] Spike Strips - by Mr187 - 02.04.2010, 08:56
Re: [FS] Spike Strips - by Malkinu - 02.04.2010, 09:12
Re: [FS] Spike Strips - by [MWR]Blood - 02.04.2010, 09:15
Re: [FS] Spike Strips - by Mr187 - 02.04.2010, 10:52
Re: [FS] Spike Strips - by emch0o - 02.04.2010, 11:23
Re: [FS] Spike Strips - by Chpp - 02.04.2010, 16:04
Re: [FS] Spike Strips - by zizsv01 - 02.10.2010, 18:32
Re: [FS] Spike Strips - by djjeffrey99 - 25.01.2014, 11:51

Forum Jump:


Users browsing this thread: 1 Guest(s)