Jump to content
  • 0

Question

Posted

CUm schimb comenzile la /A 1 2 3 asa am eu vreau sa fie /arrest si la mechanic nu pot salta masinile ma poate ajuta cineva sa modific acele comenzi sau toate comenzile sa fie normale cele clasice.add bilaz0r Multumesc.Daca ma poate ajuta ii dau fisierul pwn Plz

1 answer to this question

Recommended Posts

Posted

Comanda /arrest

if(strcmp(cmd, "/arrest", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
			if(gTeam[playerid] == 2  || IsACop(playerid))
			{
				if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
				{
				    SCM(playerid, COLOR_GREY, "   You are not on Duty!");
				    return 1;
				}
		        if(!PlayerToPoint(7, playerid, 1526.3472,-1681.6047,5.8906))
				{// Jail spot
				    SCM(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest !");
				    return 1;
				}
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SCM(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
					return 1;
				}
				moneys = strval(tmp);
				if(moneys < 1 || moneys > 99999) { SCM(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $99999 !"); return 1; }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SCM(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
					return 1;
				}
				new time = strval(tmp);
				if(time < 1 || time > 20) { SCM(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SCM(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
					return 1;
				}
				new bail = strval(tmp);
				if(bail < 0 || bail > 1) { SCM(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1 !"); return 1; }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SCM(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
					return 1;
				}
				new bailprice = strval(tmp);
				if(bailprice < 0 || bailprice > 3000000) { SCM(playerid, COLOR_GREY, "   Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
				new suspect = GetClosestPlayer(playerid);
				if(IsPlayerConnected(suspect))
				{
					if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
					{
						GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						if(WantedLevel[suspect] < 1)
						{
						    SCM(playerid, COLOR_GREY, "   Player must be at least Wanted Level 1 !");
						    return 1;
						}
						format(string, sizeof(string), "* You arrested %s !", giveplayer);
						SCM(playerid, COLOR_LIGHTBLUE, string);
						GivePlayerMoney(suspect, -moneys);
						format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
						GameTextForPlayer(suspect, string, 5000, 5);
						ResetPlayerWeapons(suspect);
						if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
						{
							format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
							OOCNews(COLOR_LIGHTRED, string);
						}
						else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
						{
							format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
							OOCNews(COLOR_LIGHTRED, string);
						}
						else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
						{
							format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
							OOCNews(COLOR_LIGHTRED, string);
						}
						SetPlayerWantedLevel(giveplayerid, 0);
						SetPlayerInterior(suspect, 5);
						SetPlayerPos(suspect,322.9037,305.5694,999.1484);
						PlayerInfo[suspect][pJailTime] = time * 60;
						if(bail == 1)
						{
							JailPrice[suspect] = bailprice;
							format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
							SCM(suspect, COLOR_LIGHTBLUE, string);
						}
						else
						{
						    JailPrice[suspect] = 0;
							format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
							SCM(suspect, COLOR_LIGHTBLUE, string);
						}
						PlayerInfo[suspect][pJailed] = 1;
				        PlayerInfo[suspect][pArrested] += 1;
						SetPlayerFree(suspect,playerid, "Got Arrested");
						WantedPoints[suspect] = 0;
						WantedLevel[suspect] = 0;
						WantLawyer[suspect] = 1;
					}//distance
				}//not connected
				else
				{
				    SCM(playerid, COLOR_GREY, "   No-one close enough to arrest.");
				    return 1;
				}
			}
			else
			{
			    SCM(playerid, COLOR_GREY, "   You are not a Cop / FBI / National Guard !");
			    return 1;
			}
		}//not connected
		return 1;
	}

LISTA - GAMEMODE-URI SA-MP - Le gasiti pe toate aici: http://twiriock.com/3MGP

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.