Raised This Month: $ Target: $400
 0% 

Random from 3 numbers..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 02-13-2013 , 06:11   Random from 3 numbers..
Reply With Quote #1

Hello.
I have, for example, 3 floats for hudmessage:

new const position[25] =
{
"0.55",
"0.60",
"0.50"
}

How i can put random value to hud_msg parameters?

set_hudmessage(255, 0, 0, 0.08, 0.51, 0, 6.0, 2.0)
show_hudmessage(id, "test")
__________________
sorry my bad english...
alonelive is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 02-13-2013 , 07:27   Re: Random from 3 numbers..
Reply With Quote #2

If you want to use one of the values from the array then you can do this (don't store floats in array as strings):
PHP Code:
new const Float:position[] =
{
    
0.55,
    
0.60,
    
0.50

set_hudmessage(255000.08position[random(sizeof(position))], 06.02.0)
show_hudmessage(id"test"
__________________
Impossible is Nothing

Last edited by Sylwester; 02-13-2013 at 07:27.
Sylwester 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 20:41.


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