FORUM OBAVIJEST: Zapadni Balkan TV / ZBTV
Prijave za web coding battle
SA:MP zajednica Zapadni Balkan

Čet - 22.08.2019. - 20:33
Aktiviraj Nyx stil Aktiviraj Elastica stil
67
posjeta

Tema: [Pomoc] Jail sistem /zatvori

0 Članova i 1 Gost pregledava ovu temu.
 Str: [1]   Dolje   « natrag naprijed »
*
Trening kamp: 0/20

Imam problem sa jail sistemom to jest sa tajmerom kad treba da oslobodi igraca... Komande zatvori i oslobodi rade u redu takodje kad igrac ode relog sve je u redu ali kad treba da ga pusti primer posle 10 minuta ne pusta ga vec ja moram /oslobodi i njegov id...
Pawn: [Odaberi]
CMD:zatvori(playerid, params[])
{
    //IsPlayerLogged[playerid] = false; return SCM(playerid,-1,""col_larp"[R:DM]"col_crvena"Igrac nije ulogovan!");
if(PlayerInfo[playerid][pStaff] > 0 )
{
new ID, Vreme, Razlog[64];
//if(AdminDuty[playerid] == 0 return SCM(playerid,-1,""CRVENA"[UP:RP] "SIVA"Morate biti na Admin  duznosti!");
if(sscanf(params, "uis[64]", ID, Vreme, Razlog)) return SendClientMessage(playerid, 0xFF9900AA,"Koriscenje : /Zatvori [ID/Ime] [Vreme] [Razlog]");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Igrac Je Offline.");
ResetPlayerWeapons(ID);
new rand = random(sizeof(RandomZatvor));
SetPlayerPos(ID, RandomZatvor[rand][0], RandomZatvor[rand][1], RandomZatvor[rand][2]);
SetPlayerInterior(ID, 5);
//TogglePlayerControllable(ID, 0);
//freeze[ID] = SetTimerEx("Freeze",5000, false, "i", ID);
PlayerInfo[ID][pZatvorenVreme] = 1;
PlayerInfo[ID][pZatvor] = 2;
PlayerInfo[ID][pZatvorenVreme] = Vreme*60;
new string[256];
format(string, sizeof(string), ""SIVA"Zatvorili ste %s u zatvor na %d minuta!.", GetName(ID),Vreme);
SCM(playerid, -1, string);
format(string, sizeof(string), ""SIVA"Admin %s vas je zatvorio na %d minuta.", GetName(playerid), Vreme);
SCM(ID, -1, string);
format(string, sizeof(string), ""SIVA" [RAZLOG]: %s.", Razlog);
SCM(ID, -1, string);
format(string, sizeof(string), ""SIVA"Admin %s je zatvorio igraca %s | Minuti: %d | Razlog: %s", GetName(playerid),GetName(ID),Vreme,Razlog);
SCMTA(-1, string);
SacuvajAccount(ID);
}
else SendErrorMessage(playerid, "Niste ovlascenji.");
return 1;
}
////////////////////////////////////////////////////////
CMD:oslobodi(playerid, params[])
{
    //if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "Igrac Je Offline.");
if(PlayerInfo[playerid][pStaff] >= 3)
{
new id,string[128];
//if(AdminDuty[playerid] == 0) return SCM(playerid,-1,""CRVENA"[UP:RP] "SIVA"Morate biti na admin duznosti!");
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF9900AA,"Koriscenje : /Oslobodi [ID/Ime]");
if(!IsPlayerConnected(id)) return SendErrorMessage(playerid, "Igrac je Offline.");
if(PlayerInfo[id][pZatvor] == 0) return SendErrorMessage(playerid, "Igrac nije zatvoren.");
PlayerInfo[id][pZatvor] = 0;
PlayerInfo[id][pZatvorenVreme] = 0;
SetPlayerWorldBounds(id,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(id, 18);
SetPlayerVirtualWorld(id, 0);
SetPlayerPos(id, 1728.3749,-1668.1400,22.6094);
SetPlayerFacingAngle(id, 281.0);
SetCameraBehindPlayer(id);
SCMF(id, -1,  ""SIVA"Admin %s vas je oslobodio iz zatvora!", GetName(playerid));
format(string, sizeof(string),""SIVA"Admin %s je pustio %s iz zatvora!", GetName(playerid),GetName(id));
Adminima4(-1, string);
}
else return SendErrorMessage(playerid, "Niste Ovlasceni.");
return 1;
}
I evo ga tajmer ili ti funkcija za odbrojavanje
Pawn: [Odaberi]
forward Odbrojavanja();
public Odbrojavanja()
{
foreach(Player,i)
{
if(PlayerInfo[i][pZatvorenVreme] < 0)
{
    PlayerInfo[i][pZatvorenVreme]--;
    new odbrojav[128];
    format(odbrojav,sizeof(odbrojav),"~n~~n~~n~~n~~n~~n~~n~~r~~h~~h~Vreme zatvora:~n~~w~%s",KonvertujVreme(PlayerInfo[i][pZatvorenVreme]));
GameTextForPlayer(i, odbrojav, 1100, 3);
}
if(PlayerInfo[i][pZatvorenVreme] < 0 && PlayerInfo[i][pZatvor] > 0)
{
PlayerInfo[i][pZatvor] = 0;
PlayerInfo[i][pZatvorenVreme] = 0;
SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetPlayerPos(i, 1727.9542,-1667.7261,22.6094);
SetPlayerFacingAngle(i, 281.0);
SetCameraBehindPlayer(i);
    GameTextForPlayer(i, "~g~Sloboda~n~~w~Pokusajte biti bolji gradjanin", 5000, 1);
SetPlayerColor(i, TEAM_HIT_COLOR);
}
}
return 1;
}

*
Spol: Ženski
"Nije lako kao što izgleda."
Trening kamp: 20/20

Ova komanda tako nema smisla, setas varijabli dve razlicite vrednosti ne znas ni sam zasto...
Izvoli, i budi siguran da pozivaš takoreć ovaj tajmer u modu

Pawn: [Odaberi]
forward Odbrojavanja();
public Odbrojavanja()
{
foreach(Player,i)
{
if(PlayerInfo[i][pZatvorenVreme] > 0)
{
    PlayerInfo[i][pZatvorenVreme]--;
    new odbrojav[128];
    format(odbrojav,sizeof(odbrojav),"~n~~n~~n~~n~~n~~n~~n~~r~~h~~h~Vreme zatvora:~n~~w~%s",KonvertujVreme(PlayerInfo[i][pZatvorenVreme]));
GameTextForPlayer(i, odbrojav, 1100, 3);
}
else if(PlayerInfo[i][pZatvorenVreme] <= 0 && PlayerInfo[i][pZatvor] > 0)
{
PlayerInfo[i][pZatvor] = 0;
PlayerInfo[i][pZatvorenVreme] = 0;
SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000);
SetPlayerInterior(i, 0);
SetPlayerVirtualWorld(i, 0);
SetPlayerPos(i, 1727.9542,-1667.7261,22.6094);
SetPlayerFacingAngle(i, 281.0);
SetCameraBehindPlayer(i);
    GameTextForPlayer(i, "~g~Sloboda~n~~w~Pokusajte biti bolji gradjanin", 5000, 1);
SetPlayerColor(i, TEAM_HIT_COLOR);
}
}
return 1;
}
I ova provera ti je takvo sranje da ide kroz sve igrace svake sekunde...

EDIT: I ne otvaraj istu temu na dva različita foruma sunce ti ebem...
« Zadnja izmjena: Čet - 08.08.2019. - 18:01 Pinch »
My biggest issue too with so many people is that they think time is free,
you know, I mean. So when they see like a really talended artis,
they'll be like: "hey, listen, can you like do this for me? Like it's not gonna cost you anythin, You could just do it; You're good at it."
Like, no; Shut up.
They're good at it because they spent countless hours doing it and getting good at it.
So don't ask for things for free.

- San Andreas MP (Balkan) -/- Discord Server -
San Andreas MP (Balkan) je Discord zajednica koja daje sve od sebe da vrati SA-MP u ono što je bio i da poboljša doživljaj samog Balkanskog SA-MP Community-a!

*
Trening kamp: 0/20

Hvala puno, namestio sam , inace nisam znao ovo za forume ali okej :D

 Str: [1]   Gore   « natrag naprijed »
 

© 2011 - 2019, SA:MP zajednica Zapadni Balkan. All rights reserved.