Move player to spectator.
I was just messing around and I thought of writing a plugin that would move a player to spectator if maybe they were afk and didn't want to kick them. I was wondering if you anyone might have some suggestions to improve my script. I it works fine on my server (linux fc6) but any thoughts would be great.
Code:
|
Re: Move player to spectator.
I'm pretty sure there are a few plugins that already do this
And when posting code, use [php] tags instead of [code] tags |
Re: Move player to spectator.
Quote:
|
Re: Move player to spectator.
Quite concisely written and to the point. Doesn't seem to be any improvements I can think of. I've never used cmd_target() so it seems that having get_user_userid() afterward is redundant, but like I said I've never used it before - it might return something else - if it works, it works.
And M249, you can use the [small] tag for the real coding tag ;) |
Re: Move player to spectator.
Quote:
|
Re: Move player to spectator.
Quote:
Wilson, What do you use instead of cmd_target()? Thanks for your thoughts. |
Re: Move player to spectator.
The only time I've ever needed to get a username's userid, I used:
new id = get_user_index(szUsername); |
Re: Move player to spectator.
Sup fysiks? There's many ways to skin a cat (personally, I like pliers). Here's a couple things...
This code in your plugin isn't used anywhere else. Thus, unnecessary. Code:
If you use the 'engclient_cmd' function, you don't need the 'dodfun' module. So instead of this... Code:
Code:
Code:
Code:
Here's an example of a super simple 'move-to-spectator' plugin for DOD. Code:
/* |
Re: Move player to spectator.
Code:
|
Re: Move player to spectator.
lol ?! that are cs client commands. Just look in cs...
|
| All times are GMT -4. The time now is 16:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.