Chekpoints
#1

I want to make sweeper job, and I don't know how to make random checkpoints. I have 10 chekpoints, and they come random, how can i make that?
Reply
#2

make an array like this.

pawn Код:
new Sweeper[][3]
{
       {X, Y, Z},
       {X, Y, Z}
};
In your command use

pawn Код:
new rand = random(sizeof(Sweeper));
Stting the checkpoint - Use Sweeper[rand][0], 0 = X 1 = Y 2 = Z etc
Reply
#3

First add that to the top of script (After includes):
pawn Код:
new Float:RandCp[] [] = {
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0} // Change/Add X Y Z Coorinates
};
Then, put it On OnGameModeInit:
pawn Код:
new rand = random(sizeof(RandCp));
CreateDynamicCP(RandCp[rand][0], RandCp[rand][1], RandCp[rand][2]); // << Change to your Streaming Function
Reply
#4

Quote:
Originally Posted by EightTwoFourThree
Посмотреть сообщение
First add that to the top of script (After includes):
pawn Код:
new Float:RandCp[] [] = {
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0}, // Change/Add X Y Z Coorinates
{0.0,0.0,0.0} // Change/Add X Y Z Coorinates
};
Then, put it On OnGameModeInit:
pawn Код:
new rand = random(sizeof(RandCp));
CreateDynamicCP(RandCp[rand][0], RandCp[rand][1], RandCp[rand][2]); // << Change to your Streaming Function

That shouldnt be under on gamemode init it should be under a forward or under a command!. You also did your array wrong as you havnt defined how meny bits of information are inside the brackets.

Again please do not post, useless, uneeded or offtopic posts
Reply
#5

That might be true, I took it from my own script and edited it as Checkpoint.
(In my script it works well...)

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Again please do not post, useless, uneeded or offtopic posts
I may posted something wrong mistakely, I'm taking it as an insult. Don't do that.
Reply
#6

I made this for someone a few days ago: http://pastebin.com/XLbKQvfx
Reply
#7

Just to clarify if you had that working in your script thats a miracle. There are to meny things wrong with that for it to work
Reply
#8

And how to make, that they got 40$ for evry cp?
Reply
#9

pawn Код:
public OnPlayerEnterCheckpoint(playerid, checkpointid)
{
    if(IsPlayerInCheckPoint(playerid, CPID) // Change to your Streaming functions
    {
        GivePlayerMoney(playerid, 40);
    }
    return 1;
}
Reply
#10

You don't use a checkpoint streamer for race checkpoints. You only show one at a time..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)