Raised This Month: $32 Target: $400
 8% 

[Help] ~ Change map plug-in


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 03-20-2015 , 15:39   [Help] ~ Change map plug-in
Reply With Quote #1

Hello everyone,

I tryed to make plugin when admin type: amx_map "map name", then server change map in 5 seconds... But plugin have errors..

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Change map"
#define VERSION "1.0"
#define AUTHOR "BaD CopY"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_concmd("amx_map""cmd_map"ADMIN_MAP"<mapname>")
}

public 
cmd_map(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
    {
        return 
PLUGIN_HANDLED
    
}
    
    new 
arg[32]
    new 
arglen read_argv(1arg31)
    
    if (!
is_map_valid(arg))
    {
        
console_print(id"Map not found")
        return 
PLUGIN_HANDLED
    
}
    
    new 
authid[32], name[32]
    
    
get_user_authid(idauthid31)
    
get_user_name(idname31)
    
    new 
_modName[10]
    
get_modname(_modName9)
    
    if (!
equal(_modName"zp"))
    {
        
message_begin(MSG_ALLSVC_INTERMISSION)
        
message_end()
    }
    
    
set_task(7.0"chMap1"0)
    
    
ColorChat(0GREEN" Map change in^3 5 seconds.")
    
    return 
PLUGIN_HANDLED
}

public 
chMap1(id)
{
    new 
arg[32]
    new 
arglen read_argv(1arg31)
    
    
set_task(2.0"chMap"0argarglen 1)
}

public 
chMap(map[])
{
    
server_cmd("changelevel %s"map)

So, I want when admin type: amx_map "map name", all players to be freezed 5 seconds. After 5 seconds, all players will see scoreboard and map will be changed in 2 sec.

My plugin show scoreboard 5 seconds and then server crashed... )
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Albanian Zombie
Senior Member
Join Date: May 2013
Location: void
Old 03-20-2015 , 15:59   Re: [Help] ~ Change map plug-in
Reply With Quote #2

There is a "amx_map" command that AMX has by default. There are plugins that make the thing you requested, just search.
Here
Albanian Zombie is offline
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 03-21-2015 , 03:22   Re: [Help] ~ Change map plug-in
Reply With Quote #3

I know it's default but I want to remove default (admincmd.amxx). See my request again!
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
Reply


Thread Tools
Display Modes

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 15:30.


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