You are not logged in.
Pages: 1
I am new to CLEO scripting, but have known and used CLEO before. After searching and finding nothing, I have come to see if someone could help me with this. To the point...
I want to make a "Police Radar" with CLEO. The point of it would be to detect the Model ID of a police car within a 3 to 5 block radius. If one is found then a textdraw would show saying that a cruiser was near.
In my search thru Opcodes I found 056C which is "actor $PLAYER_ACTOR driving_police_car"
I don't know if that could be used to detect the car.
Also found 0186 which is the "create_marker_above_car" Opcode.
I couldn't find out how to detect a radius around the player though.
Of course proper respect and credits would be made if someone built the whole thing for me. I also don't mind if someone points me in the right direction to get this done.
Thank you in advance.
Offline
Hai thar!
That opcode what you found "056C" is checks "is player driving poilce vehicle?". This is not what you need.
actor.storepos($PLAYER_ACTOR, 0@, 1@, 2@) actor.storepos($PLAYER_ACTOR, 2@, 3@, 4@) 0@ += 50.0 2@ -= 50.0 1@ += 25.0 3@ -= 25.0 0327: 4@ = get_random_car_with_model #COPCARLA in_rectangle_cornerA 0@ 1@ cornerB 2@ 3@ if 4@ <> -1 then if 056E: car 4@ defined then // car is founded paste here textdraw opcodes to mark the car ... end end
This is just example of using 0327 opcode which finds a car in rectangle that you're set. Hope it helps!
Offline
Thanks for the quick reply.
Here is what I got so far and it crashes on start up.
{$CLEO .cs} //---------------MAIN------------------ :POLCAR actor.storepos($PLAYER_ACTOR, 0@, 1@, 2@) actor.storepos($PLAYER_ACTOR, 2@, 3@, 4@) 0@ += 50.0 2@ -= 50.0 1@ += 25.0 3@ -= 25.0 0327: 4@ = get_random_car_with_model #COPCARLA in_rectangle_cornerA 0@ 1@ cornerB 2@ 3@ if 4@ <> -1 then if 056E: car 4@ defined then 03E5: 4@ = show_text_box ‘POL_MPL’ end end
I'm using the GXT hook for the text draw and the FXT is this
# Format: # <GXT ENTRY><SPACE><TEXT> # POL_MPL !!ALERT!!
Mind helping me with this one?
-Edit-
Also I can't seem to find the .cs in the cleo folder after I compile.
Last edited by Vance (12-08-2010 01:37)
Offline
03E5 opcode is with one parametr, a string.
03E5: show_text_box 'POL_MPL'
Also, if you using non-standart name for you FXT file, use 054C opcode to set gxt file as default gxt-table.
054C: use_GXT_table 'your filename here'
Offline
Everytime I compile 03E5 with one param. it will give an error that there is not enough params. but when I add the 4@ = it will compile.
Offline
Also, if you using non-standart name for you FXT file, use 054C opcode to set gxt file as default gxt-table.
054C: use_GXT_table 'your filename here'
No, it isn't requested for FXT's ;P
if 4@ <> -1 then if 056E: car 4@ defined then
Both checks in fact do the same action, so you can remove '4@ <> -1'
Offline
I want to ask if it is also possible to have a police radar that can detect police peds as well.
Offline
Both checks in fact do the same action, so you can remove '4@ <> -1'
Its for reliability.
Offline
Pages: 1