[POMOC] Zatvor Vreme

Započeo Fantom.pWn, April 03, 2012, 21:05:35 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 7 gostiju pregledaju ovu temu.

Skripta : Moja
Problem : ne mogu da napravim kad odem ju jail zatvor itd da pise U zatvoru ste jod [toliko i toliko] i odbrojava

EDIT
if(strcmp(cmd, "/time", true) == 0 || strcmp(cmd, "/vrijeme", true) == 0)
   {
     if(IsPlayerConnected(playerid))
      {
          new mtext[20];
         new year, month,day;
         getdate(year, month, day);
         if(month == 1) { mtext = "Januar"; }
         else if(month == 2) { mtext = "Februar"; }
         else if(month == 3) { mtext = "Mart"; }
         else if(month == 4) { mtext = "April"; }
         else if(month == 5) { mtext = "Maj"; }
         else if(month == 6) { mtext = "Jun"; }
         else if(month == 7) { mtext = "Jul"; }
         else if(month == 8) { mtext = "Avgust"; }
         else if(month == 9) { mtext = "Septembar"; }
         else if(month == 10) { mtext = "Oktobar"; }
         else if(month == 11) { mtext = "Novembar"; }
         else if(month == 12) { mtext = "Decembar"; }
          new hour,minuite,second;
         gettime(hour,minuite,second);
         FixHour(hour);
         hour = shifthour;
         if (minuite < 10)
         {
            if (PlayerInfo[playerid][pJailTime] > 0)
            {
                if(PlayerInfo[playerid][pWatch] == 1)
                {
                  format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Vremena ostalo: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
               }
               else
               {
                   format(string, sizeof(string), "~w~Zatvorska kazna: %d sec", PlayerInfo[playerid][pJailTime]-10);
               }
            }
            else
            {
                if(PlayerInfo[playerid][pWatch] == 1)
                {
                  format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
               }
               else
               {
                   format(string, sizeof(string), "~r~Nemate sat");
               }
            }
         }
         else
         {
            if (PlayerInfo[playerid][pJailTime] > 0)
            {
                if(PlayerInfo[playerid][pWatch] == 1)
                {
                  format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Zatvorska kazna: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime]-10);
               }
               else
               {
                   format(string, sizeof(string), "~w~Zatvorska kazna: %d sec", PlayerInfo[playerid][pJailTime]-10);
               }
            }
            else
            {
                if(PlayerInfo[playerid][pWatch] == 1)
                {
                  format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
               }
               else
               {
                   format(string, sizeof(string), "~r~Nemate sat");
               }
            }
         }
         GameTextForPlayer(playerid, string, 5000, 1);
         GetPlayerName(playerid, sendername, sizeof(sendername));
         if(PlayerInfo[playerid][pWatch] == 1)
         {
             if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s podize ruku i gleda koliko je sati.", sendername); }
             else { format(string, sizeof(string), "* %s podize ruku i gleda koliko je sati.", sendername); }
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         }
         //ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0);
      }
      return 1;
   }

moze neko od ove komande da napravi automacki kad ubaci u jail da pise koliko je sati datum i koliko je u zatvori,i gde da ubacim?
Poslednja Izmena: April 03, 2012, 22:02:45 POSLE PODNE od JovanCobain

Probaj nesto ovako, javi jel radi, nisam testirao
forward Jail();
public Jail()
{
	new str[128];
	for(new i = 0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(PlayerInfo[i][pJailTime] > 0)
	        {
	            format(str, sizeof(str), "~y~Preostalo vreme\n~y~U zatvoru: ~w~%d", PlayerInfo[i][pJailTime]);
	            GameTextForPlayer(i, str, 10000, 1);
			}
		}
	}
	return 1;
}


SetTimer("JailTimer", 10000, 0);
stavi to pod OnGameModeInit


Brate meni radi, nzm kako ti ne radi

Eto od mene nesto! u TD!
Gore Stavi
new Text:Jailtime;

Stavi u OnGameMode Init:

       
SetTimer("SetPlayerUnjail", 1000, 1);
        new playerid;
        new cordsstring[500];
	format(cordsstring, sizeof(cordsstring),"~r~ZATVOR:~w~ %d", PlayerInfo[playerid][pJailTime]);//Ovo pJailTime stavi kako ti imas!
	Jailtime = TextDrawCreate(215.000000, 413.000000, cordsstring);
	TextDrawTextSize(Jailtime,651.000000,0.000000);
	TextDrawAlignment(Jailtime,0);
	TextDrawFont(Jailtime,2);
	TextDrawLetterSize(Jailtime,0.499999,1.200000);
	TextDrawColor(Jailtime,0xffffffff);
	TextDrawSetOutline(Jailtime,1);
	TextDrawSetProportional(Jailtime,1);
	TextDrawSetShadow(Jailtime,1);


Negde stavi dole
forward SetPlayerUnjail();
public SetPlayerUnjail()
{
		    if(PlayerInfo[i][pJailed] > 0)
		    {
				if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
				{
					PlayerInfo[i][pJailTime]--;//Ovo pJailTime stavi kako ti imas!
					format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[i][pJailTime]);//Ovo pJailTime stavi kako ti imas! 
                                       TextDrawSetString(Jailtime,string);
				}
				if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0)//Ovo pJailTime stavi kako ti imas!
				{
				    PlayerInfo[i][pJailTime] = 0;//Ovo pJailTime stavi kako ti imas!
					if(PlayerInfo[i][pJailed] == 1)//Ovo pJailed stavi kako ti imas!
					{
						SetPlayerInterior(i, 6);
						SetPlayerPos(i,246.30146789551,71.124740600586,1003.289855957);
						TextDrawShowForPlayer(playerid, Jailtime);
						format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[i][pJailTime]); //Ovo pJailTime stavi kako ti imas!
                                               TextDrawSetString(Jailtime,string);
					}
					else if(PlayerInfo[i][pJailed] == 2)//Ovo pJailed stavi kako ti imas!
					{
					    SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
					    SetPlayerInterior(i, 0);
					    SetPlayerPos(i, 90.2101,1920.4854,17.9422);
					}
					PlayerInfo[i][pJailed] = 0;//Ovo pJailed stavi kako ti imas!
					TextDrawHideForPlayer(i, Jailtime);
					if(gTeam[i] == 4) { gTeam[i] = 3; }
					ClearCrime(i);
					SetPlayerToTeamColor(i);
				}
			}
}

i u komande gde stavljas igraca u Zatvor stavi!
TextDrawShowForPlayer(giveplayerid, Jailtime);
format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[giveplayerid][pJailTime]); //Ovo pJailTime stavi kako ti imas!
TextDrawSetString(Jailtime,string);
Poslednja Izmena: April 05, 2012, 20:43:23 POSLE PODNE od [WB] Memorexâ„¢
Skriptam za pare

Citat: Blaeks poslato April 04, 2012, 07:17:17 PRE PODNE
SetTimer("JailTimer", 10000, 0);
stavi to pod OnGameModeInit
Pod 1. Lose mu si stavio ne JailTime nego Jail kako je na publicku
Pod 2. neide na kraju timera 0 nego 1 ! da mu uvek timer radi ne samo jednom!
SetTimer("Jail", 1000, 1);ovo radi Non stop
SetTimer("Jail", 1000, 0); ovo samo jednom!
Sry za Dupli Post! :P
Skriptam za pare

Citat: Memorexâ,,¢ poslato April 05, 2012, 20:34:48 POSLE PODNE
Eto od mene nesto! u TD!
Gore Stavi
new Text:Jailtime;

Stavi u OnGameMode Init:

       
SetTimer("SetPlayerUnjail", 1000, 1);
        new playerid;
        new cordsstring[500];
	format(cordsstring, sizeof(cordsstring),"~r~ZATVOR:~w~ %d", PlayerInfo[playerid][pJailTime]);//Ovo pJailTime stavi kako ti imas!
	Jailtime = TextDrawCreate(215.000000, 413.000000, cordsstring);
	TextDrawTextSize(Jailtime,651.000000,0.000000);
	TextDrawAlignment(Jailtime,0);
	TextDrawFont(Jailtime,2);
	TextDrawLetterSize(Jailtime,0.499999,1.200000);
	TextDrawColor(Jailtime,0xffffffff);
	TextDrawSetOutline(Jailtime,1);
	TextDrawSetProportional(Jailtime,1);
	TextDrawSetShadow(Jailtime,1);


Negde stavi dole
forward SetPlayerUnjail();
public SetPlayerUnjail()
{
		    if(PlayerInfo[i][pJailed] > 0)
		    {
				if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
				{
					PlayerInfo[i][pJailTime]--;//Ovo pJailTime stavi kako ti imas!
					format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[i][pJailTime]);//Ovo pJailTime stavi kako ti imas! 
                                       TextDrawSetString(Jailtime,string);
				}
				if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0)//Ovo pJailTime stavi kako ti imas!
				{
				    PlayerInfo[i][pJailTime] = 0;//Ovo pJailTime stavi kako ti imas!
					if(PlayerInfo[i][pJailed] == 1)//Ovo pJailed stavi kako ti imas!
					{
						SetPlayerInterior(i, 6);
						SetPlayerPos(i,246.30146789551,71.124740600586,1003.289855957);
						TextDrawShowForPlayer(playerid, Jailtime);
						format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[i][pJailTime]); //Ovo pJailTime stavi kako ti imas!
                                               TextDrawSetString(Jailtime,string);
					}
					else if(PlayerInfo[i][pJailed] == 2)//Ovo pJailed stavi kako ti imas!
					{
					    SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
					    SetPlayerInterior(i, 0);
					    SetPlayerPos(i, 90.2101,1920.4854,17.9422);
					}
					PlayerInfo[i][pJailed] = 0;//Ovo pJailed stavi kako ti imas!
					TextDrawHideForPlayer(i, Jailtime);
					if(gTeam[i] == 4) { gTeam[i] = 3; }
					ClearCrime(i);
					SetPlayerToTeamColor(i);
				}
			}
}

i u komande gde stavljas igraca u Zatvor stavi!
TextDrawShowForPlayer(giveplayerid, Jailtime);
format(string,sizeof string,"~r~ZATVOR: ~w~%d",PlayerInfo[giveplayerid][pJailTime]); //Ovo pJailTime stavi kako ti imas!
TextDrawSetString(Jailtime,string);


ae molim te reci mi gde sta da ubacim ovo zanje i ove textdrawove i to :/

Citat: Memorexâ,,¢ poslato April 05, 2012, 20:40:17 POSLE PODNE
Citat: Blaeks poslato April 04, 2012, 07:17:17 PRE PODNE
SetTimer("JailTimer", 10000, 0);
stavi to pod OnGameModeInit
Pod 1. Lose mu si stavio ne JailTime nego Jail kako je na publicku
Pod 2. neide na kraju timera 0 nego 1 ! da mu uvek timer radi ne samo jednom!
SetTimer("Jail", 1000, 1);ovo radi Non stop
SetTimer("Jail", 1000, 0); ovo samo jednom!
Sry za Dupli Post! :P

Eee uradio sam ovako kako je rekao Blaeck kako vec,i radi ali ide npr 59 pa 49 pa 39 i tako a treba da ide 59,58,57 :/

Ja sam mu stavio ovako zbog preopterecenja :P

Citat: JovanCobain poslato April 06, 2012, 01:06:06 PRE PODNE
Eee uradio sam ovako kako je rekao Blaeck kako vec,i radi ali ide npr 59 pa 49 pa 39 i tako a treba da ide 59,58,57 :/

Stavi na mesto ovog SetTimer("Jail", 10000, 0); stavi SetTimer("Jail", 1000, 1);
Skriptam za pare

Citat: Blaeks poslato April 03, 2012, 22:52:18 POSLE PODNE
Probaj nesto ovako, javi jel radi, nisam testirao
forward Jail();
public Jail()
{
	new str[128];
	for(new i = 0; i<MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i))
	    {
	        if(PlayerInfo[i][pJailTime] > 0)
	        {
	            format(str, sizeof(str), "~y~Preostalo vreme\n~y~U zatvoru: ~w~%d", PlayerInfo[i][pJailTime]);
	            GameTextForPlayer(i, str, 10000, 1);
			}
		}
	}
	return 1;
}


Umesto ovoga
GameTextForPlayer(i, str, 10000, 1);
stavi
GameTextForPlayer(i, str, 10000, 4);
i radice 100% , lepo ce da ODBROJAVA !!
Izvinjavam se na svim glupostima i ako sam nekome napisao nesto lose, neko drugi je koristio moj profil!
__________________________________________
https://bk.gta.world - GTA World Balkan - RAGEMP