Witam. Mógłby ktoś przerobić ten plugin tak aby przy trybie laser mine mina nie wybuchała przy kontakcie z tym co ja podkładał lub przy kontakcie z członkami własnego teamu?
Ew. jak pobrać ID gracza który tę minę postawił?
Dzięki za pomoc
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 08.03.2014 14:24
Witam. Mógłby ktoś przerobić ten plugin tak aby przy trybie laser mine mina nie wybuchała przy kontakcie z tym co ja podkładał lub przy kontakcie z członkami własnego teamu?
Ew. jak pobrać ID gracza który tę minę postawił?
Dzięki za pomoc
Napisano 08.03.2014 16:22
Pierw ustal sobie ownera entu przy tworzeniu za pomoca
set_pev( ent, pev_owner, index )
Pozniej id ownera wyciagniesz tak:
pev( ent, pev_owner )
Napisano 08.03.2014 16:41
Zrobiłem coś w tym stylu:
public trip_grenade_action(trip_grenade, TripGrenadeAction:action) { static hit, Float:origin[3], Float:point[3], trace = 0, Float:fraction, Float:normal[3], Float:temp[3], Float:end[3], Float:fly[3] pev(trip_grenade, pev_origin, origin) switch (action) { case TRIP_ACTION_INITIALIZE: { static loop[6][2] = { {2, 1}, {2, -1}, {0, 1}, {0, -1}, {1, 1}, {1, -1} } // Search in order: +Z axis -Z axis +X axis -X axis +Y axis -Y axis for (new i; i < 6; i++) { xs_vec_copy(origin, point) point[loop[i][0]] = origin[loop[i][0]] + (2.0 * float(loop[i][1])) engfunc(EngFunc_TraceLine, origin, point, IGNORE_MONSTERS, trip_grenade, trace) get_tr2(trace, TR_flFraction, fraction) if (fraction < 1.0) { hit = get_tr2(trace, TR_pHit) if (!is_attachable_surface(hit)) { set_grenade_type(trip_grenade, GRENADE_DUD) return } get_tr2(trace, TR_vecPlaneNormal, normal) set_trip_grenade_attached_to(trip_grenade, hit) // Calculate and store fly velocity. xs_vec_mul_scalar(normal, get_option_float(OPTION_TRIP_FLY_SPEED), temp) set_trip_grenade_fly_velocity(trip_grenade, temp) // Calculate and store endpoint. xs_vec_mul_scalar(normal, get_option_float(OPTION_TRIP_DETECT_DISTANCE), temp) xs_vec_add(temp, origin, end) // Trace to it engfunc(EngFunc_TraceLine, origin, end, IGNORE_MONSTERS, trip_grenade, trace) get_tr2(trace, TR_flFraction, fraction) // Final endpoint with no possible wall collision xs_vec_mul_scalar(normal, (get_option_float(OPTION_TRIP_DETECT_DISTANCE) * fraction), temp) xs_vec_add(temp, origin, end) set_trip_grenade_end_origin(trip_grenade, end) draw_line(origin, end, floatround(get_option_float(OPTION_TRIP_ARM_TIME) * 10.0)) set_trip_grenade_arm_time(trip_grenade, get_option_float(OPTION_TRIP_ARM_TIME)) play_sound(trip_grenade, DEPLOY) set_pev(trip_grenade, pev_velocity, Float:{0.0, 0.0, 0.0}) set_pev(trip_grenade, pev_sequence, 0) // Otherwise, grenade might make wierd motions. set_pev( trip_grenade, pev_owner, hit ) set_trip_grenade_mode(trip_grenade, TRIP_WAITING) return } } // If we reach here, we have serious problems. This means that the grenade hit something like a func_breakable // that disappeared before the scan was able to take place. Now, the grenade is floating in mid air. So we just // make it a dud. set_grenade_type(trip_grenade, GRENADE_DUD) } case TRIP_ACTION_WAIT: { if (!is_attachable_surface(get_trip_grenade_attached_to(trip_grenade))) { set_grenade_type(trip_grenade, GRENADE_DUD) return } static Float:gtime global_get(glb_time, gtime) if (gtime > get_trip_grenade_arm_time(trip_grenade)) { set_trip_grenade_mode(trip_grenade, TRIP_SCANNING) } } case TRIP_ACTION_SCAN: { if (!is_attachable_surface(get_trip_grenade_attached_to(trip_grenade))) { set_grenade_type(trip_grenade, GRENADE_DUD) return } get_trip_grenade_end_origin(trip_grenade, end) engfunc(EngFunc_TraceLine, origin, end, DONT_IGNORE_MONSTERS, 0, trace) if (is_user_alive(get_tr2(trace, TR_pHit))) { set_trip_grenade_mode(trip_grenade, TRIP_SHOULD_DETONATE) } } case TRIP_ACTION_DETONATE: { if(get_user_team(pev( trip_grenade, pev_owner )) == get_user_team(get_tr2(trace, TR_pHit))) return; get_trip_grenade_fly_velocity(trip_grenade, fly) get_trip_grenade_end_origin(trip_grenade, end) draw_line(origin, end, 1) // Draw a line to show the victim triggered a trip laser grenade. set_pev(trip_grenade, pev_velocity, fly) // Send the grenade on its way. play_sound(trip_grenade, ACTIVATE) set_grenade_type(trip_grenade, GRENADE_IMPACT) // Kaboom! } } }
Dodałem do kodu:
set_pev( trip_grenade, pev_owner, hit )
if(get_user_team(pev( trip_grenade, pev_owner )) == get_user_team(get_tr2(trace, TR_pHit))) return;
I nie działa.
Trochę strzelałem z tymi zmiennymi hit, trip_grenade itp. Dobrze to jest?
0 użytkowników, 0 gości, 0 anonimowych