Raised This Month: $ Target: $400
 0% 

User can change map ;-) but i need help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grifter
Junior Member
Join Date: Aug 2006
Old 04-16-2007 , 03:18   User can change map ;-) but i need help
Reply With Quote #1

Code:
#include <amxmodx>
#include <amxmisc>

new minimumwait=1

public cm(id) {
 new timeleft = get_timeleft()
 new ziom[32]
 get_user_name(id,ziom,31)
 new Float:minutesleft=float(timeleft)/60.0
 new Float:currentlimit=get_cvar_float("mp_timelimit")
 new Float:minutesplayed=currentlimit-minutesleft
 new wait
 wait=minimumwait

 if (get_playersnum() > 2)
  {
   return PLUGIN_CONTINUE
  }

 if((minutesplayed+0.5)<(float(wait)))
   {
      if(float(wait)-0.5-minutesplayed>0.0)
         client_print(id,print_chat,"%s, You must wait %d min",
            ziom,(floatround(float(wait)+0.5-minutesplayed)>0)?(floatround(float(wait)+0.5-minutesplayed)):(1))
      else
         client_print(id,print_chat,"Less than 60 sec")
      if ((get_user_flags(id)&ADMIN_MAP))
         console_print(id,"%s, You are admin ;-)",ziom)
      return PLUGIN_CONTINUE
   }

 server_cmd("amx_map de_dust2")
 return PLUGIN_CONTINUE
}


public plugin_init() {

    register_plugin("changemaps by user","0.1beta","Grifter")
    register_clcmd("say /changemap","cm",0,"- changemap to de_dust2")
}
i wrote this, some code are from deagsmapmanage230b ;-)

and everything work, but i dont know how to do something like that:

say /changemap map_name
so user can change to any map not only one map defined on source ;-)
grifter is offline
Dark Kingdom
BANNED
Join Date: Apr 2007
Location: VT
Old 04-16-2007 , 08:08   Re: User can change map ;-) but i need help
Reply With Quote #2

PHP Code:
register_clcmd("say /changemap""map_change"); 
Dark Kingdom is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 04-16-2007 , 08:23   Re: User can change map ;-) but i need help
Reply With Quote #3

Quote:
Originally Posted by Dark Kingdom View Post
PHP Code:
register_clcmd("say /changemap""map_change"); 
Well that's not gonna help him...
Code:
public change_map(id) {      new arg[34]      read_argv(1,arg,32)      if(equali(arg,"")) {            // Do stuff, if needed.            return PLUGIN_HANDLED      }      new mapname[35]      formatex(mapname,34,"%s",arg)      server_cmd(mapname);      return PLUGIN_HANDLED }
This will obviously allow anyone to use the command, and I don't think it's needed to format the "mapname" string, but whatever.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Reply



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 06:45.


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