SA-MP Forums Archive
[Include] [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! (/showthread.php?tid=68443)

Pages: 1 2 3


[INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 10.03.2009

Code:
forward OnPlayerExitStreamCheckpoint(playerid, checkpointid);
public OnPlayerExitStreamCheckpoint(playerid, checkpointid)
{
  return 1;
}
- Download

http://www.zezombia.com/upload/Yaheli/YCP.inc




Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - NigNog1 - 10.03.2009

Why not just use a timer? I heared that OnPlayerUpdate gets called about 15 times per second, per player. Imagine a server with 200 players using it.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Patch-PT - 10.03.2009

Nice job men.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 10.03.2009

Quote:
Originally Posted by Stevelo
Why not just use a timer? I heared that OnPlayerUpdate gets called about 15 times per second, per player. Imagine a server with 200 players using it.
Why make another timer that would have to loop through 200 players even when only 1 is connected?


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - lesley - 10.03.2009

The idea is pretty nice! Lets make every streamer work with OnPlayerUpdate.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - SniperX64 - 10.03.2009

Nice job Yaheli .


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - SHlZNlT - 10.03.2009

Good job mate!


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - NigNog1 - 10.03.2009

Quote:
Originally Posted by Yaheli
Why make another timer that would have to loop through 200 players even when only 1 is connected?
It would be much more efficient in terms of what this modification was created for. People seem to think that a 200 player loop causes a load of lag. This is a multi player modification, so scripting something that is only designed for one player isn't very relevant.

Calling a timer every second or so with a 200 byte loop would take about 0.001 seconds to allocate in pawn depending on what it does per loop. It would be much better than calling it from a function that, if say was being used on a server full of 200 people, would be getting called more than 3000 times a second.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 10.03.2009

Quote:
Originally Posted by Stevelo
Quote:
Originally Posted by Yaheli
Why make another timer that would have to loop through 200 players even when only 1 is connected?
It would be much more efficient in terms of what this modification was created for. People seem to think that a 200 player loop causes a load of lag. This is a multi player modification, so scripting something that is only designed for one player isn't very relevant.

Calling a timer every second or so with a 200 byte loop would take about 0.0001 seconds to allocate in pawn depending on what it does per loop. It would be much better than calling it from a function that, if say was being used on a server full of 200 people, would be getting called more than 3000 times a second.
You haven't actually looked at the scripthave you? It won't be near 3000 a second unless you set UPDATE_AMMOUNT to 1.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - pspleo - 10.03.2009

Nice. Maybe useful in the RPG Script?

Leopard


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - NigNog1 - 10.03.2009

Quote:
Originally Posted by Yaheli
You haven't actually looked at the scripthave you? It won't be near 3000 a second unless you set UPDATE_AMMOUNT to 1.
I have looked at it. The callback still get's called 3000 times a second, whether there are some var size checks before it calls the function or not, it would still be more efficient to just use a timer.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 10.03.2009

Quote:
Originally Posted by [K4L
Leopard ]
Nice. Maybe useful in the RPG Script?

Leopard
Could be

Quote:
Originally Posted by Stevelo
Quote:
Originally Posted by Yaheli
You haven't actually looked at the scripthave you? It won't be near 3000 a second unless you set UPDATE_AMMOUNT to 1.
I recall Kye saying once in IRC that it would be more efficient to use OnPlayerUpdate for streamers if it was called every 20-30 OnPlayerUpdates.

I have looked at it. The callback still get's called 3000 times a second, whether there are some var size checks before it calls the function or not, it would still be more efficient to just use a timer.



Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - NigNog1 - 10.03.2009

So what? When Kye said that he probably didn't mean every possible streamer working in the same way. Try reading my posts and understanding.

Maybe with other streamers OnPlayerUpdate would be better, it totally depends on what it's streaming and how it works. With the possibility of it being called over 3000 times a second, personally, I wouldn't use OnPlayerUpdate for anything.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 10.03.2009

Quote:
Originally Posted by Stevelo
So what? When Kye said that he probably didn't mean every possible streamer working in the same way. Try reading my posts and understanding.

Maybe with other streamers OnPlayerUpdate would be better, it totally depends on what it's streaming and how it works. With the possibility of it being called over 3000 times a second, personally, I wouldn't use OnPlayerUpdate for anything.
How exactly is YCP_OnPlayerUpdate gonna get called every 3000 seconds?


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - NigNog1 - 10.03.2009

Quote:
Originally Posted by Yaheli
How exactly is YCP_OnPlayerUpdate gonna get called every 3000 seconds?
I didn't say YCP_OnPlayerUpdate would get called more than 3000 times a second, but by changing the define to 1, it will.

Nevermind, I feel like I'm wasting my time.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - MenaceX^ - 10.03.2009

Quote:
Originally Posted by Stevelo
Why not just use a timer? I heared that OnPlayerUpdate gets called about 15 times per second, per player. Imagine a server with 200 players using it.
OnPlayerUpdate gets used when player sends a pack.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 14.03.2009

Update!
Added SetPlayerStreamCheckpoint and DestroyPlayerStreamCheckpoint - creates a streamed checkpoint for only one player.

Link updated.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - smoker08 - 28.03.2009

nvm, nice script.


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Emrets61 - 30.03.2009

I want on you INC to example. But i dont know.

Example:

Code:
new lspark;
new caligulas;
new fourdragons;
Code:
lspark = SetPlayerCheckpoint(playerid, 1277.8204,-2039.3345,59.0079, 3.0); // Los Santos Parkı
caligulas = SetPlayerCheckpoint(playerid, 2159.1150,1680.2651,10.6953, 3.0); // Caligula's Gazinosu
fourdragons = SetPlayerCheckpoint(playerid, 2040.9434,1007.0724,10.6719, 3.0); // Four Dragon's Gazinosu
Code:
if(checkpoint == lspark)
{
	GivePlayerWeapon(playerid,31,500);
}
if(checkpoint == caligulas)
{
	GivePlayerWeapon(playerid,37,500);
}
if(checkpoint == fourdragons)
{
	GivePlayerWeapon(playerid,35,500);
}
Help...

My English is Bad...


Re: [INC]YCP - Yaheli's Checkpoint Streamer - OnPlayerUpdate CP Streamer! - Yaheli_Faro - 30.03.2009

switch checkpoint with checkpointid?