Random Object
#1

pawn Код:
new Objects[][3] = {
    {1},
    {2},
    {3}
};

new RandObject = random(sizeof(Objects));
CreateObject(Objects[RandObject], player[playerid][x], player[playerid][y], player[playerid][z], 0, 0, 0, 300);
But this gives me Argument match error, ive tried to use strval but no help there.. Could anyone tell me why this occurs?
Reply
#2

well i know what it is i think.

1. new Objects - maybe need Float:Objects ??
2. no objectmodel in there D:
3. no real positions
Reply
#3

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
well i know what it is i think.

1. new Objects - maybe need Float:Objects ??
2. no objectmodel in there D:
3. no real positions
1. Why should it be float? Modelid is an int.
2. It's the same what model number i put in there.. it should compile what so ever.
3. Read the structure.. it weren't supposed to have real positions in it either.
Reply
#4

Bump - The message you have entered is too short. Please lengthen your message to at least 8 characters.
Reply
#5

new Objects[][3] = {
{1},............../\
{2},..............|
{3}
};

You have a 3 here, that means you also have to give 3 values in each {}.
Just remove it, you do not need a 2D array for this.

new Objects[] = {
1,
2,
3
};
Reply
#6

Line 11: error 008: must be a constant expression; assumed zero

Lines:

new Objects[] = { // 10
{1}, // 11
{2}, // 12
{3} // 13
};
Reply
#7

new Objects[3] = {
Reply
#8

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
new Objects[3] = {
Tried that already =/
Reply
#9

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
new Objects[][3] = {
(...)

new Objects[] = {
1,
2,
3
};
remove the brackets {} for the single entries like in my post
Reply
#10

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
remove the brackets {} for the single entries like in my post
Nice !! thanks a lot
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)