I've been using this and here's my code, which fails I know xD, is there any problems with it?
pawn Код:
forward BotChecks(playerid);
public BotChecks(playerid)
{
new Float:pPos[3], Float:Pos[3], Float:npPos[4], Float:nPos[3], string[100], id;
GetPlayerPos(id, npPos[0], npPos[1], npPos[2]);
GetPlayerFacingAngle(id, npPos[3]);
Pos[0] = npPos[0] + ( 15.5 * floatcos(npPos[3], degrees) );
Pos[1] = npPos[1] + ( 15.5 * floatsin(npPos[3], degrees) );
if(IsPlayerInRangeOfPoint(playerid, 15.5, Pos[0], Pos[1], npPos[2]))
{
TogglePlayerControllable(id, 0);
SetTimer("NPCFreeze", 6000, false);
}
return 1;
}
forward NPCFreeze(playerid);
public NPCFreeze(playerid)
{
new string[128], id;
format(string, sizeof(string), "%s[%d]: {FFFFFF}Hey! %s move out the way. I'm trying to do my job here!", Name(id), id, Name(playerid));
SendClientMessageToAll(GetPlayerColor(id), string);
TogglePlayerControllable(id, 1);
return 1;
}