random cp's?
#1

im tryied to create random checkpoints, but im getting error. :/

Quote:

new Float:RandomCP[][] =
{
{1075.9678,2385.3535,11.1081,357.8982},
{1094.9563,2357.5154,10.8203,358.8381},
{1067.7051,2365.5979,17.3643,268.5973},
{1110.4586,2356.1936,10.8203,58.9753}
};

when player enter the car.

Quote:

new Random1 = random(10);
SetPlayerRaceCheckpoint(playerid, 1,RandomCP[Random1][0], RandomCP[Random1][1], RandomCP[Random1][2], 10);

Reply
#2

instead of new random1 = random(10);

try:

pawn Код:
new Random1 = random(sizeof(RandomCP));
Reply
#3

nah.. didnt help.
Reply
#4

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
im tryied to create random checkpoints, but im getting error. :/


when player enter the car.
I dont know if this is the main error but instead of new Float:RandomCP[][] = it should be

pawn Код:
new Float:RandomCP[4][3] =
{
{1075.9678,2385.3535,11.1081,357.8982},
{1094.9563,2357.5154,10.8203,358.8381},
{1067.7051,2365.5979,17.3643,268.5973},
{1110.4586,2356.1936,10.8203,58.9753}
};
4 -> Rows
3 -> "column"(in this script they are 3 coordinates: X,Y,Z)

And then this code:
pawn Код:
new Random1 = random(sizeof(RandomCP));
SetPlayerCheckpoint(playerid, RandomCP[Random1][0], RandomCP[Random1][1],RandomCP[Random1][2],10);
Tell me if it works :P
Reply
#5

What error do you get?
Reply
#6

To BMGP:

error 018: initialization data exceeds declared size

{1075.9678,2385.3535,11.1081,357.8982},

(errors at all enum koordinates line's)
Reply
#7

you haverotation in a array with coords for checkpoints wich dont neeed royation
Reply
#8

what you mean
Reply
#9

please, help.
Reply
#10

Quote:
Originally Posted by Gh0sT_
Посмотреть сообщение
im tryied to create random checkpoints, but im getting error. :/


when player enter the car.
What error?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)