Jump to content

Is it possible to create an event ?


Recommended Posts

Hello community..

As the title says " Is it possible to create an event " ?

some time i search about events and i dont find it so is it possible to create an event ? like onPlayerTeamChange, onPlayerElementDateChange and so on. i think it possible by exporting ?? if yes then can some one explain me how to export ? or give me a clear TUT about exporting that i can really learn from it.

really this coding thingy made me mad when i finish something and be good on it i deduce that i should learn another thing and so on finished learning MTA lua 90% then i deduced that there is mySQL and SQLite and so on :shock: . well never mind about my story lets talk about this topic's target >> is it possible to create an event ??. Thanks

Edited by Guest
Link to comment
It is. In last topic I created for you one, but I think event onElementDataChange is global event.

Yea i know, but idk how you created it, thats why i made this topic. to let someone explain me how or give me a TUT :)

Edited by Guest
Link to comment

hmmm i dont understand this part

_setPlayerTeam = setPlayerTeam 

why you put _ ?? i will tell you what i think and you tell me its right or wrong ..

_ExportName? = IDKThisPart 

after _HereIsTheExportName right ? answer this

another ques : what is that part ? >> IDKThisPart

Link to comment
I just created variable named real function. For example
_setElementData = setElementData 

And then you return

return _setElementData ( player, name, value )  

i think i got it 50%, let me explain what i learned : for example i want to export outputChatBox >

_ExportName = outputChatBox 

return

return _ExportName ( source ) 

hmm ? :D

Link to comment

Well, but to do this event you need addEvent. For example

_destroyElement = destroyElement 
  
addEvent ( "onElementDestroy", true ) 
  
function destroyElement ( element ) 
    triggerEvent ( "onElementDestroy", root, element ) 
    return _destroyElement ( element ) 
end 

Link to comment
Ahh realy?

This function allows you to register a custom event. Custom events function exactly like the built-in events. See event system for more information on the event system.

i know i know, all what i meant is : i must create an export for the event i will add. understood ? else its using only for triggering .. .............is that right ? @WhoAmI ?

Link to comment
LOOOL. Its is to create new events. Have you seen some resources it has events. (NOT EXPORTS). I have seen one . Its something of Bank system.

dude, as i learned in scripting and as i learned from WhoAmI in this topic i deduced that > addEvent is to add an event which can be triggered to another global event. it will be useless if its not triggered to another global event .. Got it ?

Edited by Guest
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...