Randomizing..
#1

Randomizing SendClientMessage And/Or TogglePlayerControllable??
Is it possible, If so how would i do that.
Reply
#2

Quote:
Originally Posted by Torran
Randomizing SendClientMessage And/Or TogglePlayerControllable??
Is it possible, If so how would i do that.
Just use new randomvariable = random() then do
pawn Код:
if(randomvariable == 1) { // SendClientMessage } else if(randomvariable == 2) { // Other Message }
Reply
#3

Is there any more code?
Reply
#4

pawn Код:
new rand = random(2);

if(rand == 0)
{
  SendClientMessage(...);
}

if(rand == 1)
{
  SendClientMessage(...);
}
Reply
#5

Quote:
Originally Posted by [HiC
TheKiller ]
pawn Код:
new rand = random(2);

if(rand == 0)
{
  SendClientMessage(...);
}

if(rand == 1)
{
  SendClientMessage(...);
}
Its not randoming...
Its just doing one thing twice,
Then the other thing twice,
Then back to the other twice,
Then back to the other twice,
I want it to randomize,
So sometimes it fails, And sometimes it starts,
But i know when its going to start, And when its going to fail,
Do anyone know a fix? xd
Reply
#6

No that is random.
Run it many times you will see the randomness in it, but the it will average out to the same number of each being called. as rand 2 averages over the 2.
Reply
#7

Its not randomizing?
I typed the command 10 Times,
It just Starts Twice,
Then fails twice,
Then starts twice,
Then fails twice,
I want it to do like,

Sometimes it starts,
Soemtimes it fails,

But it always starts, It never fails,
Unless u start the engine 3 times
Reply
#8

Make this.
for(new test=0; test<50;test++)
{
new rand = random(2);
printf("%d"),rand;
}
Then post the results from your server-log.txt
Reply
#9

Код:
----------------------
v0.3a R4, ©2005-2009 SA-MP Team

[23:30:18] 
[23:30:18] Server Plugins
[23:30:18] --------------
[23:30:18] Loaded 0 plugins.

[23:30:18] 
[23:30:18] Filter Scripts
[23:30:18] ---------------
[23:30:18]  Loading filter script 'engine.amx'...
[23:30:18] Engine System loaded.
[23:30:18]  Loaded 1 filter scripts.

[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] 0
[23:30:18] Basic- Cops n Robbers
[23:30:18] Number of vehicle models: 4
Reply
#10

I assume you fixed my little bug there printf("%d",rand);?
If so something seems to be wrong with your random, have you messed around with your samp server includes?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)