How could I do something similair do this
#1

How could I do something similair to this:
pawn Код:
Object[1] = CreateObject(objectid, x, y, z) || CreateObject(objectid, x, y, z);
I'm not sure how I could do something like that. So I'd like to ask you for some suggestions.
Reply
#2

pawn Код:
Object[1] = (random(2) == 1) ? (CreateObject(objectid, x, y, z)) : (CreateObject(objectid, x, y, z));
You mean something like this? (Creating one ranom of both objects only)
Reply
#3

Well, more like I stated above.
Two objects with the same defination(objectid).

I'm working on a script to move two doors. It checks what door you are at, then it opens both of the doors.
But, these two doors are like lift doors, they move to two different x'es.
e.g door 1 moves to the left, door 2 moves to the right.

I think it's impossible to make that with defining two objects as one, if you get what I mean.
But then I have to modify my loop on a different way, which I'm not sure about.

Help would be appreciated.
Reply
#4

Ah you mean it like this. No youre right, this is not possible withour further scripting structures. CreateObject returns an integer, you you cant merge two different ones to a single one that represents both of them, mathematically just not possible

There are some scripts to move multiple objects at once, maybe you can find them with the search, I am too lazy atm, but better script jsut a loop for this, as you wont be able to move them in to different directions.
Reply
#5

Okay, then I have an other question. I'll modfiy my script.
But how do I make something like this:

pawn Код:
i = 1 OR 2 OR 3, etc
GetObjectPos(door[i], x, y, z);
Like, the two symbols || and && stand for 'and'.
Reply
#6

edit: nvm

you would do it like this: i == 1 || i == 2 || i == ...
Reply
#7

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
edit: nvm

you would do it like this: i == 1 || i == 2 || i == ...
I think you mean i = 1 || 2 || 3 || 4 || 5 || etc ?
For your method I need to use 'if'.

if(door[i] == 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)