Raised This Month: $ Target: $400
 0% 

Move player to spectator.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-07-2007 , 21:20   Move player to spectator.
Reply With Quote #1

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:
  // Plugin for moving a player to spectator.   #include <amxmodx> #include <amxmisc> #include <dodfun>   #define PLUGIN "mv_spec" #define VERSION "1.0" #define AUTHOR "Fysiks"   public plugin_init() {   register_plugin(PLUGIN,VERSION,AUTHOR)   register_concmd("admin_spec", "cmdMvSpec", ADMIN_KICK, "<player> - Moves player to spectator.") }   public cmdMvSpec(id, level, cid) {   if (!cmd_access(id, level, cid, 2))     return PLUGIN_HANDLED     new arg[32]   read_argv(1, arg, 31)   new player = cmd_target(id, arg, 2)     if (!player)     return PLUGIN_HANDLED     new authid[32], name[32], userid   get_user_authid(player, authid, 31)   get_user_name(player, name, 31)   userid = get_user_userid(player)     new teamname[12]   get_user_team(player, teamname, 11)     if (is_user_bot(player))  {    console_print(id, "Kicking a bot is BAD, Action denied.")    return PLUGIN_HANDLED  }     if (teamname[0])   {     dod_set_user_team(player, 3, 1)     return PLUGIN_HANDLED   } else {     console_print(id, "No such player.")     return PLUGIN_HANDLED   } }

Last edited by fysiks; 11-04-2007 at 01:33.
fysiks is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:15.


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