[Include] random.inc - Random System
#1

Description
Now I Writed A Include That Just Do Two Very Important Work.This Include Simulate a C# Random Function.
(Note: This Include Based On 'native random(max);' And You Need a_samp.inc and float.inc)

Functions
Код:
native Random(min, max);
native RandomFloat(Float:min, Float:max, accuracy = 4);
The Important Benefits In This Include, Just The Min, Max Values And Random Float.
RandomFloat, Does Some Math Calculations To Return A Completly Random Float.

Return Values
Random:

A Random Value: Everything Is Right.
0: Something Is Wrong And A Error Occured.

Errors:
Max Value Is Equal Or Smaller From Min Value.
Min Or Max Values Are Negative.

RandomFloat:

A Random Float Value: Everything Is Right.
0.0: Something Is Wrong And A Error Occured.

Errors:
Accuracy Is Bigger From 6 Or Smaller From 1.
Max Value Is Equal Or Smaller From Min Value.
Min Or Max Values Are Negative.

Examples
Random(min, max):

Код:
printf("Random (10 - 65):%d",Random(10,65));
Output Can Be (65 - 10 =) 55 Items.Here Is Some Outputs:
Код:
Random 10 - 65:41
Random 10 - 65:17
Random 10 - 65:36
Random 10 - 65:57
Random 10 - 65:28
---------------------------
RandomFloat(Float:min, Float:max) :

Код:
printf("Random Float (5.1 - 44.7):%f",RandomFloat(5.1,44.7));
Output Can Be Too Many Items.Here Is Some Outputs(We Dont Put Accuracy; And its By Default 4):
Код:
Random Float (5.1 - 44.7):17.2981
Random Float (5.1 - 44.7):27.1247
Random Float (5.1 - 44.7):9.1954
Random Float (5.1 - 44.7):41.2458
Random Float (5.1 - 44.7):35.5884
Download
random.inc
Reply
#2

Nice job. Take my rep+
Reply
#3

Good job bro REP+
Reply
#4

This shouldn't be an include as it's just 2 simple functions.
Reply
#5

What You Need?Its Just Declaring Two Function That Can Be Needed Sometimes.
Reply
#6

not an include , useful but we can not use it as an include
because we can make it in 10seconds and use it as a stock in our gamemode
so why we should use another include for our gamemode?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)