NPC problem
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "door", true) != -1)
    {
        new NPCID = GetPlayerIDFromName("Cadet_Two");
        new Float:x,Float:y,Float:z;
        GetPlayerPos(NPCID,x,y,z);
        if(IsPlayerInRangeOfPoint(playerid,15,x,y,z))
        {
            if(IsACop(playerid) || IsAnAgent(playerid))
            {
                if(SFPD_Door[Opened] == 0)
                {
                    MoveObject(SFPD_Door[ObjectID3], 253.19029236, 106.5986328125, 1002.21875000, 1.50);
                    MoveObject(SFPD_Door[ObjectID4], 253.19029236, 111.578125, 1002.21875000, 1.50);
                    SFPD_Door[Opened] = 2; SFPD_Door[TimerID]= SetTimer("PDDoorCheck", 5000, 0);
                    MoveObject(SFPD_Door[ObjectID3], 253.19029236, 106.5986328125, 1002.21875000, 1.50);
                    MoveObject(SFPD_Door[ObjectID4], 253.19029236, 111.578125, 1002.21875000, 1.50);
                    SFPD_Door[Opened] = 2; SFPD_Door[TimerID]= SetTimer("PDDoorCheck", 5000, 0);
                    SetPlayerChatBubble(NPCID, "Certainly sir, the doors have been opened.", 0xFF0000FF, 100.0, 3000);
                }
            }
            else
            {
                SetPlayerChatBubble(NPCID, "I'm sorry sir, but you're not an officer", 0xFF0000FF, 100.0, 3000);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
NPC problem - by Jack Shred - 13.08.2011, 17:09
Re: NPC problem - by Jack Shred - 13.08.2011, 23:52
Re: NPC problem - by Adil - 14.08.2011, 15:37

Forum Jump:


Users browsing this thread: 1 Guest(s)