Raised This Month: $ Target: $400
 0% 

client_putinserver don't called


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Armyw0w
New Member
Join Date: May 2013
Old 05-07-2013 , 10:29   client_putinserver don't called
Reply With Quote #1

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.
Armyw0w is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-07-2013 , 11:02   Re: client_putinserver don't called
Reply With Quote #2

Is the plugin running ? (amxx list )
How do you test ?
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-07-2013 , 11:26   Re: client_putinserver don't called
Reply With Quote #3

You can't print yet anything to player in putinserver, you have to delay it a bit or to hook something else.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yan1255
Senior Member
Join Date: Jul 2011
Old 05-07-2013 , 12:39   Re: client_putinserver don't called
Reply With Quote #4

Use set_task to delay the command...
I'd delay it for about 2~3 seconds...
__________________
yan1255 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-07-2013 , 13:41   Re: client_putinserver don't called
Reply With Quote #5

Anytime after the function has been passed (means 1 frame or less) should be enough, so a 0.1 task should work.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-07-2013 at 13:42.
ConnorMcLeod is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 05-08-2013 , 19:59   Re: client_putinserver don't called
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
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?
.Dare Devil. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-09-2013 , 05:43   Re: client_putinserver don't called
Reply With Quote #7

Quote:
Originally Posted by .Dare Devil. View Post
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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 05-09-2013 , 05:20   Re: client_putinserver don't called
Reply With Quote #8

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"); 

__________________
zi443r is offline
Old 05-09-2013, 07:07
Isulu
This message has been deleted by Arkshine. Reason: Spambot
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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