Help with FCNPC
#5

@Cryder please open the thread but i will help you, this is my function for CreateZombies, just add the CreateZombies(); under the OnGameModeInit and go at coordinates: 2232.1501,-1734.9570,13.3828

At the top #define MAX_ZOMBIES 2( change number )

pawn Code:
CreateZombies() {

    FCNPC_SetUpdateRate( 80 );
    for( new i = 0; i < MAX_NODES; i++ )
    {
        if( !FCNPC_IsNodeOpen( i ) && !FCNPC_OpenNode( i ) )
        {
            printf( "Gamemode: Failed to open node %d from (scriptfiles/FCNPC/Nodes/NODES%d.DAT)", i, i );
            return 0;
        }
    }
   
    for( new i = 0; i < MAX_ZOMBIES; i++ )
    {
        new
            name[ 24 ];
        format( name, 24, "ZOMBIE%d", i );
        new npcid = FCNPC_Create( name );
        FCNPC_Spawn( npcid, Skins[ random( 7 ) ], 0, 0, 0 );
        FCNPC_SetWeapon( npcid, 4 );
        FCNPC_SetHealth( npcid, 95 );
        if( IsPlayerNPC( i ) )
        {
            SetPlayerAttachedObject( i, 1, 2908, 2, 0.064999,0.045000,0.000999, 176.500000, 5.699998, 95.000007, 0.941999, 1.082999, 1.075000 );
            SetPlayerAttachedObject( i, 2, 2907, 1, 0.038000,0.051000,0.027000,-94.999984, -0.299995, 89.399932, 1.0, 0.739000, 1.211000 );
            SetPlayerAttachedObject( i, 3, 2906, 5, -0.146000,0.000000,-0.007000,10.299988,1.500002, -89.800010, 1.0, 1.0, 1.0 );
            SetPlayerAttachedObject( i, 4, 2905, 10, -0.176999,0.082000,0.005000, 0.000000, 0.000000, -92.700004,1.067999, 0.662999, 0.998000 );
            SetPlayerAttachedObject( i, 5, 2804, 8, 0.240999,0.034000,0.000000, 0.000000, 0.000000,91.499977, 0.757999, 1.000000, 1.214999 );
            SetPlayerAttachedObject( i, 5, 2803, 1,0.132999,-0.161000,0.000000, 0.000000,91.599998,102.699989, 0.259000,0.369999, 0.719000 );
        }

        new node = random( MAX_NODES );

        new vehnodes,
            pednodes,
            navinodes;
        FCNPC_GetNodeInfo( node, vehnodes, pednodes, navinodes );

        new
            point;
        if( random( 2 ) == 1 && pednodes != 0 )
            point = random( pednodes ) + pednodes;
        else
            point = random( pednodes );

        FCNPC_SetNodePoint( node, point );

        if( point < vehnodes )
        {
            new Float:x,
                Float:y,
                Float:z;
            FCNPC_GetNodePointPosition( node, x, y, z );
            FCNPC_SetPosition( npcid, x, y, z+1 );
        }
        FCNPC_PlayNode( npcid, node, point < pednodes ? NODE_TYPE_PED : NODE_TYPE_PED );
        SetPlayerColor( npcid, 0xAA333300 );
        FCNPC_SetPosition( npcid, 2232.1501,-1734.9570,13.3828 ); // CHANGE THE COORDINATES

    }
    return true;
}
Reply


Messages In This Thread
Help with FCNPC - by shulk - 03.03.2014, 12:02
Re: Help with FCNPC - by Pottus - 03.03.2014, 12:19
Re: Help with FCNPC - by shulk - 04.03.2014, 11:11
Re: Help with FCNPC - by Crayder - 07.03.2014, 23:05
Re: Help with FCNPC - by shulk - 08.03.2014, 08:34

Forum Jump:


Users browsing this thread: 3 Guest(s)