Vp event set: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
No edit summary
 
Line 8: Line 8:
}</C>
}</C>
<C>vp_event_set(instance, VP_EVENT_AVATAR_ADD, avatar_add);</C>
<C>vp_event_set(instance, VP_EVENT_AVATAR_ADD, avatar_add);</C>
[[Category: SDK]]

Revision as of 20:13, 29 July 2012

<C>int vp_event_set(VPInstance instance, int eventname, void (*event)(VPInstance sender))</C>

Description

Sets a handler for a specific event.

Examples

<C>void avatar_add(VPInstance instance) {

   printf("%s enters.\n", vp_string(instance, VP_AVATAR_NAME));

}</C> <C>vp_event_set(instance, VP_EVENT_AVATAR_ADD, avatar_add);</C>