Deo skripte:
forward npcNapadni( playerid, id );
public npcNapadni( playerid, id )
{
if( NPC_ENUM[ id ][ npcNapada ] != INVALID_PLAYER_ID || NPC_ENUM[ id ][ npcMrtav ] != 0 || IsPlayerNPC( playerid ) || GetFactionType( playerid ) == ORG_TIP_PD ) return 1;
switch( id )
{
case 0: {
NPC_ENUM[ 0 ][ npcNapada ] = playerid;
npcPuca[ playerid ] = 0;
FCNPC_StopPlayingPlayback( NPC_ENUM[ 0 ][ npcID ] );
FCNPC_ClearAnimations( NPC_ENUM[ 0 ][ npcID ] );
FCNPC_AimAtPlayer( NPC_ENUM[ 0 ][ npcID ], playerid, true, -1, true, 0.0, 0.0, 0.0 );
}
case 1,2,3,4,6,7: {
NPC_ENUM[ id ][ npcNapada ] = playerid;
npcPuca[ playerid ] = id;
FCNPC_ClearAnimations( NPC_ENUM[ id ][ npcID ] );
FCNPC_AimAtPlayer( NPC_ENUM[ id ][ npcID ], playerid, true, -1, true, 0.0, 0.0, 0.0 );
}
}
return 1;
}
public FCNPC_OnTakeDamage( npcid, issuerid, Float:amount, weaponid, bodypart )
{
if( npcid == TrainDriverNPC ) return 0;
if( IsPlayerNPC( issuerid ) ) return 0;
if( npcid == NPC_ENUM[ 0 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
if( PlayerInfo[ issuerid ][ xClan ] != brodorg ) return 0;
if( NPC_ENUM[ 0 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 0 );
}
else if( npcid == NPC_ENUM[ 1 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
if( PlayerInfo[ issuerid ][ xClan ] != brodorg ) return 0;
if( NPC_ENUM[ 1 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 1 );
}
else if( npcid == NPC_ENUM[ 2 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
if( PlayerInfo[ issuerid ][ xClan ] != brodorg ) return 0;
if( NPC_ENUM[ 2 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 2 );
}
else if( npcid == NPC_ENUM[ 3 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
if( PlayerInfo[ issuerid ][ xClan ] != brodorg ) return 0;
if( NPC_ENUM[ 3 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 3 );
}
else if( npcid == NPC_ENUM[ 4 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
if( PlayerInfo[ issuerid ][ xClan ] != brodorg ) return 0;
if( NPC_ENUM[ 4 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 4 );
}
else if( npcid == NPC_ENUM[ 5 ][ npcID] && PlayerInfo[ issuerid ][ xClan ] != brodorg ) {
if( !IsPlayerInDynamicArea( issuerid, brodrob ) ) return 0;
return 0;
}
else if( npcid == NPC_ENUM[ 6 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, vhangar ) ) return 0;
if( GetFactionType( issuerid ) != ORG_TIP_BANDA ) return 0;
if( NPC_ENUM[ 6 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 6 );
}
else if( npcid == NPC_ENUM[ 7 ][ npcID ] ) {
if( !IsPlayerInDynamicArea( issuerid, vhangar ) ) return 0;
if( GetFactionType( issuerid ) != ORG_TIP_BANDA ) return 0;
if( NPC_ENUM[ 7 ][ npcNapada ] == INVALID_PLAYER_ID ) npcNapadni( issuerid, 7 );
}
return 1;
}
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): HVALA LIPA

