Raised This Month: $ Target: $400
 0% 

Correct the code pls


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
lazarev
Veteran Member
Join Date: Sep 2008
Old 10-26-2009 , 14:26   Re: Correct the code pls
Reply With Quote #3

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

#define PLUGIN "Unstoppable"
#define VERSION "1.0"
#define AUTHOR "DoviuX"

/*================================================================================
 [Customization]
=================================================================================*/
new const gIsUnstoppable[][] = { 
    
"sound/Unstoppable1.wav",
    
"sound/Unstoppable2.wav",
    
"sound/Unstoppable3.wav"
}

new const 
gNoMoney[] = "sound/NoMoney.wav"

/*================================================================================
 [New Variables]
=================================================================================*/
//Unstoppable stuff...
new price
new health
new armor

/*================================================================================
 [Init and Precache]
=================================================================================*/

public plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
register_clcmd"say /unst""CmdUnstoppable" )
    
register_clcmd"say_team /unst""CmdUnstoppable" )

    
price register_cvar"un_unstoppable""16000" )
    
health register_cvar"un_health""1000" )
    
armor register_cvar"un_armor""300" )
}

public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir32 ]
    
get_configsdircfgdircharsmaxcfgdir ) )

    
// Execute config file (Unstoppable.cfg)
    
server_cmd"exec %s/Unstoppable.cfg"cfgdir )
}

/*================================================================================
 [Plugin Start]
=================================================================================*/

public plugin_precache()
{    
        for( new 
0sizeof gIsUnstoppablei++ )
        
precache_genericgIsUnstoppable] )
        
precache_soundgNoMoney )
}

public 
CmdUnstoppable(id)
{
    new 
Cost get_pcvar_numprice )
    new 
Money cs_get_user_moneyid )
            
    if (
Money Cost)
    {
        
set_hudmessage225225225, -1.00.2926.012.0 );
        
show_hudmessage0"You don't have enough money!" )
        
client_cmd0"spk %s"gNoMoney)
        return 
PLUGIN_HANDLED;
    } 
    else 
    {
        new 
name32 ]
        new 
Float:speed get_user_maxspeedid ) + 75.0
        
get_user_nameid,name,31 )
        
set_hudmessage225225225, -1.00.2926.012.0 )
        
show_hudmessage0"%s is now unstoppable!"name )
        
cs_set_user_modelid"Unstoppable" )
        
set_user_healthidget_pcvar_numhealth ) )
        
set_user_maxspeedidspeed )
        
set_user_gravityid0.6 )
        
set_user_armoridget_pcvar_numarmor ) )
        
client_cmdid"spk %s"gIsUnstoppablerandom_num(0sizeof gIsUnstoppable ) ] )
        
strip_user_weaponsid )
        
give_itemid"weapon_knife" )
        
give_itemid"weapon_m4a1")
        
give_itemid"weapon_deagle")
        
cs_set_user_bpammoidCSW_M4A1200 )
        
cs_set_user_bpammoidCSW_DEAGLE200 )

        
Money -= Cost;
    
        
cs_set_user_money(idMoney);    
    }
    return 
PLUGIN_HANDLED


Last edited by lazarev; 10-26-2009 at 14:29. Reason: updated
lazarev 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 17:43.


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