/spec ne radi za spec team

Započeo Jesteibice, Maj 07, 2020, 15:05:10 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Problem(error/warning):Dodao sam spec team u mod i omogucio im da koriste /spec ali kada igrac sa rankom xSpecTeam(spec team) ukuca /spec kamera stoji u mestu zamrznuta kao na slici (DESAVA SE SAMO SA SPEC TIM RANKOM!!!)
Dio skripte: [pawn]CMD:spec( playerid, params[] ) {

    if( PlayerInfo[ playerid ][ xAdmin ] >= 1 || PlayerInfo[ playerid ][ xSupporter ] >= 2 || PlayerInfo[ playerid ][ xSpecTeam ] >= 1  ) {

      new id;
       if( sscanf( params, "u", id ) ) return KORISCENJE( playerid, "/spec |  ID/Deo Imena  |" );
       if( id == IPI ) return GRESKA( playerid, "Nepostojeci ID.");
       if( id == playerid ) return GRESKA( playerid, "Nepostojeci ID.");
       AI[ playerid ][ aTSpec ]++;
       SacuvajAdmina( playerid );
      
        if( PlayerInfo[ playerid ][ xSupporter ] == 3 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
        if( PlayerInfo[ playerid ][ xSupporter ] == 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] == 0 ) return GRESKA( playerid, "Mozes specati samo Helpere." );
        }

        if( PlayerInfo[ playerid ][ xSupporter ] >= 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] >= 3 ) return GRESKA( playerid, "Ne mozes specati vodju Helpera." );
        }
        if( PlayerInfo[ playerid ][ xSpecTeam ] >= 1 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
      Spectate[ playerid ] = id;
      new Float:health;
      GetPlayerHealth( Spectate[ playerid ], health );

      if( WatchingTV{ playerid } == 0 ) {
         GetPlayerPos( playerid, SpecPos[ playerid ][ 0 ], SpecPos[ playerid ][ 1 ], SpecPos[ playerid ][ 2 ] );
         SpecVW[ playerid ] = GetPlayerVirtualWorld( playerid );
           SpecInt[ playerid ] = GetPlayerInterior( playerid );
      }

      new cash = PlayerInfo[ Spectate[ playerid ] ][ xNovac ];
      new specstring[ 180 ];
      format( specstring, sizeof( specstring ), "~y~ID: ~w~%d ~n~~y~Ime: ~w~%s ~n~~y~Novac: ~w~%d$ ~n~~y~Health: ~w~%1.f~n~~y~Oruzje: ~w~%s ( %dm )", id, ImeIgraca( id ), cash, health, WeaponInfos[ GetPlayerWeapon( id ) ][ wName ], GetPlayerAmmo( id ) );
      PlayerTextDrawSetString( playerid, SpecTextDraw[ playerid ], specstring );
      PlayerTextDrawShow( playerid, SpecTextDraw[ playerid ] );
      if( PlayerInfo[ playerid ][ xAdmin ] < 5 ) {
         format( globalstring, sizeof( globalstring ), "- SPEC - [%d]%s je zapoceo spec nad [%d]%s.", playerid, ImeIgraca( playerid ), id, ImeIgraca( id ) );
         AdminPoruka( SERVERBOJA, globalstring );
      }
      WatchingTV{ playerid } = 1;
      new string[ 128 ];
      format( string, sizeof( string ), "Admin %s je poceo spec nad igracom %s", ImeIgraca( playerid ), ImeIgraca( id ) );
      LogSave( "Ostalo/LogSPEC.log", string );
    } else return GRESKA( playerid, "Niste ovlasceni za koristenje ove komande!" );
    return true;
}[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): vaš odgovor
Slika/video ingame problema(obavezno ako je ingame problem): https://imgur.com/a/rc2qhmm
Poslednja Izmena: Maj 07, 2020, 15:07:05 POSLE PODNE od Jesteibice

[pawn]CMD:spec( playerid, params[] ) {

    if( PlayerInfo[ playerid ][ xAdmin ] >= 1 || PlayerInfo[ playerid ][ xSupporter ] >= 2 || PlayerInfo[ playerid ][ xSpecTeam ] >= 1  ) {

      new id;
       if( sscanf( params, "u", id ) ) return KORISCENJE( playerid, "/spec |  ID/Deo Imena  |" );
       if( id == IPI ) return GRESKA( playerid, "Nepostojeci ID.");
       if( id == playerid ) return GRESKA( playerid, "Nepostojeci ID.");
       AI[ playerid ][ aTSpec ]++;
       SacuvajAdmina( playerid );
      
        if( PlayerInfo[ playerid ][ xSupporter ] == 3 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
        if( PlayerInfo[ playerid ][ xSupporter ] == 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] == 0 ) return GRESKA( playerid, "Mozes specati samo Helpere." );
        }

        if( PlayerInfo[ playerid ][ xSupporter ] >= 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] >= 3 ) return GRESKA( playerid, "Ne mozes specati vodju Helpera." );
        }
        if( PlayerInfo[ playerid ][ xSpecTeam ] >= 1 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
      Spectate[ playerid ] = id;
      new Float:health;
      GetPlayerHealth( Spectate[ playerid ], health );

      if( WatchingTV{ playerid } == 0 ) {
         GetPlayerPos( playerid, SpecPos[ playerid ][ 0 ], SpecPos[ playerid ][ 1 ], SpecPos[ playerid ][ 2 ] );
         SpecVW[ playerid ] = GetPlayerVirtualWorld( playerid );
           SpecInt[ playerid ] = GetPlayerInterior( playerid );
      }
                TogglePlayerSpectating( playerid, true ); //<- Dodato
      new cash = PlayerInfo[ Spectate[ playerid ] ][ xNovac ];
      new specstring[ 180 ];
      format( specstring, sizeof( specstring ), "~y~ID: ~w~%d ~n~~y~Ime: ~w~%s ~n~~y~Novac: ~w~%d$ ~n~~y~Health: ~w~%1.f~n~~y~Oruzje: ~w~%s ( %dm )", id, ImeIgraca( id ), cash, health, WeaponInfos[ GetPlayerWeapon( id ) ][ wName ], GetPlayerAmmo( id ) );
      PlayerTextDrawSetString( playerid, SpecTextDraw[ playerid ], specstring );
      PlayerTextDrawShow( playerid, SpecTextDraw[ playerid ] );
      if( PlayerInfo[ playerid ][ xAdmin ] < 5 ) {
         format( globalstring, sizeof( globalstring ), "- SPEC - [%d]%s je zapoceo spec nad [%d]%s.", playerid, ImeIgraca( playerid ), id, ImeIgraca( id ) );
         AdminPoruka( SERVERBOJA, globalstring );
      }
      WatchingTV{ playerid } = 1;
      new string[ 128 ];
      format( string, sizeof( string ), "Admin %s je poceo spec nad igracom %s", ImeIgraca( playerid ), ImeIgraca( id ) );
      LogSave( "Ostalo/LogSPEC.log", string );
    } else return GRESKA( playerid, "Niste ovlasceni za koristenje ove komande!" );
    return true;
}[/pawn]
• Website: www.vasic.dev
Web Development & Cyber Security

Citat: Vasic poslato Maj 07, 2020, 19:09:47 POSLE PODNE
[pawn]CMD:spec( playerid, params[] ) {

    if( PlayerInfo[ playerid ][ xAdmin ] >= 1 || PlayerInfo[ playerid ][ xSupporter ] >= 2 || PlayerInfo[ playerid ][ xSpecTeam ] >= 1  ) {

      new id;
       if( sscanf( params, "u", id ) ) return KORISCENJE( playerid, "/spec |  ID/Deo Imena  |" );
       if( id == IPI ) return GRESKA( playerid, "Nepostojeci ID.");
       if( id == playerid ) return GRESKA( playerid, "Nepostojeci ID.");
       AI[ playerid ][ aTSpec ]++;
       SacuvajAdmina( playerid );
      
        if( PlayerInfo[ playerid ][ xSupporter ] == 3 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
        if( PlayerInfo[ playerid ][ xSupporter ] == 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] == 0 ) return GRESKA( playerid, "Mozes specati samo Helpere." );
        }

        if( PlayerInfo[ playerid ][ xSupporter ] >= 2 ) {
            if( PlayerInfo[ id ][ xSupporter ] >= 3 ) return GRESKA( playerid, "Ne mozes specati vodju Helpera." );
        }
        if( PlayerInfo[ playerid ][ xSpecTeam ] >= 1 ) {
            if( PlayerInfo[ id ][ xAdmin ] >=1 ) return GRESKA( playerid, "Ne mozes specati admine." );
      }
      Spectate[ playerid ] = id;
      new Float:health;
      GetPlayerHealth( Spectate[ playerid ], health );

      if( WatchingTV{ playerid } == 0 ) {
         GetPlayerPos( playerid, SpecPos[ playerid ][ 0 ], SpecPos[ playerid ][ 1 ], SpecPos[ playerid ][ 2 ] );
         SpecVW[ playerid ] = GetPlayerVirtualWorld( playerid );
           SpecInt[ playerid ] = GetPlayerInterior( playerid );
      }
                TogglePlayerSpectating( playerid, true ); //<- Dodato
      new cash = PlayerInfo[ Spectate[ playerid ] ][ xNovac ];
      new specstring[ 180 ];
      format( specstring, sizeof( specstring ), "~y~ID: ~w~%d ~n~~y~Ime: ~w~%s ~n~~y~Novac: ~w~%d$ ~n~~y~Health: ~w~%1.f~n~~y~Oruzje: ~w~%s ( %dm )", id, ImeIgraca( id ), cash, health, WeaponInfos[ GetPlayerWeapon( id ) ][ wName ], GetPlayerAmmo( id ) );
      PlayerTextDrawSetString( playerid, SpecTextDraw[ playerid ], specstring );
      PlayerTextDrawShow( playerid, SpecTextDraw[ playerid ] );
      if( PlayerInfo[ playerid ][ xAdmin ] < 5 ) {
         format( globalstring, sizeof( globalstring ), "- SPEC - [%d]%s je zapoceo spec nad [%d]%s.", playerid, ImeIgraca( playerid ), id, ImeIgraca( id ) );
         AdminPoruka( SERVERBOJA, globalstring );
      }
      WatchingTV{ playerid } = 1;
      new string[ 128 ];
      format( string, sizeof( string ), "Admin %s je poceo spec nad igracom %s", ImeIgraca( playerid ), ImeIgraca( id ) );
      LogSave( "Ostalo/LogSPEC.log", string );
    } else return GRESKA( playerid, "Niste ovlasceni za koristenje ove komande!" );
    return true;
}[/pawn]
Nista se ne menja

PlayerSpectatePlayer(playerid, id);
GAD SAM JA