Raised This Month: $ Target: $400
 0% 

Correct the code pls


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-26-2009 , 14:10   Correct the code pls
Reply With Quote #1

When compile:

Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// Unstoppable.sma
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(98) : warning 213: tag mismatch
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(99) : warning 213: tag mismatch
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(105) : error 035: argument type mismatch (argument 2)
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(106) : error 035: argument type mismatch (argument 2)
// D:\Dovydo\Counter - strike Failai\Addonai\L4DPlague\L4DPlague\addons\amxmodx\
scripting\Unstoppable.sma(112) : warning 209: function "Unstoppable" should retu
rn a value
//
// 2 Errors.
// Could not locate output file D:\Dovydo\Counter - strike Failai\Addonai\L4DPla
gue\L4DPlague\addons\amxmodx\scripting\compiled\Unstoppable.amx (compile failed)
.
//
// Compilation Time: 0,22 sec
// ----------------------------------------

Press enter to exit ...
Full Code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#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 const Model[] = { "model/player/Unstoppable/Unstoppable.mdl" }
/*================================================================================
 [New Variables]
=================================================================================*/
//Unstoppable stuff...
new price
new health
new speed
new gravity
new armor

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

public plugin_init()
{
      
register_pluginPLUGINVERSIONAUTHOR );


      
register_clcmd("say /unstoppable""Unstoppable")
      
register_clcmd("say_team /unstoppable""Unstoppable")

    
price register_cvar("un_unstoppable""16000")

    
health register_cvar("un_health""1000");
    
speed register_cvar("un_speed""295");
    
gravity register_cvar("un_gravity""0.6");
    
armor register_cvar("un_armor""300");
}

public 
plugin_cfg()
{
    
// Get configs dir
    
new cfgdir[32]
    
get_configsdir(cfgdircharsmax(cfgdir))

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

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

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

    
precache_sound(gNoMoney)

        
precache_modelModel);
}

public 
Unstoppable(id)
{
    new 
Cost get_pcvar_num(price);
    new 
Money cs_get_user_money(id);
            
    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 
name[32];
            
get_user_name(id,name,31);
                
set_hudmessage225225225, -1.00.2926.012.0 );
                
show_hudmessage0"%s is now unstoppable!"name);
            
cs_set_user_modelid"Model")
            
set_user_healthidget_pcvar_numhealth ) )
            
set_user_maxspeedidget_pcvar_numspeed ) )
            
set_user_gravityidget_pcvar_numgravity ) )
            
set_user_armoridget_pcvar_numarmor ) )
        
client_cmdid"spk %s"gIsUnstoppable[random_num(0sizeof gIsUnstoppable 1)])
        
strip_user_weapons(id)
        
give_itemid"weapon_m4a1")
        
give_itemid"weapon_deagle")
        
cs_set_user_bpammoid"weapon_m4a1"200 )
        
cs_set_user_bpammoid"weapon_deagle"200 )

        
Money -= Cost;
    
        
cs_set_user_money(idMoney);    
    }

DoviuX is offline
Send a message via Skype™ to DoviuX
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 10-26-2009 , 14:23   Re: Correct the code pls
Reply With Quote #2

Post the lines where you get these errors!
I don't want to count the lines by myself.
__________________
unnyquee is offline
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
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-26-2009 , 14:26   Re: Correct the code pls
Reply With Quote #4

PHP Code:
            set_user_maxspeedidget_pcvar_numspeed ) ) 
PHP Code:
            set_user_gravityidget_pcvar_numgravity ) ) 
PHP Code:
        cs_set_user_bpammoid"weapon_m4a1"200 
PHP Code:
        cs_set_user_bpammoid"weapon_deagle"200 
PHP Code:
                 
DoviuX is offline
Send a message via Skype™ to DoviuX
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-26-2009 , 14:29   Re: Correct the code pls
Reply With Quote #5

lazarev

Vorks thx ^^
DoviuX is offline
Send a message via Skype™ to DoviuX
lazarev
Veteran Member
Join Date: Sep 2008
Old 10-26-2009 , 14:30   Re: Correct the code pls
Reply With Quote #6

updated code, test the plugin pls and report bugs
lazarev is offline
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 17:43.


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