28.09.2012, 03:48
Hello
I am using this code
I want that if player comes in range of npc he gets stoppped and when he goes out of npc range he resume walking.
I see the functions for it but i am confused where to put and how to use it also i got 2 npc in my gamemode so i dont want other one to get stopped too.
NPC name is Killer. Which i want to get stopped when player is in range of him and resume if player is not in range of him.
I am using this code
pawn Код:
public OnPlayerText(playerid, text[])
{
new Float:X, Float:Y, Float:Z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerNPC(i))
{
GetPlayerPos(i, X, Y, Z);
{
if(IsPlayerInRangeOfPoint(playerid,2.0, X, Y, Z ))
{
if (strfind(text, "browse") != -1)
{
Here Goes the dialog
}
}
}
}
}
I see the functions for it but i am confused where to put and how to use it also i got 2 npc in my gamemode so i dont want other one to get stopped too.
NPC name is Killer. Which i want to get stopped when player is in range of him and resume if player is not in range of him.