Raised This Month: $ Target: $400
 0% 

Optimize/fix my code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 08-15-2008 , 06:47   Re: Optimize/fix my code
Reply With Quote #5

Quote:
Originally Posted by [X]-RayCat View Post
Code:
new Names[6][] ={
"",
"Silent Footsteps",
"150 health",
"Sunglasses (No flash)",
"Steahlt-Suit",
"150 Armor" }

for ( i = 1; i < 9; i++)
{
format(nr, 2,"%i", i)
format(Form, 49, "%s: ($%i)", Names[i], get_pcvar_num(pcvars[i])) menu_additem(menu, Form, nr, 0);
}



The menu doesnt open it say something like "Index out of bounds".
The names array is to small use sizeof or make the number nine smaller
__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 08-15-2008 at 06:50.
fxfighter is offline
Send a message via MSN to fxfighter
 



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 03:11.


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