Raised This Month: $ Target: $400
 0% 

Change the map and kick all clients


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 07-04-2006 , 11:36   Re: Change the map and kick all clients
Reply With Quote #6

I'm amazed by the thing I said in new plugins and people posting when they have no clue at all what they're talking about.

Code:
/* Kick all clients by eRik */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Kick All Clients" #define VERSION "0.1" #define AUTHOR "eRik" #define REASON "Mapchanging..." new g_pMap public plugin_init() {       register_plugin(PLUGIN, VERSION, AUTHOR)           register_concmd("amx_kickall","kick_all",ADMIN_KICK,"Kick all clients")         g_pMap = register_cvar("mapname","de_dust2") } // must be public if you call it like this public kick_all(reason[]) {       // because it can only be used once, might as well make it new     new iPlayers[32],iPlayersnum     get_players(iPlayers,iPlayersnum)           for(new iCount;iCount < iPlayersnum;iCount++)           server_cmd("kick #%d %s",get_user_userid(iPlayers[iCount]),REASON)           changemap()         // you don't need to return PLUGIN_HANDLED everywhere, in fact in most cases it might     // screw up your script } // doesn't have to be public, it's called internally (wtf was up with the set_task?) changemap() {     new szMap[33]     get_pcvar_string(g_pMap,szMap,32)         if(is_map_valid(szMap))         server_cmd("changelevel %s",szMap)     else     {         log_amx("Error: map specified not valid, defaulting to de_dust2")             server_cmd("changelevel de_dust2")     } }
__________________

Last edited by Hawk552; 07-04-2006 at 11:39. Reason: the leprechauns did it
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 08:00.


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