Raised This Month: $ Target: $400
 0% 

Question on read_data()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 11-07-2009 , 19:21   Question on read_data()
Reply With Quote #1

Some reason i get an error on the line that is bolded
(code from that unlimited ammo from mini-midget.)

PHP Code:
#define    SLOT_SECONDARY    2 
PHP Code:
stock g_WeaponSlots[] = {
    
0,
    
2,    //CSW_P228
    
0,
    
2,    //CSW_ELITE
    
2,    //CSW_FIVESEVEN
    
2,    //CSW_USP
    
2,    //CSW_GLOCK18
    
2,    //CSW_DEAGLE
}

stock g_MaxBPAmmo[] = {
    
0,
    
52,   //CSW_P228
    
0,
    
120//CSW_ELITE
    
100//CSW_FIVESEVEN
    
100,  //CSW_USP
    
120,  //CSW_GLOCK18
    
35,    //CSW_DEAGLE

PHP Code:
public event_weapon(id)
{
    new 
wp read_data(2)
    
    if (
g_WeaponSlots[wp] == SLOT_SECONDARY//Run time error 4 here... no idea why it does that...
    
{
        new 
ammo cs_get_user_bpammo(idwp)
        
        if (
ammo g_MaxBPAmmo[wp])
        {
            
cs_set_user_bpammo(idwpg_MaxBPAmmo[wp])
        }
    }


edit:
I added in the whole plugin and it worked fine but when i strip out the whole primary nade and c4 part i get errors any idea why

Last edited by Doc-Holiday; 11-07-2009 at 19:45.
Doc-Holiday 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:39.


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