Raised This Month: $ Target: $400
 0% 

[Help] Multi-dimensional fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 10-04-2009 , 21:59   [Help] Multi-dimensional fix
Reply With Quote #1

PHP Code:
new const weapons_primary[WEAPONS_PRIMARY][] = {
    
"weapon_m4a1",
    
"weapon_ak47",
    
"weapon_awp",
    
"weapon_m3",
    
"weapon_mp5navy",
    
"weapon_famas"
}

new const 
weapons_primary_names[WEAPONS_PRIMARY][] = {
    
"Maverick",
    
"AK-47",
    
"AWP",
    
"ShotGun",
    
"MP5 Navy",
    
"Famas"

Code:

Error: Multi-dimensional arrays must be fully initialized on line 21
Error: Multi-dimensional arrays must be fully initialized on line 30
2 Errors.
How to fix this?
__________________

Last edited by DruGzOG; 10-04-2009 at 22:04.
DruGzOG is offline
Send a message via AIM to DruGzOG
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-04-2009 , 22:36   Re: [Help] Multi-dimensional fix
Reply With Quote #2

Show the line where WEAPONS_PRIMARY is created.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 10-04-2009 , 22:45   Re: [Help] Multi-dimensional fix
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
Show the line where WEAPONS_PRIMARY is created.

Ahh I see my mistake, thanks lol.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 10-05-2009 , 15:27   Re: [Help] Multi-dimensional fix
Reply With Quote #4

PHP Code:
public set_ammo(id)
{
    static 
weapons[32], numi
    get_user_weapons
(idweaponsnum)
    for(
0numi++)
    {
        if(
weapons[i] != 29)
            
cs_set_user_bpammo(idweapons[i], 100)        
}
    } 
I've added this to the code but when the weapon is selected, the ammo is not given.

Any Suggestions?
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-05-2009 , 15:36   Re: [Help] Multi-dimensional fix
Reply With Quote #5

PHP Code:
#define PISTOL_WEAPONS_BIT (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_P228|1<<CSW_DEAGLE|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT (1<<CSW_M249)

#define ALL_GUNS_BIT ( PISTOL_WEAPONS_BIT | SHOTGUN_WEAPONS_BIT | SUBMACHINE_WEAPONS_BIT | RIFLE_WEAPONS_BIT | MACHINE_WEAPONS_BIT )

#define WeaponHasAmmo(%1) ( ( 1 << %1 ) & ALL_GUNS_BIT )

public set_ammo(id)
{
    static 
weapons[32], numiweapon
    get_user_weapons
(idweaponsnum)
    for(
0numi++)
    {
        
weapon weapons[i]
        if(
WeaponHasAmmo(weapon))
            
cs_set_user_bpammo(idweapon100)
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 22:40.


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