AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   I made one plugin but.. (https://forums.alliedmods.net/showthread.php?t=57986)

Mrrr 07-16-2007 09:58

I made one plugin but..
 
Hello :)

I made this plugin:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("say /command", "server_command", ADMIN_ALL, "something here")
}
public server_command(id)
{
client_print(id, print_chat, "*************** something ***************")
client_print(id, print_chat, "something here")
client_print(id, print_chat, "*************** something ***************")
return PLUGIN_HANDLED
}
public playerconnect(id)
{
client_print(id, print_chat, "*************** something ***************")
client_print(id, print_chat, "something here")
client_print(id, print_chat, "*************** something ***************")
}

public client_putinserver(id) {
new name[32];
get_user_name(id,name,31)
server_cmd("say player %s is connecting",name)
}

But when i or other people connect, it doesn't display anything else except "player NICKNAME_HERE is connecting"

Yes.. the command: /command WORKS, but the public playerconnect(id) doesnt

Can you tell me why, and how i can fix it ?

Thanks
Regards

Alka 07-16-2007 10:03

Re: I made one plugin but..
 
1.is public client_connect(id) !
2.You can't print a message to a player when connect because is not in game! You can print to all a message when someone connect using '0' instead 'id'

Mrrr 07-16-2007 10:43

Re: I made one plugin but..
 
Okey, i changed playerconnect(id) to client_connect(id)

But it doesn't display the text in private when a player is connected.
(I want when a player is connected in server, and he is choose a team, server to display to him a messages)

Quote:

You can't print a message to a player when connect because is not in game! You can print to all a message when someone connect using '0' instead 'id'
It doesn't metter, because the message in public client_putinserver must be displayed to all peoples (and it works).

-----------------------------------------

When i tryed again with your suggestion (to replace playerconnect(id) with client_connect(id)) it doesn't work again.

Just nothing is displayed.
Everything else is working except this. :/

sorry for my bad english :oops:

Thanks
Regards,
Mrrr

Alka 07-16-2007 10:48

Re: I made one plugin but..
 
Man! When player is connecting you CAN'T print him a message! Maybe do a task!

Code:

public client_connect(id)
{
    set_task(15.0,"print_something",id);
}
 
public print_something(id)
{
    client_print(id, print_chat, "*************** something ***************")
    client_print(id, print_chat, "something here")
    client_print(id, print_chat, "*************** something ***************")
}

15 seconds ater player is connecting, will show him that message!

Greenberet 07-16-2007 11:23

Re: I made one plugin but..
 
Quote:

Originally Posted by Alka (Post 503997)
Man! When player is connecting you CAN'T print him a message! Maybe do a task!

Code:

public client_connect(id)
{
    set_task(15.0,"print_something",id);
}
 
public print_something(id)
{
    client_print(id, print_chat, "*************** something ***************")
    client_print(id, print_chat, "something here")
    client_print(id, print_chat, "*************** something ***************")
}

15 seconds ater player is connecting, will show him that message!

what about
client_print( id, print_console, "BLA" ); in client_connect ?

Alka 07-16-2007 11:29

Re: I made one plugin but..
 
Hum...maybe! or client_cmd(id,"echo ^"BLAH^") ! :)

Mrrr 07-17-2007 09:20

Re: I made one plugin but..
 
Hm.. somethings wrong.. i made that you told me, but nothing is displayed.. :/

I made: client_cmd(id,"echo ^"BLAH^") - the same result :/

Quote:

what about
client_print( id, print_console, "BLA" ); in client_connect ?
I want to display in chat, not in console

----------------------------------

Here is the plugin on this stage:

Quote:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "plugin"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("say /command", "some_command", ADMIN_ALL, "some text")
}
public some_command(id)
{
client_print(id, print_chat, "*************** text ***************")
client_print(id, print_chat, "text")
client_print(id, print_chat, "text")
client_print(id, print_chat, "text")
client_print(id, print_chat, "*************** text ***************")
return PLUGIN_HANDLED
}

public client_putinserver(id) {
new name[32];
get_user_name(id,name,31)
server_cmd("say player with %s is connecting",name)
}

public client_connect(id)
{
client_cmd(id,"echo ^"BLAH^")
}
What is wrong ?

Can you fix it ? :( :(


All times are GMT -4. The time now is 21:34.

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