Raised This Month: $ Target: $400
 0% 

STR DEFINE to INTEGER


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-10-2010 , 07:00   Re: STR DEFINE to INTEGER
Reply With Quote #1

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.
__________________
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^
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-10-2010 , 17:39   Re: STR DEFINE to INTEGER
Reply With Quote #2

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
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 05:26.


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