22.08.2010, 06:31
put it in npcmodes folder.
didn't optimized the code.
pawn Код:
#include <a_npc>
//------------------------------------------
#define YOUR_DISTANCE 5.0
main()
{
SetTimer( "Check", 1000, 1 );
}
forward public Check();
public Check()
{
new Float:npc_pos[3];
GetMyPos( npc_pos[0], npc_pos[1], npc_pos[2] );
for( new i = 0 ; i < MAX_PLAYERS ; i ++)
{
if( IsPlayerConnected(i) && !IsPlayerNPC(i) )
{
if( IsPlayerInRangeOfPoint( i , YOUR_DISTANCE, npc_pos[0], npc_pos[1], npc_pos[2] ) )
{
SendChat( "Hey~ I wanna take you to a gay bar!" );
}
}
}
}
didn't optimized the code.