version 1.22 | | version 1.23 |
---|
| | |
context->activator = NULL; | | context->activator = NULL; |
context->third = NULL; | | context->third = NULL; |
rv = context->returnvalue = 0; | | rv = context->returnvalue = 0; |
| | snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_event.py")); |
switch(context->event_code) | | switch(context->event_code) |
{ | | { |
case EVENT_CRASH: | | case EVENT_CRASH: |
| | |
case EVENT_BORN: | | case EVENT_BORN: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->activator = Crossfire_Object_wrap(op); | | context->activator = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_born.py")); | | |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_PLAYER_DEATH: | | case EVENT_PLAYER_DEATH: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->who = Crossfire_Object_wrap(op); | | context->who = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_player_death.py")); | | snprintf(context->options,sizeof(context->options),"death"); |
cfob = (Crossfire_Object*)context->who; | | cfob = (Crossfire_Object*)context->who; |
break; | | break; |
case EVENT_GKILL: | | case EVENT_GKILL: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->who = Crossfire_Object_wrap(op); | | context->who = Crossfire_Object_wrap(op); |
context->activator = Crossfire_Object_wrap(op); | | context->activator = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_gkill.py")); | | snprintf(context->options,sizeof(context->options),"gkill"); |
cfob = (Crossfire_Object*)context->who; | | cfob = (Crossfire_Object*)context->who; |
break; | | break; |
case EVENT_LOGIN: | | case EVENT_LOGIN: |
| | |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_login.py")); | | snprintf(context->options,sizeof(context->options),"login"); |
cfpl = (Crossfire_Player*)context->activator; | | cfpl = (Crossfire_Player*)context->activator; |
break; | | break; |
case EVENT_LOGOUT: | | case EVENT_LOGOUT: |
| | |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_logout.py")); | | snprintf(context->options,sizeof(context->options),"logout"); |
cfpl = (Crossfire_Player*)context->activator; | | cfpl = (Crossfire_Player*)context->activator; |
break; | | break; |
case EVENT_REMOVE: | | case EVENT_REMOVE: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->activator = Crossfire_Object_wrap(op); | | context->activator = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_remove.py")); | | snprintf(context->options,sizeof(context->options),"remove"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_SHOUT: | | case EVENT_SHOUT: |
| | |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_shout.py")); | | snprintf(context->options,sizeof(context->options),"shout"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_MUZZLE: | | case EVENT_MUZZLE: |
| | |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_muzzle.py")); | | snprintf(context->options,sizeof(context->options),"muzzle"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_KICK: | | case EVENT_KICK: |
| | |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_kick.py")); | | snprintf(context->options,sizeof(context->options),"kick"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_MAPENTER: | | case EVENT_MAPENTER: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->activator = Crossfire_Object_wrap(op); | | context->activator = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_mapenter.py")); | | snprintf(context->options,sizeof(context->options),"mapenter"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_MAPLEAVE: | | case EVENT_MAPLEAVE: |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
context->activator = Crossfire_Object_wrap(op); | | context->activator = Crossfire_Object_wrap(op); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_mapleave.py")); | | snprintf(context->options,sizeof(context->options),"mapleave"); |
cfob = (Crossfire_Object*)context->activator; | | cfob = (Crossfire_Object*)context->activator; |
break; | | break; |
case EVENT_CLOCK: | | case EVENT_CLOCK: |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_clock.py")); | | snprintf(context->options,sizeof(context->options),"clock"); |
break; | | break; |
case EVENT_MAPRESET: | | case EVENT_MAPRESET: |
buf = va_arg(args, char*); | | buf = va_arg(args, char*); |
if (buf !=NULL) | | if (buf !=NULL) |
snprintf(context->message, sizeof(context->message), "%s", buf); | | snprintf(context->message, sizeof(context->message), "%s", buf); |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_mapreset.py")); | | snprintf(context->options,sizeof(context->options),"mapreset"); |
break; | | break; |
case EVENT_TELL: | | case EVENT_TELL: |
snprintf(context->script, sizeof(context->script), "%s", cf_get_maps_directory("python/events/python_tell.py")); | | snprintf(context->options,sizeof(context->options),"tell"); |
break; | | break; |
} | | } |
va_end(args); | | va_end(args); |