Celownik na graczu lub zakładniku
DarkGL
17.11.2009
Czy jest jakiś sposób żeby wywołać funkcje wtedy gdy gracz nakieruje celownikiem na innego gracza lub zakładnika ?
Vertricus
17.11.2009
Że jak naceluje i cały czas ma sprawdzać?:>
To ja bym to tak zrobił:
Nie wiem czy jeszcze nie trzeba dodać żeby sprawdzało czy cel != 0
To ja bym to tak zrobił:
public client_PreThink(id) { new cel, body get_user_aiming(id, cel, body) if(is_user_alive(cel) && is_user_alive(id)) { set_hudmessage(255, 212, 0, -1.0, 0.7, 0, 6.0, 0.1) show_hudmessage(id, "Cze co tam.") } }
Nie wiem czy jeszcze nie trzeba dodać żeby sprawdzało czy cel != 0
mgr inż. Pavulon
17.11.2009
Może przetestuj a się przekonasztylk oczy to zadziała na zakładników ?
[ Dodano: 17-11-2009, 16:40 ]
http://www.amxmodx.o...?go=func&id=148
get_user_aiming [ Main ] [ Core ] [ amxmodx.inc ] [ comments ] get_user_aiming - Traces where a player is aiming for a maximum distance. Syntax: Float: get_user_aiming ( index, &id, &body, [ distance = 9999 ] ) Type: Native Notes: index is a player index from 1 to 32. If the player's aim doesn't hit anything, 0.0 is returned. If the player is aiming at another player, then the id and part of the body is set into the second and third parameters (passed by reference). Otherwise, the distance between the hit point and the player is returned. distance is defaulted to a maximum of 9999.
User Contributed Notes kost at rainside dot de Jan-22-06 10:03:30 this also returns an ent_id (victim) > 0 if you are aiming at an entity which is not a player.
DarkGL
17.11.2009
pavulon dzięki działa dla zakładników
public client_PreThink(id) { new cel, body get_user_aiming(id, cel, body) if(cel != 0 && is_user_alive(id)) { ShowHUD(id) } }