RANDOM FIRE.
#1

Hey,

How can I make a timer that after 15 minuts of starting the server 3 objects of fire will activate together,there will be 15 diffrent places that the objects will activated and it will be random,can someone help me plz ?
Reply
#2

i can't understand you mean make the gamemode with time?
Reply
#3

Quote:
Originally Posted by Kells
View Post
i can't understand you mean make the gamemode with time?
No,I will try to explain again

I want to do that after 15 minuts that I start the server,a frew fire object will show in random place that I will define.
Reply
#4

pawn Code:
forward SpawnObject();
public SpawnObject()
{
     // Object to add
}

public OnGameModeInit()
{
    SetTimer("SpawnObject", 15*60000, 0) // after 15minuts, the SpawnObject function will be called.
}
Reply
#5

Quote:
Originally Posted by Garwan50
View Post
pawn Code:
forward SpawnObject();
public SpawnObject()
{
     // Object to add
}

public OnGameModeInit()
{
    SetTimer("SpawnObject", 15*60000, 0) // after 15minuts, the SpawnObject function will be called.
}
Tnx but I also want it to choose from a random list...

I mean I have 3 places with 5 objects each and I want it to choose 1 and spawn his objects untill someone sprays water on it.
Reply
#6

I think you should create an array of position's you want like

pawn Code:
new Float:pos[15][3] = {
{0,0,0},   //Replace 0,0,0 and 1,1,1 with position's
{1,1,1},   //Do for all 15 positions
.
.
.
};
Now create a timer when game start's
pawn Code:
forward StartFire();

public OnGameModeInit()
{
    SetTimer("StartFire", 15*60000, 0)
}
Now the function to create object

pawn Code:
public StartFire()
{

    for(new i=0;i<3;++i){
    new rand = random(sizeof(pos));
    CreateObject(18689,pos[rand][0],pos[rand][1],pos[rand][2],0,0,0);}
}
Reply
#7

Quote:
Originally Posted by [MM]RoXoR[FS]
View Post
I think you should create an array of position's you want like

pawn Code:
new Float:pos[15][3] = {
{0,0,0},   //Replace 0,0,0 and 1,1,1 with position's
{1,1,1},   //Do for all 15 positions
.
.
.
};
Now create a timer when game start's
pawn Code:
forward StartFire();

public OnGameModeInit()
{
    SetTimer("StartFire", 15*60000, 0)
}
Now the function to create object

pawn Code:
public StartFire()
{

    for(new i=0;i<3;++i){
    new rand = random(sizeof(pos));
    CreateObject(18689,pos[rand][0],pos[rand][1],pos[rand][2],0,0,0);}
}
22 Errors... There is a missing barracks or something..
Can I get another code guys ?
Reply
#8

pawn Code:
new Float:pos[15][3] = {
{0,0,0},   //Replace 0,0,0 and 1,1,1 with position's
{1,1,1},   //Do for all 15 positions
.
.
.
};
Show us these, I think you have comma at the last line.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)