Stopping npcs
#9

Quote:
Originally Posted by -Luis
Посмотреть сообщение
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;
}
looks right though the ID has no value to it. Meaning it's set default as '0'

To get the ID try attempt of my method. It works for my zombie script
Reply


Messages In This Thread
Stopping npcs - by Luis- - 09.11.2011, 23:37
Re: Stopping npcs - by Luis- - 10.11.2011, 07:36
Re: Stopping npcs - by MP2 - 10.11.2011, 07:39
Re: Stopping npcs - by Lorenc_ - 10.11.2011, 07:42
Re: Stopping npcs - by Luis- - 10.11.2011, 09:39
Re: Stopping npcs - by SiJ - 10.11.2011, 09:44
Re: Stopping npcs - by Lorenc_ - 10.11.2011, 09:46
Re: Stopping npcs - by Luis- - 11.11.2011, 17:56
Re: Stopping npcs - by Lorenc_ - 11.11.2011, 23:41
Re: Stopping npcs - by Luis- - 12.11.2011, 23:51

Forum Jump:


Users browsing this thread: 2 Guest(s)