AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_print (https://forums.alliedmods.net/showthread.php?t=2529)

Trumpet_Rhapsody 06-07-2004 18:03

client_print
 
2 Attachment(s)
I am having TONS of trouble getting my client_print command to work. I'm a newbie to coding so I don't know much. All I've learned i've learned by reading other plugin's code and making assumptions. I'm making a plugin to display a help file, and it works perfectly except the client_print command that I want to run when a user joins the server. I'll attach my code just for refrence, but the specific code:

public display_info( id ){
if (id) {
client_print(id,print_chat,"Server Plugins: Say /pluginhelp for Client help on using the server's Plugins")
client_print(id,print_chat,"Server Plugins: Say /pluginAhelp for Admin help on using the server's Plugins")
}
}

This is placed right after the public plugin_init() section (do i need PLUGIN CONTINUE somewhere maybe?). I've tried variations of the client_print command that i've seen in other plugins but to no avail. Please if anyone has any idea what is going on here help me!

Girthesniper 06-07-2004 18:56

Might wana try some spaces in there.

karlos 06-07-2004 19:06

it does show your client print text cause your function display_info is not called, if u want your print to be displayed to a player just after connect use
Code:
public client_connect(id){   client_print(...) }

client_connect is automaticlly called when player connects, when u make own function u have to call them somewhere in your code

Trumpet_Rhapsody 06-07-2004 19:40

Hmm makes sense. Still don't think it works though.

public client_connect(id){
client_print(id,print_chat,"Server Plugins: Say /pluginhelp for Client help on using the server's Plugins")
client_print(id,print_chat,"Server Plugins: Say /pluginAhelp for Admin help on using the server's Plugins")
}

That should work then right? Or should it be client_print(0,print_chat,"etc")

Peli 06-07-2004 19:43

If your using :
Code:
public client_connect(id)
Then you will have to use :
Code:
client_print(0,print_chat,"message")
Good luck. :)

SidLuke 06-07-2004 20:22

Quote:

Originally Posted by Trumpet_Rhapsody
Hmm makes sense. Still don't think it works though.

public client_connect(id){
client_print(id,print_chat,"Server Plugins: Say /pluginhelp for Client help on using the server's Plugins")
client_print(id,print_chat,"Server Plugins: Say /pluginAhelp for Admin help on using the server's Plugins")
}

That should work then right? Or should it be client_print(0,print_chat,"etc")

chat ? you don't have chat when not in server.
Use
Code:
public client_putinserver(id){     client_print(id,print_chat,"Server Plugins: Say /pluginhelp for Client help on using the server's Plugins")     client_print(id,print_chat,"Server Plugins: Say /pluginAhelp for Admin help on using the server's Plugins") }
or
Code:
public client_connect(id){     client_print(id,print_console,"Server Plugins: Say /pluginhelp for Client help on using the server's Plugins")     client_print(id,print_console,"Server Plugins: Say /pluginAhelp for Admin help on using the server's Plugins") }

devicenull 06-07-2004 20:23

NO!
You need to wait maybe 30 seconds after client connect

ts2do 06-07-2004 20:24

ya how bout just using putinserver

SidLuke 06-07-2004 20:26

:D you are very funny :lol:

Trumpet_Rhapsody 06-07-2004 20:53

How do I have it wait 30 or so seconds? Basically what I'm trying to do is the same thing that happens in AMX mod when you enter a server. It says "For AMX Mod Help type /help" or something like that. What do I need to do to do that? ( for public client_putinserver wouldn't I have to call it somewhere, and if so how?) Somebody spoon-feed me this please, lol I told you I'm a noob at scripting.


All times are GMT -4. The time now is 14:55.

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