oko jail komande

Započeo Deken, Januar 27, 2019, 17:28:08 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): vaš odgovor
Dio skripte: [ pawn ]vaš odgovor[ /pawn ]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike

zdravo sad imam problem popravio sam za otkucaj preostalo vreme i to sve a sad igracu vreme ide ispod 0 doo minus beskonacno  zna neko resenje
evo komanda
[pawn]

CMD:jail(playerid,params[])
{
   if(PlayerInfo[playerid][Ulogovan] == 0) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Ne možete koristiti ovu komandu jer niste ulogovani.");
   if(PlayerInfo[playerid][Zatvoren] == 1) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Ne možete koristiti komande dok ste u zatvoru!");
   if(PlayerInfo[playerid][Provera] == 1) return 0;
   {
      new targetid,reason[50],string1[150],string2[150],string3[150];
      if(PlayerInfo[playerid][pAdmin]>=1)
      {
             if(PlayerInfo[playerid][AdminDuty] == 0) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Niste na dužnosti i ne možete koristiti ovu komandu!");
            if(sscanf(params,"us[128]",targetid,reason)) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Koristi /jail [ID/DEO IMENA] [RAZLOG]");
            if(!IsPlayerConnected(targetid)) return SCM(playerid,-1,""CRVENA"[BD:RP]"BELA"Traženi igrac nije online!");
            if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,-1,""CRVENA"[BD:RP]"BELA"Ne mozeÅ¡ koristiti ovu komandu za admina veæeg admin levela!");
            GetPlayerName(playerid,playername,sizeof(playername));
            GetPlayerName(targetid,nname,sizeof(nname));
            format(string1,sizeof(string1), ""CRVENA"[BD:RP]"BELA"Zatvorili ste igraèa [%d]%s zbog %s!",targetid,nname,reason);
            SendClientMessage(playerid,-1,string1);
            format(string2,sizeof(string2), ""CRVENA"[BD:RP]"BELA"Igraè %s je zatvoren od strane AT!",targetid,nname);
            SendClientMessageToAll(-1,string2);
            format(string3,sizeof(string3), ""CRVENA"[BD:RP]"BELA"Zatvoreni ste od strane Admina %s zbog %s!",playername,reason);
            SendClientMessage(targetid,-1,string3);
            PlayerInfo[targetid][Zatvoren] += 1;
            PlayerInfo[targetid][KazneniPoen] += 1;
            SetPlayerPos(targetid,274.5182,1868.7407,8.7578);
            SetCameraBehindPlayer(targetid);
            ResetPlayerWeapons(targetid);
            SetPlayerFacingAngle(targetid,270);
            PlayerInfo[targetid][jailvreme] = 3600;
            countt=3600;
            jail(targetid);
         }
      }
   return 1;
}
[/pawn]

evo stock jail
[pawn]

stock jail(targetid)
{
   new JAILBAKIS[MAX_PLAYERS];
   if(countt <= 0)
   {
   KillTimer(JAILBAKIS[targetid]);
   SetPlayerPos(targetid,134.2896,1942.8740,19.3284);
   SetPlayerFacingAngle(targetid,90);
   SetCameraBehindPlayer(targetid);
   SendClientMessage(targetid,-1, ""CRVENA"[BD:RP]"BELA"IzaÅ¡li ste iz zatvora pokuÅ¡ajte biti bolji gradjanin!");
   PlayerInfo[targetid][Zatvoren] = 0;
   PlayerInfo[targetid][jailvreme] = 0;
   countt = 0;
   }
   if(countt > 0)
   {
       JAILBAKIS[targetid] = SetTimerEx("JailTimer",1000,true,"i",targetid);
   }
   return 1;
}
[/pawn]
i evo tajmer jailtimer
[pawn]
forward JailTimer(targetid);
public JailTimer(targetid)
{
   PlayerInfo[targetid][jailvreme] --;
   countt --;
   new strg[50];
   format(strg,sizeof(strg),"Vreme zatvora: %d",PlayerInfo[targetid][jailvreme]);
   GameTextForPlayer(targetid,strg,1000,3);
   return 1;
}
[/pawn]

namestio sam sebi count na 100 namestite vi sebi kako vam odgovara


Gamemod: Spotify Community
Owner: Nodze ( Dzenan Levic )

sta meni ovo ovde znaci boga ti kad lik nigde nije forward ni public za tajmer napravio komandu sma bolje ja uradio nego on

Postavi proveru unutar jailtime callbacka. Ako je vreme jednako nuli, da killa timer

brate to radi hvala nisam se setio toga uopste da trebam staviti proveru samo sad je problem sto mi poruku izasli ste iz zatvora ponavlja milion puta

fixao i to malo sam se zbunio ide lock rep+