Why does my code not work? CS 1.6
Okay so I'm making a small plugin called Welcome Message :3
I'm a beginner so what does the plugin do is when a player joins a server public client_connect(id) it will print a message in chat "Welcome to the server blah blah blah" but in color! The thing is when I open cs and test it nothing happens! :nono: PHP Code:
|
Re: Why does my code not work? CS 1.6
Try use client_putinserver(id) using a task, instead of just client_connect. Is very good for start to see others well codes plugins. Then see also: Welcome message plugin ? and https://www.google.com/#q=welcome message amx mod x site:forums.alliedmods.net
|
Re: Why does my code not work? CS 1.6
client_putinserver() won't work reliably (because it will be behind all the CS menus and likely disappear before you get on a team). You need to set a task in client_putinserver() to wait a few seconds at least if you want that player to see it.
|
Re: Why does my code not work? CS 1.6
|
Re: Why does my code not work? CS 1.6
PHP Code:
|
Re: Why does my code not work? CS 1.6
Quote:
And you should check if task exists so it would be will exactly at 8 seconds. This code is correct: PHP Code:
|
Re: Why does my code not work? CS 1.6
Stop using words like"WTF" on this forum. Keeping things classy won't hurt anyone.
Also, would it not be better to remove task on client_disconnect than checking on new connect, if the task exists? |
Re: Why does my code not work? CS 1.6
Quote:
|
Re: Why does my code not work? CS 1.6
PHP Code:
|
Re: Why does my code not work? CS 1.6
Quote:
|
| All times are GMT -4. The time now is 09:25. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.