Raised This Month: $ Target: $400
 0% 

Problem on my plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 07-06-2014 , 17:58   Problem on my plugin
Reply With Quote #1

Hello,
i try to make hnr scout free but i do something wrong.
and the compiler say this:

Quote:
Your plugin failed to compile! Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team /tmp/textZQkeNj.sma(20) : warning 217: loose indentation /tmp/textZQkeNj.sma(21) : warning 217: loose indentation /tmp/textZQkeNj.sma(22) : warning 217: loose indentation /tmp/textZQkeNj.sma(23) : warning 217: loose indentation /tmp/textZQkeNj.sma(24) : warning 217: loose indentation /tmp/textZQkeNj.sma(25) : warning 217: loose indentation /tmp/textZQkeNj.sma(26) : warning 217: loose indentation /tmp/textZQkeNj.sma(27) : warning 217: loose indentation /tmp/textZQkeNj.sma(2 : warning 217: loose indentation /tmp/textZQkeNj.sma(29) : warning 217: loose indentation /tmp/textZQkeNj.sma(30) : warning 217: loose indentation /tmp/textZQkeNj.sma(31) : warning 217: loose indentation /tmp/textZQkeNj.sma(32) : warning 217: loose indentation /tmp/textZQkeNj.sma(33) : warning 217: loose indentation /tmp/textZQkeNj.sma(34) : warning 217: loose indentation /tmp/textZQkeNj.sma(35) : warning 217: loose indentation /tmp/textZQkeNj.sma(36) : warning 217: loose indentation /tmp/textZQkeNj.sma(37) : warning 217: loose indentation /tmp/textZQkeNj.sma(3 : warning 217: loose indentation /tmp/textZQkeNj.sma(102) : warning 217: loose indentation /tmp/textZQkeNj.sma(103) : warning 217: loose indentation /tmp/textZQkeNj.sma(112) : warning 225: unreachable code /tmp/textZQkeNj.sma(116) : warning 217: loose indentation /tmp/textZQkeNj.sma(126) : warning 225: unreachable code /tmp/textZQkeNj.sma(130) : warning 217: loose indentation /tmp/textZQkeNj.sma(140) : warning 225: unreachable code /tmp/textZQkeNj.sma(144) : warning 217: loose indentation /tmp/textZQkeNj.sma(154) : warning 225: unreachable code /tmp/textZQkeNj.sma(15 : warning 217: loose indentation /tmp/textZQkeNj.sma(16 : warning 225: unreachable code /tmp/textZQkeNj.sma(172) : warning 217: loose indentation /tmp/textZQkeNj.sma(182) : warning 225: unreachable code /tmp/textZQkeNj.sma(186) : warning 217: loose indentation /tmp/textZQkeNj.sma(196) : warning 225: unreachable code /tmp/textZQkeNj.sma(200) : warning 217: loose indentation /tmp/textZQkeNj.sma(210) : warning 225: unreachable code /tmp/textZQkeNj.sma(214) : warning 217: loose indentation /tmp/textZQkeNj.sma(224) : warning 225: unreachable code /tmp/textZQkeNj.sma(247) : error 021: symbol already defined: "Event_CurWeapon" /tmp/textZQkeNj.sma(262) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(263) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(264) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(266) : error 021: symbol already defined: "set_pev" /tmp/textZQkeNj.sma(269) : error 054: unmatched closing brace /tmp/textZQkeNj.sma(272) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(273) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(274) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(276) : error 021: symbol already defined: "set_pev" /tmp/textZQkeNj.sma(279) : error 054: unmatched closing brace /tmp/textZQkeNj.sma(282) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(283) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(284) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(286) : error 021: symbol already defined: "set_pev" /tmp/textZQkeNj.sma(289) : error 054: unmatched closing brace /tmp/textZQkeNj.sma(292) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(293) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(294) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(296) : error 021: symbol already defined: "set_pev" /tmp/textZQkeNj.sma(299) : error 054: unmatched closing brace /tmp/textZQkeNj.sma(302) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(303) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(304) : error 010: invalid function or declaration /tmp/textZQkeNj.sma(306) : error 021: symbol already defined: "set_pev" /tmp/textZQkeNj.sma(309) : error 054: unmatched closing brace Compilation aborted. 26 Errors.
here is my plugin:
http://pastebin.com/GGezrLK4

thanks about help!
and sorry about my bad english...
Eviatar Mor is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-06-2014 , 18:19   Re: Problem on my plugin
Reply With Quote #2

Oooo xD
Fixed
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

new boolHasScout1WeaponsModel 33 ]
new 
boolHasScout2WeaponsModel 33 ]
new 
boolHasScout3WeaponsModel 33 ]
new 
boolHasScout4WeaponsModel 33 ]
new 
boolHasScout5WeaponsModel 33 ]
new 
boolHasScout6WeaponsModel 33 ]
new 
boolHasScout7WeaponsModel 33 ]
new 
boolHasScout8WeaponsModel 33 ]
new 
boolHasScout9WeaponsModel 33 ]
new 
boolHasScout10WeaponsModel 33 ]

public 
plugin_precache(){
        
precache_model("models/LoLHnrScout/v_scout1.mdl")
        
precache_model("models/LoLHnrScout/p_scout1.mdl")
        
precache_model("models/LoLHnrScout/v_scout2.mdl")
        
precache_model("models/LoLHnrScout/p_scout2.mdl")
        
precache_model("models/LoLHnrScout/v_scout3.mdl")
        
precache_model("models/LoLHnrScout/p_scout3.mdl")
        
precache_model("models/LoLHnrScout/v_scout4.mdl")
        
precache_model("models/LoLHnrScout/p_scout4.mdl")
        
precache_model("models/LoLHnrScout/v_scout5.mdl")
        
precache_model("models/LoLHnrScout/p_scout5.mdl")
        
precache_model("models/LoLHnrScout/v_scout6.mdl")
        
precache_model("models/LoLHnrScout/p_scout6.mdl")
        
precache_model("models/LoLHnrScout/v_scout7.mdl")
        
precache_model("models/LoLHnrScout/p_scout7.mdl")
        
precache_model("models/LoLHnrScout/v_scout8.mdl")
        
precache_model("models/LoLHnrScout/p_scout8.mdl")
        
precache_model("models/LoLHnrScout/v_scout9.mdl")
        
precache_model("models/LoLHnrScout/p_scout9.mdl")
        
precache_model("models/LoLHnrScout/v_scout10.mdl")
        
precache_model("models/LoLHnrScout/p_scout10.mdl")
}

public 
plugin_init() {
    
register_plugin("ScoutMenu""1.0""SerMajor")
    
register_clcmd("say /scout""MenuShow")
    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
}



public 
MenuShow(id)
{
    new 
menu menu_create("[LoL] Scout Menu""MenuHandler"// ?????? , MenuHandler ?????.
    
menu_additem(menu"scout1""1"0)
    
menu_additem(menu"scout2""2"0)
    
menu_additem(menu"scout3""3"0)
    
menu_additem(menu"scout4""4"0)
    
menu_additem(menu"scout5""5"0)
    
menu_additem(menu"scout6""6"0)
    
menu_additem(menu"scout7""7"0)
    
menu_additem(menu"scout8""8"0)
    
menu_additem(menu"scout9""9"0)
    
menu_additem(menu"scout10""10"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu0)
}

public 
MenuHandler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[33];
    new 
accescallback;
    
menu_item_getinfo(menuitemaccesdata,charsmax(data), szName,charsmax(szName), callback)
    new 
key str_to_num(data);
    switch(
key)
    {
        
        case 
1: {
            
        
HasScout1WeaponsModel  id ] = true
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout1")
        }
        
        case 
2: {
        
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = true
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout2")
        }
    case 
3: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = true
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout3")
        }
    case 
4: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = true
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout4")
        }
    case 
5: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = true
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout5")
        }
    case 
6: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = true
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout6")
        }
     case 
7: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = true
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout7")
        }
    case 
8: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = true
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout8")
        }
    case 
9: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = true
        HasScout10WeaponsModel  
id ] = false
        client_print
(idprint_chat"[LoL] U Choose Scout9")
        }
    case 
10: {
        
HasScout1WeaponsModel  id ] = false
        HasScout2WeaponsModel  
id ] = false
        HasScout3WeaponsModel  
id ] = false
        HasScout4WeaponsModel  
id ] = false
        HasScout5WeaponsModel  
id ] = false
        HasScout6WeaponsModel  
id ] = false
        HasScout7WeaponsModel  
id ] = false
        HasScout8WeaponsModel  
id ] = false
        HasScout9WeaponsModel  
id ] = false
        HasScout10WeaponsModel  
id ] = true
        client_print
(idprint_chat"[LoL] U Choose Scout10")
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
Event_CurWeapon id ) {
    
    new 
weapon get_user_weapon id )
    
    if ( 
HasScout1WeaponsModel id ] )
    {

    switch ( 
weapon 
        {
        
        case 
CSW_SCOUT : {
        
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout2.mdl")
        
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout2.mdl")
                }
        }
    }     
    
    if ( 
HasScout2WeaponsModel id ]  ) {

    switch ( 
weapon 
        {
            
        case 
CSW_SCOUT : {
        
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout2")
        
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout2")       
                }
        }
    } 
    
    if ( 
HasScout3WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout3")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout3")
                
            }
    }

    if ( 
HasScout4WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout4")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout4")
                
            }
    }

    if ( 
HasScout5WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout5")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout5")
                
            }
    }

    if ( 
HasScout6WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout6")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout6")
                
            }
    }

    if ( 
HasScout7WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout7")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout7")
                
            }
    }

    if ( 
HasScout8WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout8")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout8")
                
            }
    }

    if ( 
HasScout9WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout9")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout9")
                
            }
    }

    if ( 
HasScout10WeaponsModel id ]  ) {
     switch ( 
weapon ) {
        case 
CSW_SCOUT : {
                
                
set_pev(idpev_viewmodel2"models/LoLHnrScout/v_scout10")
                
set_pev(idpev_weaponmodel2"models/LoLHnrScout/p_scout10")
                
            }
    }
}

__________________

Last edited by Eagle07; 07-06-2014 at 18:22.
Eagle07 is offline
Old 07-06-2014, 18:41
Freezo Begin
This message has been deleted by Freezo Begin. Reason: nvm :D
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-06-2014 , 18:46   Re: Problem on my plugin
Reply With Quote #4

I think this should look better.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

new bool:HasScout[10][33]

public 
plugin_precache(){
    new 
Model[64]
    for(new 
isizeof HasScouti++)
    {
        
formatex(Modelcharsmax(Model), "models/LoLHnrScout/v_scout%d.mdl"i)
        
precache_model(Model)
        
formatex(Modelcharsmax(Model), "models/LoLHnrScout/P_scout%d.mdl"i)
        
precache_model(Model)
    }
}

public 
plugin_init() {
    
register_plugin("ScoutMenu""1.0""Flicker")
    
register_clcmd("say /scout""MenuShow")
    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
}



public 
MenuShow(id)
{
    new 
menu menu_create("[LoL] Scout Menu""MenuHandler"// ?????? , MenuHandler ?????.
    
new Item[64]
    for(new 
isizeof HasScouti++)
    {
        
formatex(Itemcharsmax(Item), "scout%d"i+1)
        
menu_additem(menuItem""0)
    }
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
    
menu_display(idmenu0)
}

public 
MenuHandler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    
HasScout[item][id] = true
    client_print
(idprint_chat"[LoL] U Choose Scout%d"item+1)
    
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
Event_CurWeapon id ) {
    
    new 
weapon get_user_weapon id )
    
    if(
weapon != CSW_SCOUT)
        return 
PLUGIN_HANDLED
        
    
new model[64]
    for(new 
isizeof HasScouti++)
    {
        if(
HasScout[i][id])
        {
            
formatex(modelcharsmax(model), "models/LoLHnrScout/v_scout%d.mdl"i)
            
set_pev(idpev_viewmodel2model)
            
formatex(modelcharsmax(model), "models/LoLHnrScout/p_scout%d.mdl"i)
            
set_pev(idpev_weaponmodel2model)
            break
        }
        else continue
    }
    return 
PLUGIN_CONTINUE

The only note - your model names should start with 0 instead of 1 (in their names).
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 07-06-2014 , 18:51   Re: Problem on my plugin
Reply With Quote #5

Flick3rR Good Job
__________________
Eagle07 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 21:17.


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