AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me fix this plugin. (https://forums.alliedmods.net/showthread.php?t=204434)

ghostpro1991 12-30-2012 10:16

Help me fix this plugin.
 
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 :cry:
I don't know what is my mistake :shock:

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)



YamiKaitou 12-30-2012 11:59

Re: Help me fix this plugin.
 
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

ghostpro1991 12-30-2012 13:50

Re: Help me fix this plugin.
 
Can you make an example for me :(

YamiKaitou 12-30-2012 13:57

Re: Help me fix this plugin.
 
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);



ghostpro1991 12-30-2012 14:25

Re: Help me fix this plugin.
 
thanks, works perfectly.


All times are GMT -4. The time now is 13:30.

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