Raised This Month: $51 Target: $400
 12% 

STR DEFINE to INTEGER


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-10-2010 , 17:39   Re: STR DEFINE to INTEGER
Reply With Quote #11

Quote:
Originally Posted by Alucard^ View Post
Use Bugsy code, is better than mine, cuz my code is only an example starting with string (only to understand why your code doesn't work):

Code:
new const A_SG_Marines_3_val[] = "30"; new g_Scans_Needed = str_to_num(A_SG_Marines_3_val); new g_Scans[33][g_Scans_Needed];

Also, maybe the num_to_str() is useless, depends on where you will use the string num... where? maybe in the function that you want to the num as string, you can use %d.

Sry for my english.
You cannot declare and array size with a non-constant variable (g_Scans_Needed). Your code will not compile.
__________________
fysiks is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-10-2010 , 18:02   Re: STR DEFINE to INTEGER
Reply With Quote #12

So "new const" fix the problem? sry for not test this but, i have to go now xd, cya.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-10-2010 , 18:13   Re: STR DEFINE to INTEGER
Reply With Quote #13

Just use what I posted above, it is the best way to do what you're trying to do. new const x = str_to_num() will not work if that's what you were going to try.
__________________
Bugsy 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 00:39.


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