AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_putinserver don't called (https://forums.alliedmods.net/showthread.php?t=215393)

Armyw0w 05-07-2013 10:29

client_putinserver don't called
 
Hi i have:

PHP Code:

#include <amxmodx>
#include <colorchat>

#define PLUGIN "ARMY_ENGINE"
#define VERSION "1.0"
#define AUTHOR "PAWN++ Team"


public plugin_init() {
    
register_plugin PLUGINVERSIONAUTHOR );
}

public 
client_putinserver(id)
{
    
console_print(id"[DEBUG]: Debug start");
    new 
szHostname 128 ];
    
get_cvar_string "hostname" szHostname charsmax szHostname ) );
    
ColorChat idGREEN"^x03SERVER:^x01 Bun venit pe ^x03%s^x01."szHostname );
    
console_print(id"[DEBUG]: Debug end");


Why the callback client_putinserver are don't called :(?
I haven't a no-one in console and chat.

Arkshine 05-07-2013 11:02

Re: client_putinserver don't called
 
Is the plugin running ? (amxx list )
How do you test ?

ConnorMcLeod 05-07-2013 11:26

Re: client_putinserver don't called
 
You can't print yet anything to player in putinserver, you have to delay it a bit or to hook something else.

yan1255 05-07-2013 12:39

Re: client_putinserver don't called
 
Use set_task to delay the command...
I'd delay it for about 2~3 seconds...

ConnorMcLeod 05-07-2013 13:41

Re: client_putinserver don't called
 
Anytime after the function has been passed (means 1 frame or less) should be enough, so a 0.1 task should work.

.Dare Devil. 05-08-2013 19:59

Re: client_putinserver don't called
 
Quote:

Originally Posted by ConnorMcLeod (Post 1947586)
Anytime after the function has been passed (means 1 frame or less) should be enough, so a 0.1 task should work.

what is less than 1, 0 frame or -1 frame? :)

zi443r 05-09-2013 05:20

Re: client_putinserver don't called
 
i think it is something like this
PHP Code:

#include <amxmodx> 
#include <colorchat> 

#define PLUGIN "ARMY_ENGINE" 
#define VERSION "1.0" 
#define AUTHOR "PAWN++ Team" 


public plugin_init() { 
    
register_plugin PLUGINVERSIONAUTHOR ); 


public 
client_putinserver(id)
{
    
set_task(0.1,"welcome",id)
}



public 
welcome(id

    
console_print(id"[DEBUG]: Debug start"); 
    new 
szHostname 128 ]; 
    
get_cvar_string "hostname" szHostname charsmax szHostname ) ); 
    
ColorChat idGREEN"^x03SERVER:^x01 Bun venit pe ^x03%s^x01."szHostname ); 
    
console_print(id"[DEBUG]: Debug end"); 



ConnorMcLeod 05-09-2013 05:43

Re: client_putinserver don't called
 
Quote:

Originally Posted by .Dare Devil. (Post 1948449)
what is less than 1, 0 frame or -1 frame? :)

Same frame but anything out of ClientPutInServer function, like this :

register_logevent("LogEvent_EnteredTheGame", 2, "1=entered the game");

It is called in CHalfLifeMultiplay::InitHUD, so i think the frame after ClientPutInServer.
Dunno if something can be hooked in the same frame, anyway, is not the point.


All times are GMT -4. The time now is 10:53.

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