Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Narkomann poslato Decembar 05, 2018, 22:15:30 POSLE PODNE

Naslov: Register
Poruka od: Narkomann poslato Decembar 05, 2018, 22:15:30 POSLE PODNE
Problem(error/warning):Znaci koristim mod od "Real Gaming v4.0 by Nelson" I sad kada se novi igrac registrira i odradi sve ljepo i na pocetku se nalazi u nekom enterijeru koji nije na srw (ne moze se izaci iz njega itd), takodje je freezovan, te ako se igrac ubije on ide opet na register (mora upisat pw,gmail itd ponovo)te opet kad zavrsi ako se ubije on opet ide na register.. Jedino ako napravi relog onda upise sifru i radi ko normalno.. Zna netko od prilike kako bi se to moglo rjesiti?
Dio skripte: [ pawn ]//[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem): //
Naslov: Odg: Register
Poruka od: ShomY071 poslato Decembar 05, 2018, 22:28:20 POSLE PODNE
Stvar je jasna, postavi ovde celu registraciju .
Naslov: Odg: Register
Poruka od: Narkomann poslato Decembar 05, 2018, 22:39:47 POSLE PODNE
Ne znam da li sam dobro dao ali evo
[pawn]
public Register( playerid ) {
    //TogglePlayerSpectating( playerid, 1 );
    TextDrawShowForPlayer(playerid,lbt);
   TextDrawShowForPlayer(playerid,lbb);
    InterpolateCameraPos( playerid, 501.1220, -2123.5720, 61.1148, 599.5076, -1907.3519, 61.1148, 25000 );
   InterpolateCameraLookAt( playerid, 00.2217, -2123.1355, 60.7137, 598.5964, -1906.9376, 60.7237, 10000 );
    ClearChat( playerid, 25 );
    SendClientMessage(playerid, SVETLOPLAVA, "Vase korisnicko {FFFFFF}Ime {00C0FF}nije Registrirano | Molimo registrujte se na {FFFFFF}server {00C0FF}da biste mogli igrati!.");
   format( sDStrg, sizeof( sDStrg ),DialogTekstovi[ 4 ], ImeIgraca(playerid) );
   SPD( playerid, dialog_REGISTER, DSP, "{00C0FF}Registracija", sDStrg, D_ODABERI, D_ODUSTANI );
   sDStrg = "\0";
   IgracSeRegistruje[ playerid ] = true;

   return true;
}

forward Dimi_Kick( playerid );
public Dimi_Kick( playerid ) {
    SetTimerEx( "KickIgraca", 1000, 0, "d", playerid );
}

stock GPSpeed( playerid ) {

    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
    return floatround(ST[3]);
}

public OnPlayerConnect( playerid ) {

    ServerInfo[ BrojPosetaServeru ]++;
   
   ServerInfo[OnlineIgraca]++;
    ObrisiObjekte( playerid );
   
    ResetPlayer( playerid );
   
   SetPlayerVirtualWorld(playerid, (playerid + 2000));
    SetPlayerColor(playerid, 0xAFAFAF00);

   CreatePlayerTextDraws( playerid );
   PreloadAnimations( playerid );

    new playersip[ 128 ];
    GetPlayerIp( playerid, playersip, sizeof( playersip ) );
   new string[ 128 ];
   
   format( string, sizeof( string ), "Igrac: %s | IP: %s ", ImeIgraca( playerid ), playersip );
   LogSave( "Ostalo/LogConnect.log", string );

    LoginTD_2[playerid] = CreatePlayerTextDraw(playerid, 100.000000, 13.000000, "dizey_hawkinson");
   PlayerTextDrawAlignment(playerid, LoginTD_2[playerid], 2);
   PlayerTextDrawBackgroundColor(playerid, LoginTD_2[playerid], 255);
   PlayerTextDrawFont(playerid, LoginTD_2[playerid], 3);
   PlayerTextDrawLetterSize(playerid, LoginTD_2[playerid], 0.270000, 1.200000);
   PlayerTextDrawColor(playerid, LoginTD_2[playerid], 11796479);
   PlayerTextDrawSetOutline(playerid, LoginTD_2[playerid], 1);
   PlayerTextDrawSetProportional(playerid, LoginTD_2[playerid], 1);
   PlayerTextDrawSetSelectable(playerid, LoginTD_2[playerid], 0);


    if( fexist( StariKorisnici( playerid ) ) )
   {
       SetTimerEx( "LoginStari", 100, false, "d", playerid );
   }
   else
   {
      if( fexist( Korisnici( playerid ) ) )
      {
          INI_ParseFile( Korisnici( playerid ), "OcitajKorisnika", .bExtra = true, .extra = playerid);

         if( PlayerInfo[ playerid ][ xBDays ] > 0) {
             new year,day,month;
            getdate( year, month, day );

            if( PlayerInfo[ playerid ][ xBDays ] > day && PlayerInfo[ playerid ][ xBMonths ] >= month && PlayerInfo[ playerid ][ xBYears ] >= year ) {
               SCM( playerid, CRVENA, "__________________BAN________________");
               SendClientMessageEx( playerid, BELA, ""col_white"Banovan si sa ovog servera do "col_RG"%d/%d/%d"col_white".", PlayerInfo[ playerid ][ xBDays ], PlayerInfo[ playerid ][ xBMonths ], PlayerInfo[ playerid ][ xBYears ] );
               SCM( playerid, BELA, ""col_white"Ukoliko mislis da je ovo greska.");
               SCM( playerid, BELA, ""col_white"Zahtev za unban mozes traziti na "col_RG"forumu."col_white"");
               SCM( playerid, BELA, ""col_white"Forum: "col_RG"www.Balkan House-samp.com");
               SCM( playerid, CRVENA, "_____________________________________");
               Kickovanje( playerid, " ");
               return 1;
            }
         }

           if( PlayerInfo[ playerid ][ xBDays ] > 0) {
               new year,day,month;
            getdate( year, month, day );
               if( PlayerInfo[ playerid ][ xBDays ] < day ){
               PlayerInfo[ playerid ][ xBDays ] = 0;
            }
         }

         if( PlayerInfo[ playerid ][ xRegistrovan ] == 1 ) {
             SetTimerEx( "Login", 100, false, "d", playerid );
         }
         else {

             if( ServerInfo[ Registracija ] == false ) {

                 SendClientMessage( playerid, CRVENA, "REGISTRACIJA JE TRENUTNO ONEMOGUCENA." );
                 SendClientMessage( playerid, CRVENA, "Balkan House ADMIN TEAM." );
                 SetTimerEx( "KickIgraca", 150, false, "d", playerid );
                 return 1;
             }

            SetTimerEx( "Register", 100, false, "d", playerid );
         }
      }
      else {
          if( !IsValidRoleplayName( ImeIgraca( playerid ) ) ) {
            SendClientMessage( playerid, CRVENA, "Dobili ste kick zbog krivo formatiranog imena!" );
            SendClientMessage( playerid, CRVENA, "Vase ime mora biti u formatu Ime_Prezime!" );
            SetTimerEx( "KickIgraca", 150, false, "d", playerid );
            return 1;
         }

          if( ServerInfo[ Registracija ] == false ) {

            SendClientMessage( playerid, CRVENA, "REGISTRACIJA JE TRENUTNO ONEMOGUCENA." );
            SendClientMessage( playerid, CRVENA, "Balkan House ADMIN TEAM." );
            SetTimerEx( "KickIgraca", 150, false, "d", playerid );
               return 1;
          }

          SetTimerEx( "Register", 100, false, "d", playerid );
      }
   }
   proveriAlias( playerid );
   return true;
[/pawn]
Jos sam ovo naso
[pawn]
else if( dialogid == dialog_REGISTER ) {
      if( !response ) return 1;
      if( response ) {
         if( strlen( inputtext ) < 6 || strlen(inputtext) > 20 ) {
             new StringDialogce[512];
             format( StringDialogce, sizeof( StringDialogce ),DialogTekstovi[ 4 ], ImeIgraca(playerid) );
            SPD( playerid, dialog_REGISTER, DSP, "{00C0FF}Registracija", StringDialogce, D_ODABERI, D_ODUSTANI );
            StringDialogce = "\0";
            SendErrorMessage(playerid, "Lozinka mora sadrzati minimum 6 a najvise 20 karaktera.");
            return 1;
         }
         else {
            strmid( PlayerInfo[ playerid ][ xLozinka ], inputtext, 0, strlen( inputtext ), 50);
            PlayerInfo[ playerid ][ xRegStep ] = 1;
            Dimi_SetSpawnInfo( playerid );
            SpawnPlayer( playerid );
[/pawn]
Naslov: Odg: Register
Poruka od: Balsa. poslato Decembar 06, 2018, 10:44:48 PRE PODNE
Za to freezanje stavi pod onplayer spawn ili pod dimi spawn (nezz sta koristis)TogglePlayerControllable(playerid, 1);

Posalji sad sto pise pod onplayerspawn i ojplayerdeath i dimi_setspawninfo
Naslov: Odg: Register
Poruka od: Narkomann poslato Decembar 06, 2018, 19:46:49 POSLE PODNE
OnPlayerSpawn:
[pawn]
public OnPlayerSpawn( playerid ) {

    SetPlayerColor( playerid, 0xFFFFFF00 );
   
   if(PlayerInfo[ playerid ][ xRegStep ] == 1)
   {
      SetPlayerInterior(playerid, 3);
      Dimi_SetPlayerPos(playerid, 330.6825,163.6688,1014.1875);
      SetPlayerFacingAngle(playerid, 280);
      TogglePlayerControllable(playerid, 0);
      ClearChat(playerid, 10);
      SendClientMessage(playerid, SVETLOPLAVA, "Dobrodosli na Balkan House RolePlay...");
      SendClientMessage(playerid, SVETLOPLAVA, "...postujte sva pravila servera i budite RolePlay igrac!Sada ispunite sljedece podatke...");
      //ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "{00C0FF}Registracija - {F3FF02}Koji ste spol?", "Musko \nZensko", "U redu", "Odustani");
      SPD( playerid, dialog_MAIL, DSI, "{00C0FF}Registracija - {F3FF02}Email adresa", "{FFFFFF}U prazni prostor ispod unesite vasu e-mail adresu.\nE-mail adresa ce nam posluziti u vracanju vasih passworda.(Bez maila nema vracanja passworda)", "Unos", "Izlaz");
      ClearChat(playerid, 2);
      return 1;
[/pawn]
ONPLAYER DEATH
[pawn]public OnPlayerDeath( playerid, killerid, reason ) {

   for( new w = 1; w < MAX_WARS; w ++) {
       if( killerid != INVALID_PLAYER_ID ) {
         if( WARInfo[ w ][ WARAktivan ] == true && WARPInfo[ playerid ][ WARIgrac ] == w && WARPInfo[ killerid ][ WARIgrac ] == w ) {
            WARPInfo[ killerid ][ WARUbistva ]++;
               WARPInfo[ playerid ][ WARSmrti ]++;
               new scm_string[ 128 ];
            if( WARPInfo[ playerid ][ WARTim ][ 0 ] == true && WARPInfo[ killerid ][ WARTim ][ 0 ] == true ) {
               WARInfo[ w ][ WARTimSkor ][ 0 ] -= 3;
                 format( scm_string, sizeof( scm_string ), "(WAR) %s je ubio svog saigraca %s, te je njegov tim dobio -3 poena.", ImeIgraca( killerid ), ImeIgraca( playerid ) );
                 WARPoruka( w, WARLJUB, scm_string );
                 SetWarStatsTD( w );
            }
            if( WARPInfo[ playerid ][ WARTim ][ 1 ] == true && WARPInfo[ killerid ][ WARTim ][ 1 ] == true ) {
               WARInfo[ w ][ WARTimSkor ][ 1 ] -= 3;
                 format( scm_string, sizeof( scm_string ), "(WAR) %s je ubio svog saigraca %s, te je njegov tim dobio -3 poena.", ImeIgraca( killerid ), ImeIgraca( playerid ) );
                 WARPoruka( w, WARLJUB, scm_string);
                 SetWarStatsTD( w );
            }
            if( WARPInfo[ killerid ][ WARTim ][ 0 ] == true && WARPInfo[ playerid ][ WARTim ][ 1 ] == true ) {
                 WARInfo[ w ][ WARTimSkor ][ 0 ]++;
                    format( scm_string, sizeof( scm_string ),"(WAR) %s je ubio protivnika %s!", ImeIgraca( killerid ), ImeIgraca( playerid ) );
                    WARPoruka( w, WARLJUB, scm_string );
                 SetWarStatsTD( w );
            }
            if( WARPInfo[ killerid ][ WARTim ][ 1 ] == true && WARPInfo[ playerid ][ WARTim ][ 0 ] == true ) {
                 WARInfo[ w ][ WARTimSkor ][ 1 ]++;
               format( scm_string, sizeof( scm_string ),"(WAR) %s je ubio protivnika %s!", ImeIgraca( killerid ), ImeIgraca( playerid ) );
                  WARPoruka( w, WARLJUB, scm_string );
                 SetWarStatsTD( w );
            }
            return 1;
         }
      }
   }
   
   PlayerInfo[ playerid ][ xSpawned ] = 0;
   
    if( NaDmEventu[ playerid ] == true ) {
        new scm_string[ 128 ];
        if( killerid != INVALID_PLAYER_ID && NaDmEventu[ killerid ] == true ) {
            PlayerInfo[ killerid ][ xDMEventUbistva ]++;
            format( scm_string, sizeof( scm_string ),"(DM Zona) %s je ubio %s!", ImeIgraca( killerid ), ImeIgraca( playerid ) );
          DMZPoruka( WARLJUB, scm_string );
        }
        return 1;
    }
   
    if( PlayerInBlowJob[ playerid ] != 0 ) {

      switch( PlayerInBlowJob[ playerid ] ) {

           case 1: {

            DestroyActor( Sex_Lisa );
            WhoreLisa = false;
         }
           case 2: {

            DestroyActor( Sex_Angelina );
            WhoreAngelina = false;
         }
           case 3: {

            DestroyActor( Sex_Mia );
            WhoreMia = false;
         }
           case 4: {

            DestroyActor( Sex_Sendy );
            WhoreSendy = false;
         }
      }

      StopAudioStreamForPlayer( playerid );
       SetCameraBehindPlayer( playerid );
        PlayerInBlowJob[ playerid ] = 0;
       SexTDControl( playerid, false );
       BlowJobCount[ playerid ] = 0;
       TogPlayerHud( playerid );
       TogglePlayerControllable( playerid, ( true ) );
      ClearAnimations( playerid );
       Dimi_KillTimer( PusenjeTimer[ playerid ] );
   }
   
   antiCheatCS[ playerid ][ TeleportCheck ] = 2;
   antiCheatCS[ playerid ][ WeaponDetect ] = 2;
   
   Dimi_KillTimer( fishermanInfo[ playerid ][ fsTimer ] );
   
   if( SearchNadji[ playerid ] != -1 ) {
   
      SearchNadji[ playerid ] = -1;
      Dimi_DisablePlayerCheckpoint( playerid );
   }
   
   if( ListaPrikazana[ playerid ] ) {
      KladionicaTDControl( playerid, false );
   }
    if( MojListicPrikazan[ playerid ] ) {
      KladionicaListicTDControl( playerid, false );
   }
   if( RezultatiPrikazana[ playerid ] ) {
      RezultatiTDControl( playerid, false );
   }
   
   if( ( gettime( ) - FakeKillTime[ playerid ] ) < 5 ) {

       FakeKillPlus[ playerid ]++;
       if( FakeKillPlus[ playerid ] >= 3 ) {
          
           format( globalstring, sizeof( globalstring ), "| BH:AC | %s je kickovan sa servera. Razlog: "col_white"Fake kill", ImeIgraca( playerid ) );
         AdminPoruka( SVETLOCRVENA, globalstring );
         Kickovanje( playerid, ""col_white"Ti si kickovan sa servera. Razlog: "col_RG"Fake kill");
       }
       FakeKillTime[ playerid ] = gettime( );
       return 0;
   }[/pawn]
DIMI_SETSPAWNIFNO
[pawn]
forward Dimi_SetSpawnInfo( playerid );
public Dimi_SetSpawnInfo( playerid ) {
   new rand;

   if( playerid % 2 == 0 ) {
      rand = random( sizeof( RandomLSSpawn1 ) );
      antiCheatCS[ playerid ][ TeleportPos ][ 0 ] = RandomLSSpawn1[ rand ][ 0 ];
      antiCheatCS[ playerid ][ TeleportPos ][ 1 ] = RandomLSSpawn1[ rand ][ 1 ];
      antiCheatCS[ playerid ][ TeleportPos ][ 2 ] = RandomLSSpawn1[ rand ][ 2 ];
      SetSpawnInfo( playerid, 0, PlayerInfo[ playerid ][ xSkin ], RandomLSSpawn1[ rand ][ 0 ], RandomLSSpawn1[ rand ][ 1 ], RandomLSSpawn1[ rand ][ 2 ], 360.00, 0, 0, 0, 0, 0, 0 );
   }
   else {
      rand = random( sizeof( RandomLSSpawn2 ) );
      antiCheatCS[ playerid ][ TeleportPos ][ 0 ] = RandomLSSpawn2[ rand ][ 0 ];
      antiCheatCS[ playerid ][ TeleportPos ][ 1 ] = RandomLSSpawn2[ rand ][ 1 ];
      antiCheatCS[ playerid ][ TeleportPos ][ 2 ] = RandomLSSpawn2[ rand ][ 2 ];
      SetSpawnInfo( playerid, 0, PlayerInfo[ playerid ][ xSkin ], RandomLSSpawn2[ rand ][ 0 ], RandomLSSpawn2[ rand ][ 1 ], RandomLSSpawn2[ rand ][ 2 ], 360.00, 0, 0, 0, 0, 0, 0 );
   }
   antiCheatCS[ playerid ][ TeleportCheck ] = 4;
   return true;
{[/pawn]