WiKi Examples - Moderation?!
#7

Quote:
Originally Posted by Kyosaur!!
Quote:
Originally Posted by dice7
Pawn, as you mentioned, is static so variable creation starts at compile time, not run time, so you never use up more then those 720 bytes. And OnPlayerUpdate was introduced especially for creating custom accurate callbacks like that, why else would you possibly need it ? You have timers for tick functions and GetTickCount() for accurate time tests, etc.. And run a few test in term of memory usage and amx size, when dealing with local and global variables
nice way of putting it. I have a custom OnVirtualWorldChange callback that is pretty much coded the same as the article in question (well, what i mean is i create a variable / assign a value to said variable under OnPlayerUpdate), and i never thought twice about it as i'm content with using a SUPER small amount of ram (we're not even talking about 1kb lol) in order to accurately tell when a player is switching vw / have complete control over it; as vw is a big part of my server.

well, you actually could make that thing even without OnPlayerUpdate, as you just need to call the "OnVirtualWorldChange" if the players is set into a new virtual world, which MUST be done via "SetPlayerVirtualWorld", right?

So you could just make a thing like this:
pawn Код:
#define SetVirtualWorld(%1,%2) SetPlayerVirtualWorld(%1,%2); SetPVarInt(%1,"vworld",%2); OnVirtualWorldChange(%1,%2)

public OnVirtualWorldChange(playerid, virtualworld) {
// etc
}
Now you would just need to replace each "SetPlayerVirtualWorld" (except the one in the definition lol) with "SetVirtualWorld".
Reply


Messages In This Thread
WiKi Examples - Moderation?! - by theRealG - 11.05.2010, 23:13
Re: WiKi Examples - Moderation?! - by Simon - 12.05.2010, 09:24
Re: WiKi Examples - Moderation?! - by XRVX - 12.05.2010, 09:28
Re: WiKi Examples - Moderation?! - by theRealG - 12.05.2010, 11:58
Re: WiKi Examples - Moderation?! - by dice7 - 12.05.2010, 13:28
Re: WiKi Examples - Moderation?! - by Kyosaur - 12.05.2010, 18:11
Re: WiKi Examples - Moderation?! - by [XAC]Klinsen - 13.05.2010, 19:36
Re: WiKi Examples - Moderation?! - by Sergei - 13.05.2010, 19:53
Re: WiKi Examples - Moderation?! - by Kyosaur - 14.05.2010, 22:18
Re: WiKi Examples - Moderation?! - by jackofbladesmah - 19.05.2010, 14:22

Forum Jump:


Users browsing this thread: 1 Guest(s)