Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: noddy_ poslato Oktobar 18, 2021, 16:28:55 POSLE PODNE

Naslov: FCNPC ~ MW
Poruka od: noddy_ poslato Oktobar 18, 2021, 16:28:55 POSLE PODNE
Problem(error/warning): No errors no warnings, vec pljacka vojnog broda na MW modu ne radi, tj ja koliko god puta puco vojnike ne krecu se pa tako ni aimaju na mene ni pucaju...
Deo skripte:
[pawn]
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;
}

[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): HVALA LIPA
Naslov: Odg: FCNPC ~ MW
Poruka od: pokerface poslato Oktobar 18, 2021, 17:06:28 POSLE PODNE
Nisam siguran, ali mislim da bi od oka ovo trebalo da ide npcPuca[ playerid ] = 0; npcPuca[ playerid ] = id;

ili mora tako da ide za ID 0 NPC.  ::)
Naslov: Odg: FCNPC ~ MW
Poruka od: noddy_ poslato Oktobar 18, 2021, 17:08:12 POSLE PODNE
Citat: Hydra. poslato Oktobar 18, 2021, 17:06:28 POSLE PODNE
Nisam siguran, ali mislim da bi od oka ovo trebalo da ide npcPuca[ playerid ] = 0; npcPuca[ playerid ] = id;

ili mora tako da ide za ID 0 NPC.  ::)
Isto izbaci, evo ti sta meni ispise u logu
[pawn]
17:03:18] [FCNPC] Error: Incorrect parameter count for function 'FCNPC_AimAtPlayer'. 12 != 13.
[/pawn]
Naslov: Odg: FCNPC ~ MW
Poruka od: pokerface poslato Oktobar 18, 2021, 17:13:33 POSLE PODNE
Citat: ᴅ ɪ ɴ ᴏ poslato Oktobar 18, 2021, 17:08:12 POSLE PODNE
Isto izbaci, evo ti sta meni ispise u logu
[pawn]
17:03:18] [FCNPC] Error: Incorrect parameter count for function 'FCNPC_AimAtPlayer'. 12 != 13.
[/pawn]

Moras imati sve parametre tocne.

native FCNPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shoot_delay = -1, bool:set_angle = true, Float:offset_x = 0.0, Float:offset_y = 0.0, Float:offset_z = 0.0, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0, between_check_mode = FCNPC_ENTITY_MODE_AUTO, between_check_flags = FCNPC_ENTITY_CHECK_ALL);
Naslov: Odg: FCNPC ~ MW
Poruka od: noddy_ poslato Oktobar 18, 2021, 17:26:47 POSLE PODNE
Citat: Hydra. poslato Oktobar 18, 2021, 17:13:33 POSLE PODNE
Moras imati sve parametre tocne.

native FCNPC_AimAtPlayer(npcid, playerid, bool:shoot = false, shoot_delay = -1, bool:set_angle = true, Float:offset_x = 0.0, Float:offset_y = 0.0, Float:offset_z = 0.0, Float:offset_from_x = 0.0, Float:offset_from_y = 0.0, Float:offset_from_z = 0.0, between_check_mode = FCNPC_ENTITY_MODE_AUTO, between_check_flags = FCNPC_ENTITY_CHECK_ALL);
Plugin verzija je bila problem, ali zato resetaju ko ludi a health ne opada, ali to samo smanjim u FCNPC opcijama.A tebi hvala na odvojenom vremenu!