Raised This Month: $ Target: $400
 0% 

Trash this


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maplebest
BANNED
Join Date: May 2007
Location: Sweden, Sverige
Old 09-16-2007 , 10:07   Trash this
Reply With Quote #1

Trash this

It didn't work anywayz

Last edited by maplebest; 09-30-2008 at 12:34.
maplebest is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-16-2007 , 10:43   Re: 4 errors I dont know how to fix
Reply With Quote #2

you forgot to include engine
#include <engine>
cant use entity_set_string else
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
Miczu
Member
Join Date: Jul 2007
Old 09-16-2007 , 10:47   Re: 4 errors I dont know how to fix
Reply With Quote #3

You need to #include <engine> ("entity_set_string" is a engine command or something).

UP: Im too slow
Miczu is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-16-2007 , 10:48   Re: 4 errors I dont know how to fix
Reply With Quote #4

Here I fixed your code, it was what horrific. Your indenting was bad, and you forgot to include something important. I fixed all errors.

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

#define Keysknife_menu1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890

#define Keysknife_menu2 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 1234567890


new  knife_model[33]


public 
plugin_init() {
    
    
register_event("CurWeapon","checkWeapon","be","1=1"
    
register_menucmd(register_menuid("knife_menu1"), Keysknife_menu1"Pressedknife_menu1")
    
register_menucmd(register_menuid("knife_menu2"), Keysknife_menu2"Pressedknife_menu2")
    
register_clcmd("say /knife","Pressedknife_menu1")
    
register_clcmd("/knife2""Pressedknife_menu2")
    
set_task(480.0"kmodmsg"0__"b")
}

public 
plugin_precache() { 
    
precache_model("models/knife-mod/v_butcher.mdl"
    
precache_model("models/knife-mod/p_butcher.mdl"
    
precache_model("models/knife-mod/v_saber.mdl")
    
precache_model("models/knife-mod/p_saber.mdl")
    
precache_model("models/knife-mod/v_bak.mdl")
    
precache_model("models/knife-mod/p_bak.mdl")
    
precache_model("models/knife-mod/v_merce.mdl")
    
precache_model("models/knife-mod/p_merce.mdl")
    
precache_model("models/v_knife.mdl"
    
precache_model("models/p_knife.mdl")
    
precache_model("models/knife-mod/v_pocket.mdl")
    
precache_model("models/knife-mod/p_pocket.mdl")
    
precache_model("models/knife-mod/v_trout.mdl"
    
precache_model("models/knife-mod/p_trout.mdl"
    
precache_model("models/knife-mod/v_combat.mdl")
    
precache_model("models/knife-mod/v_halo.mdl")
    
precache_model("models/knife-mod/v_kungfu.mdl")
    
precache_model("models/knife-mod/v_wolverine.mdl"
    
precache_model("models/knife-mod/v_brass.mdl")
    
precache_model("models/knife-mod/p_brass.mdl")


public 
Showknife_menu1(id) {
    
show_menu(idKeysknife_menu1"\yKn\ri\wf\de\y M\ro\wd\d \yMe\rn\wu\d^n", -1"knife_menu1"// Display menu
}

public 
Pressedknife_menu1(idkey) {
    
/* Menu:
    * Knife Mod Menu
    
    * 1: Butcher Knife
    * 2: Bak Knife
    * 3: Mercenary Knife
    * 4: Lightsaber Darth Maul
    * 5: Pocket Knife
    * 6: Default Knife
    * 9: Next Page
    * 0: Exit
    */
    
    
switch(key
    {
        case 
0
        {
            
butcher(id)
        }
        case 
1
        {
            
bak(id)
        }
        case 
2
        {
            
merce(id)
        }
        case 
3
        {
            
saber(id)
        }
        case 
4
        {
            
pocket(id)
        }
        case 
5:
        {
            
knife(id)
        }
        
        case 
8
            
        
client_cmd(id"/knife2")         
        
        case 
9
        {
            
        }
    }
}
public 
Showknife_menu2(id) {
    
show_menu(idKeysknife_menu2"\yKn\ri\yf\re\y M\ro\yd\r M\ye\rn\yu\r 2\y^n", -1"knife_menu2"// Display menu
}

public 
Pressedknife_menu2(idkey) {
    
/* Menu:
    * Knife Mod Menu 2
    
    * 1: Trout
    * 2: Combat Knife
    * 3: Halo Knife
    * 4: Kung Fu
    * 5: Brass Knuckles
    * 6: Wolverine
    * 0: Exit
    */
    
switch(key
    {
        case 
0
        {
            
trout(id)
        }
        case 
1
        {
            
combat(id)
        }
        case 
2
        {
            
halo(id)
        }
        case 
3
        {
            
kungfu(id)            
        }
        case 
4
        {
            
brass(id)
        }
        case 
5:
        {
            
wolverine(id)
        }
        
        case 
9
        {
            
        } 
    }
}
public 
knife(id) { 
    
knife_model[id] = 0
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/v_knife.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl"
    } 
    


public 
butcher(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_butcher.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_butcher.mdl"
    } 
    


public 
bak(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_bak.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_bak.mdl"
    } 
    
}

public 
merce(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_merce.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_merce.mdl"
    }
    


public 
saber(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_saber.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_saber.mdl"
    }
    

public 
pocket(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_pocket.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_pocket.mdl"
    }


public 
checkWeapon(id) { 
    new 
ClipAmmoWeapon get_user_weapon(idClipAmmo
    
    if ( 
Weapon == CSW_KNIFE ) {         
        switch (
knife_model[id]) { 
            case 
0: { 
                
entity_set_string(idEV_SZ_viewmodel"models/v_knife.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl")
            } 
            case 
1: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_butcher.mdl")
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_butcher.mdl")  
                
            } 
            
            case 
2: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_bak.mdl")  
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_bak.mdl")
                
            } 
            case 
3: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_merce.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_merce.mdl"
                
            }
            case 
4: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_saber.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_saber.mdl"
                
            }
            case 
5: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_pocket.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_pocket.mdl"
                
            }
            
        }
        
        switch (
knife_model[id]) { 
            case 
0: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_wolverine.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl")
            } 
            case 
1: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_trout.mdl")
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_trout.mdl")      
            } 
            
            case 
2: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_combat.mdl")  
                
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl")
            } 
            case 
3: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_halo.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl")
            }
            case 
4: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_kungfu.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl")
            }
            case 
5: { 
                
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_brass.mdl"
                
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_brass.mdl"
                
            }
            
        }
    }
}

public 
wolverine(id) { 
    
knife_model[id] = 6
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_wolverine.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl"
    } 
    


public 
trout(id) { 
    
knife_model[id] = 7
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_trout.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_trout.mdl"
    } 
    


public 
combat(id) { 
    
knife_model[id] = 8
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_combat.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl"
    } 
    
}

public 
halo(id) { 
    
knife_model[id] = 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_halo.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl"
    }
    


public 
kungfu(id) { 
    
knife_model[id] = 10 
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_kungfu.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/p_knife.mdl"
    }
    

public 
brass(id) { 
    
knife_model[id] = 11
    
new ClipAmmoWeapon get_user_weapon(idClipAmmo
    if ( 
Weapon == CSW_KNIFE ) { 
        
entity_set_string(idEV_SZ_viewmodel"models/knife-mod/v_brass.mdl"
        
entity_set_string(idEV_SZ_weaponmodel"models/knife-mod/p_brass.mdl"
    }
    


public 
kmodmsg() { 
    
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum"c")    
    for(
0<= iNumi++) {
        
        new 
id iPlayers[i
        if(!
is_user_connected(id)) continue 
        
client_print(id,print_chat,"[AMXX] Type /knife to change your knife skins")
    } 


Last edited by X-Script; 09-16-2007 at 10:58.
X-Script is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-16-2007 , 10:58   Re: 4 errors I dont know how to fix
Reply With Quote #5

it did compile whitout amxmisc when i tryed-.-
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-16-2007 , 10:59   Re: 4 errors I dont know how to fix
Reply With Quote #6

Yeah I know, I don't know what I added it. It doesn't matter.
X-Script is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-16-2007 , 11:00   Re: 4 errors I dont know how to fix
Reply With Quote #7

y that might be good enyway he might need it after a while =)
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-16-2007 , 11:02   Re: 4 errors I dont know how to fix
Reply With Quote #8

Now I have a reason why I put it in there.
X-Script is offline
Old 09-17-2007, 10:55
maplebest
This message has been deleted by maplebest.
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 16:03.


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