28.12.2009, 10:21
hmmm...not sure what you mean.. should xyinfrontofme under isplayerinpointofrange ?
well.. here is the whole npcscript to be sure;
well.. here is the whole npcscript to be sure;
Код:
#define RECORDING "npc15" #define RECORDING_TYPE 2 #include <a_npc> main(){} public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING); public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING); public OnNPCExitVehicle() StopRecordingPlayback(); forward OnNPCCheckplayer(); public OnNPCSpawn() { StartRecordingPlayback(RECORDING_TYPE, RECORDING); SetTimer("OnNPCCheckplayer",5000,1); return 1; } //------------------------------------------ stock GetXYInFrontOfMe(Float:x, &Float:y, Float:distance) { new Float:z,Float:a; GetMyPos( x, y, z); GetMyFacingAngle(a); x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); } //------------------------------------------ public OnNPCCheckplayer() { new Float:x, Float:y ; GetXYInFrontOfMe(x, y, 5.0); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 5.0, x,y,5.0)) { SendChat("I 'see' a player is in front of me !."); } }