Jump to content

onElementCreated


LoPollo

Recommended Posts

Spoiler

50 4B 03 04 14 00 00 00 08 00 BA A5 79 49 39 0F 99 6E 89 00 00 00 B5 00 00 00 08 00 00 00 6D 65 74 61 2E 78 6D 6C 35 4E 3D 0B C2 30 10 9D 15 FC 0F C7 CD D2 EA DE B8 A8 93 08 9D DC 43 FA 4A 03 69 52 2E 57 A1 FF DE B4 EA F6 78 DF CD 08 B5 97 C3 7E D7 F8 D8 27 B2 B3 0E 49 0C 3F A5 7A 30 BD 21 D9 A7 68 F8 5C 9D 98 A2 1D 61 38 C5 7B C0 88 A8 57 81 55 74 4C 1D B2 13 3F E9 E6 BC 41 E1 34 93 5B D5 C2 50 EA A9 0D 76 29 4D 47 7A 61 F0 2E A0 A0 16 5D 66 AA B7 E1 6F 9A B2 38 C3 19 52 46 AB 30 5B 26 5D 26 FC 19 5E AD 4D FD 3B FB 01 50 4B 03 04 14 00 00 00 08 00 80 A5 79 49 0E 7C 8E 29 A3 00 00 00 1C 01 00 00 0A 00 00 00 73 65 72 76 65 72 2E 6C 75 61 75 4F 41 0E 82 40 0C 3C 4B C2 1F 1A 4E 90 60 82 C4 AB 27 24 72 F7 05 EB 6E 65 37 59 BA 66 29 BE DF 02 1A 13 89 A7 B6 93 99 E9 8C 32 A6 7D 22 71 0E 59 A0 D6 E3 20 7B 13 51 31 9A 0C 8A 34 49 13 1F B4 F2 C0 16 2F 33 DC 04 3F 5A F5 40 38 81 5E 68 02 34 D3 2D 38 93 C3 FE 50 57 55 55 6E 66 7D DC 8C D5 FA 3E 91 66 17 08 02 75 8E 73 EB F8 9D A0 84 41 B1 B6 8E FA B3 93 7B 14 8E 08 76 1C 5D DF 63 FC 1B B8 84 AF 85 F0 91 4C 9A 7C 0A 76 8A 8C C7 B8 C8 24 F3 75 2E 21 4F 45 F3 5B AD 5C E3 40 F1 02 50 4B 01 02 1F 00 14 00 00 00 08 00 BA A5 79 49 39 0F 99 6E 89 00 00 00 B5 00 00 00 08 00 24 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 6D 65 74 61 2E 78 6D 6C 0A 00 20 00 00 00 00 00 01 00 18 00 06 0C F3 87 54 47 D2 01 5B F5 96 63 54 47 D2 01 77 A8 20 F9 15 38 D2 01 50 4B 01 02 3F 00 14 00 00 00 08 00 80 A5 79 49 0E 7C 8E 29 A3 00 00 00 1C 01 00 00 0A 00 24 00 00 00 00 00 00 00 20 00 00 00 AF 00 00 00 73 65 72 76 65 72 2E 6C 75 61 0A 00 20 00 00 00 00 00 01 00 18 00 A5 68 38 44 54 47 D2 01 A9 1D 21 F9 15 38 D2 01 A9 1D 21 F9 15 38 D2 01 50 4B 05 06 00 00 00 00 02 00 02 00 B6 00 00 00 7A 01 00 00 00 00

That resource, which hex code i posted above, has the goal to detect when an element is created. This way i am only able to detect players, vehicles and peds creations. I could detect projectiles but there's already the client event so i didn't add these.

Is there any known way to detect the creation of:

1. Objects

2. Markers

3. Colshapes

4. Pickups

Link to comment

I don't think it's possible to overwrite a MTA func, i can exports functions but then the scripts should call that instead. 

Honestly the script is already completed since i only wanted to detect vehicles, and with the above script i'm able to detect players, vehicles and peds. Much more than i was aiming for. But it was intresting to see if there were ways to detect the elements i said, with an "invisible" script. That's also why i didn't want timers (still i don't like timers xD) and looping potentially big tables. Because the script must do its job in an "invisible" way. I was interested in more ways that achieve the job in these conditions :)

 

However if it's possible to "overwrite" mta functions... well explain, i'm interested :D

Edited by LoPollo
Link to comment

Well that only works within a resource, not globally for all resources.

If you do something like this:

_createObject = createObject

function createObject()

	--now whenever a scriptfile within that resource calls createObject this function will be used instead so you can handle things

end

If you still want to create the object you have to use _createObject inside there too.

  • Like 1
Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...