AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I am looking for an event :) (player finished loading?) (https://forums.alliedmods.net/showthread.php?t=161900)

sake 07-12-2011 14:59

I am looking for an event :) (player finished loading?)
 
Hello there,

I've been searching for hours now, but I don't get it. Is there an event I can use in order to distinguish if a player is done loading the game (-> Spec-Mode)? I've already seen a (not so satisfying) event (via HamSandwich) by which I can listen for round-restarting. But that's not what I want.

Can you help me? Thanks in advance!

sake

01101101 07-12-2011 15:31

Re: I am looking for an event :) (player finished loading?)
 
MOTD maybe?

sake 07-12-2011 15:57

Re: I am looking for an event :) (player finished loading?)
 
Found another solution. Sound after first respawn with short delay. But thanks anyways.

PHP Code:

#include <amxmodx>
#include <amxmisc>
#define VERSION "1.0"

new names[32][18]

public 
plugin_init()
{
    
register_plugin("chi"VERSION"sake")
    
register_event("ResetHUD""greetings""be")
}

public 
greetings(id)
{
    new 
name[18
    
get_user_name(idname17)
    for(new 
031i++)
    {
        if(
strcmp(name,names[i],18) == 0)
        {
            return 
PLUGIN_CONTINUE
        
}
    }
    
set_task(0.2"dummy"id)
    if(
strcmp(name,"C.h.i",5) == 0)
    {
        
names[id] = "C.h.i"
        
client_cmd(0"spk jnr/chi.wav")
        
show_hudmessage(0,"Hallo, ich bin der C.h.i vom Teamspeak!")
    }
    else
    {
        
names[id] = name
        
new message[] = "Welcome on the Server, "
        
strcat(message,name,100)
        
strcat(message,"! Play fair!",112)
        
show_hudmessage(0,message)
    }
    return 
PLUGIN_CONTINUE
}

public 
client_disconnect(id)
{
    
names[id] = ""
    
return PLUGIN_CONTINUE
}

public 
dummy(id)
{
    return 
PLUGIN_CONTINUE



Hunter-Digital 07-12-2011 17:23

Re: I am looking for an event :) (player finished loading?)
 
client_putinserver() ? It triggers right after player finished loading.

Tirant 07-12-2011 17:52

Re: I am looking for an event :) (player finished loading?)
 
client_putinserver(), client_connect(), or even client_authorized() should be what you want. Else, you could use the message TeamInfo, which is when a team is chosen. There's also ShowMenu and VGUIMenu which are the actual displaying of the menus for choosing a team.

sake 07-12-2011 18:13

Re: I am looking for an event :) (player finished loading?)
 
I've tried client_connect and putinserver and they didn't work.

How do I have to subscribe to the others? (register_event)?

fysiks 07-12-2011 18:26

Re: I am looking for an event :) (player finished loading?)
 
Quote:

Originally Posted by sake (Post 1509447)
I've tried client_connect and putinserver and they didn't work.

How do I have to subscribe to the others? (register_event)?

Explain what you are trying to do in detail.


All times are GMT -4. The time now is 01:11.

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