Raised This Month: $ Target: $400
 0% 

how to declare array to save speed per lvl


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 11-17-2014 , 12:15   how to declare array to save speed per lvl
Reply With Quote #1

I know its simple ... brain exploding.

new Float:speedlvl[33]

I need to save 7 levels there like { 250.0, 270.0, .... etc }

new Float:speedlvl[33][7] ??
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-17-2014 , 12:36   Re: how to declare array to save speed per lvl
Reply With Quote #2

So for each player index you would like to have 7 levels and to use them like
Code:
array[index][0] = x.y array[index][6] = a.b

If so, yes.
__________________
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-17-2014 , 19:32   Re: how to declare array to save speed per lvl
Reply With Quote #3

Quote:
Originally Posted by avril-lavigne View Post
I know its simple ... brain exploding.

new Float:speedlvl[33]

I need to save 7 levels there like { 250.0, 270.0, .... etc }

new Float:speedlvl[33][7] ??
There is no reason to store each of the speeds for each person. Simply have one array for players that contains the speed level number and have another array for the speeds.

PHP Code:
new g_iPlayerSpeedLevel[33]
new 
Float:g_fSpeedLevesl[7] = {250.0,  270.0, .... etc
Then, when you need to get a player's speed, you simply do this:

PHP Code:
new Float:ThisPlayersSpeed g_fSpeedLevels[g_iPlayerSpeedLevel[id]] 
where 'id' is the player index.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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