Raised This Month: $ Target: $400
 0% 

Const problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-22-2014 , 09:21   Re: Const problem
Reply With Quote #2

First of all, you're using Strings where you should use Integer values. And thats why it takes 49 only, as '1' is 49 in the ASCII representation.

PHP Code:
new const i_NormalWeapon[][] = {"","weapon_mp5navy","weapon_ak47"}
new const 
i_WeaponPrice[] = {0,1000,300}

public 
giveweaponmp5(id){
        
give_item(id,i_NormalWeapon[1])
    new 
money cs_get_user_money(id) - i_WeaponPrice[1]
    
cs_set_user_money(id,money)

Why is the first element of both arrays empty anyways?
mottzi is offline
Send a message via MSN to mottzi
 



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 13:13.


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