Oko prebacivanja u AFK zonu

Započeo Mahone, April 26, 2020, 18:23:17 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Ako moze neko dole napisati kako da napisem da posle 15 minuta da si afk da te prebaci u afk zonu a ne 1 minut
Dio skripte: [pawn]
function AFKCheck(playerid)
{
   GetPlayerPos(playerid, PlayerCurrentPos[playerid][0], PlayerCurrentPos[playerid][1], PlayerCurrentPos[playerid][2]);
   if(!floatcmp(PlayerCurrentPos[playerid][0], PlayerLastPos[playerid][LastX]) && !floatcmp(PlayerCurrentPos[playerid][1], PlayerLastPos[playerid][LastY]))
   {
      PovecajPVarInt(playerid, "PlayerAFK", 15);
   }
   else
   {
      SetPVarInt(playerid, "PlayerAFK", 0);
         AFK[playerid] = false;
   }
   PlayerLastPos[playerid][LastX] = PlayerCurrentPos[playerid][0];
   PlayerLastPos[playerid][LastY] = PlayerCurrentPos[playerid][1];
   PlayerLastPos[playerid][LastZ] = PlayerCurrentPos[playerid][2];

   if(GetPVarInt(playerid, "PlayerAFK") >= 15)
   {
       if(PI[playerid][Admin] <= 5)
        {
          if(AFK[playerid] == false && PI[playerid][TrazeniNivo] == 0 && PI[playerid][Zatvor] == 0 && StavljeneLisice[playerid] == 0 && Zavezan[playerid] == 0 && IgracTazovan[playerid] == 0)
            {
                if(AFK[playerid] == false)
            {
                   if(gSpectateID[playerid] != -1) return 1;
                   SCM(playerid, 0xF4C164FF, "[AFK]: {FFFFFF}Prebaceni ste u AFK zonu!");
                   printf("Igrac %s prebacen u AFK Zonu!",Ime_Igraca(playerid));
                 if(IsPlayerInAnyVehicle(playerid))
               {
                  new car = GetPlayerVehicleID(playerid);
                  RemovePlayerFromVehicle(playerid);
                  SetVehicleToRespawn(car);
               }
               if(IgracPolicajac(playerid) && OfficerNaDuznosti[playerid] == 1)
               {
                    SCM(playerid, SVETLOCRVENA, "Skinuta vam je duznost jer ste bili AFK na duznosti");
                  SetPlayerSkin(playerid, PI[playerid][pSkin]);
                  ResetPlayerWeaponsEx(playerid);
                  g_SetPlayerArmour(playerid, 0);
                  SetPlayerHealth_H(playerid, 99.0);
                  OfficerNaDuznosti[playerid] = 0;
                    }
               new poz = random(sizeof(PozicijeAFK));
               SetPlayerPos(playerid,PozicijeAFK[poz][0],PozicijeAFK[poz][1],PozicijeAFK[poz][2]);
               AFK[playerid] = true;
             }
         }
      }
   }
   return 1;
}
[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): -
Slika/video ingame problema(obavezno ako je ingame problem):


Pa samo promeni iz 1000 mili sekundi u koiliko ti hoces :)

Citat: Fr0z3n poslato April 28, 2020, 14:18:02 POSLE PODNE
Pa samo promeni iz 1000 mili sekundi u koiliko ti hoces :)
Ne vidim ja ovde idje da to pise :D

[pawn]if(GetPVarInt(playerid, "PlayerAFK") >= 15)[/pawn]

Koliko vidim vec ti je podeseno na 15 sekundi xDD

Osim ako pogresno dodajes varijablu

Citat: V01D poslato April 28, 2020, 18:35:11 POSLE PODNE
[pawn]if(GetPVarInt(playerid, "PlayerAFK") >= 15)[/pawn]

Koliko vidim vec ti je podeseno na 15 sekundi xDD

Osim ako pogresno dodajes varijablu
Kad sam bio ig brojao sam tacno 1 min i odma me prebacuje tamo

Aha, skontao sam gde je problem..

[pawn]PovecajPVarInt(playerid, "PlayerAFK", 15);[/pawn]

Povecao si varijablu za 15.. Povecaj je za 1 i onda probaj :)

Ovako:

[pawn]PovecajPVarInt(playerid, "PlayerAFK", 1);[/pawn]

Citat: V01D poslato April 28, 2020, 18:43:44 POSLE PODNE
Aha, skontao sam gde je problem..

[pawn]PovecajPVarInt(playerid, "PlayerAFK", 15);[/pawn]

Povecao si varijablu za 15.. Povecaj je za 1 i onda probaj :)

Ovako:

[pawn]PovecajPVarInt(playerid, "PlayerAFK", 1);[/pawn]

Reseno hvala
LOCK