#1 17-10-2010 05:51

rooood
Registered: 17-10-2010
Posts: 3

[Help] Compare 2 cars and check if is the same

Hello all, I'm new to CLEO stripting but I'm a programmer.
I want to know how to compare 2 cars (0@ and 1@) and check if they are the same car.
I'll use this to check if the player is entering the last car he was driving or if it is a "new" car.
I tried using 0@ == 1@ but compiler told me I can't compare these kinds of variables ):

Offline

#2 17-10-2010 15:14

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: [Help] Compare 2 cars and check if is the same

Compiler doesn't know, which opcode needed here - for integer numbers (003B) or for float numbers (0045). You should specify types of these variables at start of script with var..end construction:

{$CLEO}
var
    0@: Integer
    1@: Integer
end

or you should write number of opcode:

003B: 0@ == 1@

Offline

#3 17-10-2010 19:12

rooood
Registered: 17-10-2010
Posts: 3

Re: [Help] Compare 2 cars and check if is the same

I didn't know I could compare 2 cars as integers, thank you!

Offline

Board footer

Powered by FluxBB