Jump to content

The target marker (rightclick on the ingame map)


Recommended Posts

I'm having trouble finding the right opcodes to use to set the map marker (The real one).



This is the current code.



{$CLEO .cs}:MARKERTEST03A4: name_thread "TESTLICIOUS"wait 1000:LOLwait 0if0AB0:   key_pressed 122004D: jump_if_false @LOL00BA: text_styled 'FEM_OK'  1000 ms  12@ = Marker.CreateIconWithoutSphere(41, 882.2519, 2012.8652, 10.8203)0A93: end_custom_thread



So this worked somewhat. But it just creates an normal icon instead. Thus I practically have two markers on my map, one that I set with the ingame menu, and the other is created with this cleo script. What I intended was for the actual marker (the one you set) to be the one that is placed at the coordinates. The text styled was just to see if the code worked at all.


Also, the problem with this script is that I intended this for use with SA:MP. The text is displayed as normal, but no map icon was placed.


Does anyone have any solutions that I can work with? Would be appreciated since I'm stuck on this.

What i'm basically doing is creating an script that will allow you to set the map marker based on predefined locations or by typing in your own coordinates. In the end this has to work with SA:MP. (And no, this is not an hack being developed. Got no interest in such bullsh*t).

Link to comment
Share on other sites

  • 2 weeks later...

Awesome, thanks for the help.


Now I need some additional help.

I studied the read init from ini opcode thing. And came up with this:




{$CLEO .cs}:DEMOTEXT03A4: name_thread "DEMO"wait 100003E5: show_text_box 'TXT_01':LOLwait 0if0AB0: key_pressed 122else_jump @LOL0AF0: 1@ = get_int_from_ini_file "cleo\CMM.ini" section "Spenat" key "X"0AF0: 2@ = get_int_from_ini_file "cleo\CMM.ini" section "Spenat" key "Y"0AF0: 3@ = get_int_from_ini_file "cleo\CMM.ini" section "Spenat" key "Z"02A8: 0@ = create_marker 41 at 1@ 2@ 3@








The only problem now is that the marker is created at Blueberry acres instead of the numbers I assigned to the X Y Z keywords.

Would appreciate further help very much.

Link to comment
Share on other sites

numbers must be floats not integers

He's right. The coordinates need to be floats. Just set the coordinates to local variables such as:


1@ = 882.02@ = 2012.03@ = 1002A8: 0@ = create_marker 41 at 1@ 2@ 3@end


That would be easier to manage cause you have the coords right in the script with you.

Link to comment
Share on other sites

bull.04 is right, and you can still use your ini file, just use 0AF2 instead of 0AF0:


EDIT: Sorry bull but i didnt read this:

That would be easier to manage cause you have the coords right in the script with you.
but i think he wants to store them in the ini because maybe he wants his script to be customized without the need of the user or himself to use sanny builder... specially if the user isnt interested in modding and doesnt want to install anything else like the decompiler...




0AF2: 1@ = get_FLOAT_from_ini_file "cleo\CMM.ini" section "Spenat" key "X"0AF2: 2@ = get_FLOAT_from_ini_file "cleo\CMM.ini" section "Spenat" key "Y0AF2: 3@ = get_FLOAT_from_ini_file "cleo\CMM.ini" section "Spenat" key "Z"



instead of


0AF0: 1@ = get_INT_from_ini_file "cleo\CMM.ini" section "Spenat" key "X"0AF0: 2@ = get_INT_from_ini_file "cleo\CMM.ini" section "Spenat" key "Y"0AF0: 3@ = get_INT_from_ini_file "cleo\CMM.ini" section "Spenat" key "Z"



And write this in the ini:





Edited by arielnmz
Link to comment
Share on other sites

Cool, my bad for the misunderstanding haha. Thought you could only get ints from ini files, but I guess you can get floats too haha.

Link to comment
Share on other sites

Thanks alot for the help guys. It's appreciated. biggrin.gif


Now I just need to figure out an good way to display an box with selections to the users (if possible) without sa:mp hating on me so much.


arielnmz was spot on regarding how user-friendly I want the script to be for those who might download it (But i'm going even further).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.