Raised This Month: $ Target: $400
 0% 

optimize the code ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-21-2011 , 14:30   Re: optimize the code ?
Reply With Quote #4

You are in scripting help, assuming you already know few things.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

#define XO_PLAYER 5
#define m_iRadiosLeft 192
#define OFFSET_DEFUSE_PLANT_LoL 193
#define m_iMenuCode 205
const SILENT_RADIO = (1<<0)

#define Team_Select 1

public plugin_init()
{
    
register_plugin("Misc Blocks"VERSION"ConnorMcLeod")
    
    
register_clcmd("radio1""ClCmd_MiscCmdBlock")
    
register_clcmd("radio2""ClCmd_MiscCmdBlock")
    
register_clcmd("radio3""ClCmd_MiscCmdBlock")
    
register_clcmd("chooseteam""ClCmd_MiscCmdBlock")
    
register_clcmd("drop""ClCmd_MiscCmdBlock")
    
register_clcmd("jointeam""ClCmd_JoinTeam")
    
register_clcmd("ignorerad""ClCmd_MiscCmdBlock")
    
register_clcmd("menuselect""ClCmd_MenuSelect")
    
    
RegisterHam(Ham_Spawn"player""CBasePlayer_Spawn_Post"true)
}

public 
CBasePlayer_Spawn_Postid )
{
    if( 
is_user_alive(id) )
    {
        
set_pdata_int(idm_iRadiosLeft0XO_PLAYER)
        
set_pdata_int(idOFFSET_DEFUSE_PLANT_LoLget_pdata_int(idOFFSET_DEFUSE_PLANT_LoLXO_PLAYER) | SILENT_RADIOXO_PLAYER)
    }
}

public 
ClCmd_MiscCmdBlock(id)
{
    return 
PLUGIN_HANDLED
}

public 
ClCmd_JoinTeamid )
{
    return ( 
CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT )
}

public 
ClCmd_MenuSelectid )
{
    if( 
get_pdata_int(idm_iMenuCodeXO_PLAYER) == Team_Select )
    {
        new 
szArg[3]
        if( 
read_argv(1szArgcharsmax(szArg)) == )
        {
            return (( 
<= str_to_num(szArg) <= ) && ( CS_TEAM_T <= cs_get_user_team(id) <= CS_TEAM_CT ))
        }
    }
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 19:55.


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