Raised This Month: $ Target: $400
 0% 

say commands - almost complete


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shnxiyahu
Member
Join Date: Jun 2010
Old 12-16-2010 , 12:56   say commands - almost complete
Reply With Quote #1

*credit to Mxnn for the code

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

#define PLUGIN "SayCommands"
#define VERSION "1.0"
#define AUTHOR "Mxnn"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say !rr""FuncStart"ADMIN_CVAR)
    
register_clcmd("say !mr15""FuncRes1"ADMIN_CVAR)
    
register_clcmd("say !prac""Prac"ADMIN_CVAR)
    
register_clcmd("say !rates""Rates"ADMIN_CVAR)
    
register_clcmd("say !map1""FuncChMap"ADMIN_CVAR)
    
register_clcmd("say !map2""FuncChMap2"ADMIN_CVAR)
    
register_clcmd("say !map3""FuncChMap3"ADMIN_CVAR)
    
register_clcmd("say !ffon""FuncFriendlyF"ADMIN_CVAR)
    
register_clcmd("say !ffoff""FuncFriendlyF"ADMIN_CVAR)
    
register_clcmd("say !bant""FuncBanT"ADMIN_CVAR)
    
register_clcmd("say !banct""FuncBanCT"ADMIN_CVAR)
    
register_clcmd("say !pass""FuncPass"ADMIN_CVAR)
    
register_clcmd("say !nopass""FuncPass"ADMIN_CVAR)

}

public 
FuncBanCT(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
new iPlayers[32], iNumi

    get_players
(iPlayersiNum)
    for(
i=0i<iNumi++)
    {
        if (
cs_get_user_team(iPlayers[i]) == CS_TEAM_CT)
            
server_cmd("banid #%d 0"i)
    }
 
    return 
PLUGIN_HANDLED
}
public 
FuncBanT(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
new iPlayers[32], iNumi

    get_players
(iPlayersiNum)
    for(
i=0i<iNumi++)
    {
        if (
cs_get_user_team(iPlayers[i]) == CS_TEAM_T)
            
server_cmd("banid #%d 0"i)
    }

    return 
PLUGIN_HANDLED
}

public 
FuncStart(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    server_cmd
("sv_restart 1")
   
    
    return 
PLUGIN_HANDLED
}

public 
FuncRes1(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
        
    server_cmd
("mp_friendlyfire 1")
    
server_cmd("mp_roundtime 1.75")
    
server_cmd("mp_limitteams 0")
    
server_cmd("mp_tkpunish 0")  
    
server_cmd("mp_autokick 0")
    
server_cmd("mp_autoteambalance 0")    
    
server_cmd("mp_c4timer 35")
    
server_cmd("mp_freezetime 9 ")
    
server_cmd("sv_alltalk 0")   
    
server_cmd("mp_startmoney 800")
    
server_cmd("mp_buytime 0.15")
    
server_cmd("mp_forcecamera 2")
    
server_cmd("mp_forcechasecam 2")
    
server_cmd("sv_restart 1")
    
    return 
PLUGIN_HANDLED
}

public 
Prac(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
        
    server_cmd
("mp_friendlyfire 0")
    
server_cmd("mp_roundtime 5")
    
server_cmd("mp_limitteams 0")
    
server_cmd("mp_tkpunish 0")  
    
server_cmd("mp_autokick 0")
    
server_cmd("mp_autoteambalance 0")    
    
server_cmd("mp_c4timer 35")
    
server_cmd("mp_freezetime 0")
    
server_cmd("sv_alltalk 0")   
    
server_cmd("mp_startmoney 16000")
    
server_cmd("mp_buytime 5")
    
server_cmd("mmp_forcecamera 0")
    
server_cmd("mp_forcechasecam 0")
    
server_cmd("sv_restart 1")
    
    return 
PLUGIN_HANDLED
}

public 
Rates(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
        
    server_cmd
("sv_maxrate 30250")
    
server_cmd("sv_minrate 25000")
    
server_cmd("sv_maxupdaterate 100")
    
server_cmd("sv_minupdaterate 90")
    
server_cmd("sys_ticrate 10000")
    
server_cmd("fps_max 101")
    
server_cmd("sv_maxspeed 320")
    
server_cmd("edgefriction 2")
    
server_cmd("sv_region 6")
    
server_cmd("sv_clienttrace 1.0")
    
server_cmd("restart")
    
    return 
PLUGIN_HANDLED
}

public 
FuncChMap(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    server_cmd
("changelevel de_dust2")
    
    return 
PLUGIN_HANDLED
}

public 
FuncChMap2(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    server_cmd
("changelevel de_inferno")
    
    
    return 
PLUGIN_HANDLED
}

public 
FuncChMap3(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    server_cmd
("changelevel de_nuke")
    
    return 
PLUGIN_HANDLED
}



public 
FuncFriendlyF(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
if ( (get_cvar_num("mp_friendlyfire")) == 0)
    
server_cmd("mp_friendlyfire 1")
    else
    
server_cmd("mp_friendlyfire 0")
    
    return 
PLUGIN_HANDLED
}

public 
FuncPass(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED
    
    
new password[32]
    
get_cvar_string("sv_password"password31)
    
    if (
equal(password""))
    
server_cmd("sv_password ^"123^"")
    else
    
server_cmd("sv_password ^"^"")
    
    return 
PLUGIN_HANDLED

The problem is, if i want to do this :

Quote:
!kick PLAYER
Quote:
[SERVER] %s has been kicked by %s
-I can't, so, someone know how to do this with the code ?

Last edited by shnxiyahu; 12-16-2010 at 12:58.
shnxiyahu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-16-2010 , 14:12   Re: say commands - almost complete
Reply With Quote #2

You have to hook the "say" command and parse it for the arguments.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shnxiyahu
Member
Join Date: Jun 2010
Old 12-16-2010 , 14:35   Re: say commands - almost complete
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
You have to hook the "say" command and parse it for the arguments.
Don't know how to do this
Can you do this for me ?
shnxiyahu is offline
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 01:35.


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