Raised This Month: $ Target: $400
 0% 

Help me fix this plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostpro1991
Member
Join Date: Aug 2011
Old 12-30-2012 , 10:16   Help me fix this plugin.
Reply With Quote #1

I'm a newbie and trying to code a simple plugin.
Unfortunately, it doesn't work with client_print, but worked properly with server_print
I don't know what is my mistake

PHP Code:
#include <amxmodx> 
public plugin_init()
{
register_plugin("Welcome Message""1.0""Test123")
}
public 
client_connect(id)
{
new 
ten_player[128]
get_user_name(idten_player127
client_print(idprint_chat"Welcome %s to our Server"ten_player)

ghostpro1991 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-30-2012 , 11:59   Re: Help me fix this plugin.
Reply With Quote #2

It works just fine, the player just isn't able to see it as he is not in the server yet. Use client_putinserver and a task
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ghostpro1991
Member
Join Date: Aug 2011
Old 12-30-2012 , 13:50   Re: Help me fix this plugin.
Reply With Quote #3

Can you make an example for me
ghostpro1991 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-30-2012 , 13:57   Re: Help me fix this plugin.
Reply With Quote #4

PHP Code:
public client_putinserver(id)
    
set_task(5.0"welcomeMsg"id);

public 
welcomeMsg(id)
{
    new 
szName[32];
    
get_user_name(idszNamecharsmax(szName));
    
client_print(idprint_chat"Welcome to our server %s"szName);

__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 12-30-2012 at 13:57.
YamiKaitou is offline
ghostpro1991
Member
Join Date: Aug 2011
Old 12-30-2012 , 14:25   Re: Help me fix this plugin.
Reply With Quote #5

thanks, works perfectly.
ghostpro1991 is offline
Reply


Thread Tools
Display Modes

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 13:30.


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