Jump to content
  • 0

Problema CIA JAIL RG3


Mr.Michael

Question

Problema intalnita (descriere): Salut , am o problema cu PD si C.I.A cand pd si cia omoara un civil/mafiot care are wanted nu il trimite la jail il trimite la spawn
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu): -
Imagini / Video (optional):

if(newstate == PLAYER_STATE_WASTED)
	{
		if(PlayerData[playerid][WantedLevel] >= 1)
		{
		    new price = PlayerData[playerid][WantedLevel] * 100;
			new count, cop;
			foreach(Player, i)
			{
			    new f2 = PlayerData[i][Member] + PlayerData[i][Leader];
			    if(f2 == 1 && CrimInRange(20.0, playerid,i))
			    if(f2 == 2 && CrimInRange(20.0, playerid,i)) // adaugata la mn pt wanted da nu merge
			    {
					count = 1;
					format(string, sizeof(string), "~w~Suspect~r~Dead~n~Bonus~g~$%d", price);
					GameTextForPlayer(i, string, 5000, 1);
					GivePlayerCash(i, price);
					cop = i;
				}
			}
			if(count == 1)
			{
			    new time = 0, str[128];

				switch(PlayerData[playerid][WantedLevel])
				{
					case 1: { time = 720; }
					case 2: { time = 960; }
					case 3: { time = 1440; }
					case 4: { time = 1820; }
					case 5: { time = 2160;}
					case 6: { time = 2400;}
				}

				GivePlayerCash(playerid, -price);

				ResetPlayerWeapons(playerid);

				PlayerData[playerid][WantedLevel] = 0;
				PlayerData[playerid][TrackLose] = 0;
				PlayerData[playerid][JailTime] = time;
				PlayerData[playerid][Jailed] = 1;
				PlayerData[playerid][MDC] = 0;

				SetPlayerWantedLevel(playerid, 0);

				mysql_format(SQL, str,128,"UPDATE `users` SET `WantedLevel`='0',`TrackLose`='0',`Jailed`='1' WHERE `ID`='%d' LIMIT 1",PlayerData[playerid][ID]);
				mysql_tquery(SQL, str, "", "");

				mysql_format(SQL, str,128,"UPDATE `users` SET `JailTime`='%d' WHERE `ID`='%d' LIMIT 1",PlayerData[playerid][JailTime],PlayerData[playerid][ID]);
				mysql_tquery(SQL, str, "", "");

				format(string, sizeof(string), "You are jailed for %d seconds (-$%s).", PlayerData[playerid][JailTime], Decimal(price));
				SendClientMessage(playerid, COLOR_1BLUE, string);

				format(string, sizeof(string), "<< %s killed suspect %s for %d seconds ($%s). >>", PlayerData[cop][Name], PlayerData[playerid][Name], time, Decimal(price));
				SendRadioMessage(1, COLOR_LIGHTRED, string);
				SendRadioMessage(2, COLOR_LIGHTRED, string);// adaugata la mn pt wanted 

				RemovePlayerAttachedObject(playerid,0);
			}
		}
	}


Ati incercat sa rezolvati singur?: am rezolvat o alta problema inainte c.i.a lua wanted acuma mi-a mai ramas problema asta nici pd nici c.i.a nu pot trimite in jail 

 

P.S am incercat si eu sa rezolv problema asta da nu stiu cum am umblat si la onplayerdeath aici cred ca e ceva daia v-am dat codul

Edited by Mr.Michael
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.