AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED] Which one is called first? (https://forums.alliedmods.net/showthread.php?t=155701)

yokomo 04-25-2011 14:46

[SOLVED] Which one is called first?
 
Hi,
I write a plugin that using:
* HLTV event
* Ham_spawn forward

This is my code:
PHP Code:

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)

    
register_forward(FM_ClientUserInfoChanged"fw_ClientUserInfoChanged")
    
    
g_maxplayers get_maxplayers()


Ok i just want to know which one is called first? "event_round_start" or "fw_PlayerSpawn_Post". So confuse LOL.

SonicSonedit 04-25-2011 14:54

Re: [HELP] Which one is called first?
 
Use this
PHP Code:

public event_round_start()
    
server_print("event_round_start")

public 
fw_PlayerSpawn_Post(id)
    
server_print("fw_PlayerSpawn_Post for player %d"id

and then see by yourself.

yokomo 04-25-2011 15:06

Re: [HELP] Which one is called first?
 
Quote:

Originally Posted by SonicSonedit (Post 1457654)
Use this
PHP Code:

public event_round_start()
    
server_print("event_round_start")

public 
fw_PlayerSpawn_Post(id)
    
server_print("fw_PlayerSpawn_Post for player %d"id

and then see by yourself.

server_print mean? it print in console or?

Neeeeeeeeeel.- 04-25-2011 15:17

Re: [HELP] Which one is called first?
 
Put a print in each fuction and then you see which one is called fist, as sonic said...

ConnorMcLeod 04-25-2011 15:54

Re: [HELP] Which one is called first?
 
HLTV message is sent first, then all players are spawned.

See cs-sdk function CHalfLifeMultiplay::RestartRound()

yokomo 04-25-2011 16:05

Re: [HELP] Which one is called first?
 
Quote:

Originally Posted by ConnorMcLeod (Post 1457704)
HLTV message is sent first, then all players are spawned.

See cs-sdk function CHalfLifeMultiplay::RestartRound()

Nice, finally found a good link to learn. Thanks Connor.

ConnorMcLeod 04-25-2011 16:05

Re: [HELP] Which one is called first?
 
Quote:

Originally Posted by yokomo (Post 1457714)
Nice, finally found a good link to learn. Thanks Connor.

You can thanks arkshine who is spenting hours on decompiling !!

xPaw 04-25-2011 16:32

Re: [HELP] Which one is called first?
 
Quote:

Originally Posted by ConnorMcLeod (Post 1457716)
You can thanks arkshine who is spenting hours on decompiling !!

yet he doesnt update cs-sdk with fresh codes :(

Arkshine 04-25-2011 16:38

Re: [HELP] Which one is called first?
 
I have fresh codes, I need to commit, but I've started to review functions one by one, checking, adding offset used, etc. And I don't want much to commit the mess i've started. I will update ASAP.


All times are GMT -4. The time now is 19:51.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.