Need Help In CnR Script[+REP] :)
#1

I Am Getting Many Bug In A CnR Script Please Someone Help Me To Fix This Bug
Reply
#2

Where your code lol?
Reply
#3

Too many Bugs Too many code
Reply
#4

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
	new string[256];
	new Houseid = PlayerInfo[playerid][pLastOutSideID];

	if (PlayerInfo[playerid][pGiveDamageToPolice] <=0 && PlayerInfo[playerid][pAJailed] == 0 && !IsPlayerNPC(damagedid) && PlayerInfo[playerid][pTeam] != TEAM_LAW && PlayerInfo[playerid][pVigilante] == 0)
	{
		if (PlayerInfo[playerid][pJailed] == 1)
		{
			PlayerInfo[playerid][pJailHour] += 2;
			PlayerInfo[playerid][pBail] += 1000;

			format(string, sizeof(string), "Committed A Crime (Attacking Law Enforcement) - Jail Sentence Extended %i Hour %i Minute $%i Bail.",PlayerInfo[playerid][pJailHour],PlayerInfo[playerid][pJailMinute],PlayerInfo[playerid][pBail]);
			SendClientMessage(playerid, COLOR_WANTED_LEVEL_5, string);
			PlayerInfo[playerid][pGiveDamageToPolice] =30;
		}else{
			if (PlayerInfo[playerid][pGiveDamageToPolice] <=0 && PlayerInfo[playerid][pAJailed] == 0 && !IsPlayerNPC(damagedid) && PlayerInfo[playerid][pTeam] != TEAM_LAW && PlayerInfo[playerid][pVigilante] == 0)
			{
				if (HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_POLICE)
				{
					if (PlayerInfo[damagedid][pTeam] == TEAM_LAW || PlayerInfo[damagedid][pVigilante] == 1)
					{
						if (PlayerInfo[playerid][pWantedLevel] < 6) {
							PlayerInfo[playerid][pWantedLevel] =6;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}else{
							if (PlayerInfo[playerid][pWantedLevel] > 5) {
								PlayerInfo[playerid][pWantedLevel] =10;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
						}
					}
				}else{
					if (GetPlayerWeapon(playerid) == 0 || GetPlayerWeapon(playerid) == 2 || GetPlayerWeapon(playerid) == 5 || GetPlayerWeapon(playerid) ==  6
					|| GetPlayerWeapon(playerid) == 7 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 10|| GetPlayerWeapon(playerid) == 14
					|| GetPlayerWeapon(playerid) == 15|| GetPlayerWeapon(playerid) == 12|| GetPlayerWeapon(playerid) == 11|| GetPlayerWeapon(playerid) == 49)
					{
						if (PlayerInfo[playerid][pWantedLevel] < 3) {
							PlayerInfo[playerid][pWantedLevel] =3;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
						else
						if (PlayerInfo[playerid][pWantedLevel] > 2) {
							PlayerInfo[playerid][pWantedLevel] =6;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
						else
						if (PlayerInfo[playerid][pWantedLevel] > 5) {
							PlayerInfo[playerid][pWantedLevel] =10;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
					}else{
						if (GetPlayerWeapon(playerid) == 22 || GetPlayerWeapon(playerid) == 23 || GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 25
						|| GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 27 || GetPlayerWeapon(playerid) == 28 || GetPlayerWeapon(playerid) == 29
						|| GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 31 || GetPlayerWeapon(playerid) == 32 || GetPlayerWeapon(playerid) == 33
						|| GetPlayerWeapon(playerid) == 34)
						{
							if (PlayerInfo[playerid][pWantedLevel] < 6) {
								PlayerInfo[playerid][pWantedLevel] =6;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
							else
							if (PlayerInfo[playerid][pWantedLevel] > 5) {
								PlayerInfo[playerid][pWantedLevel] =10;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
						}
					}
				}
			}
		}
	}
	return 1;
}
Ok it is cnr script when a civilian givedamge to another it shows as attacking cops
Reply
#5

You want civilan show not the cops ?
Reply
#6

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
	new string[256];
	new Houseid = PlayerInfo[playerid][pLastOutSideID];

	if (PlayerInfo[playerid][pGiveDamageToPolice] <=1 && PlayerInfo[playerid][pAJailed] == 0 && !IsPlayerNPC(damagedid) && PlayerInfo[playerid][pTeam] != TEAM_LAW && PlayerInfo[playerid][pVigilante] == 0)
	{
		if (PlayerInfo[playerid][pJailed] == 1)
		{
			PlayerInfo[playerid][pJailHour] += 2;
			PlayerInfo[playerid][pBail] += 1000;

			format(string, sizeof(string), "Committed A Crime (Attacking Law Enforcement) - Jail Sentence Extended %i Hour %i Minute $%i Bail.",PlayerInfo[playerid][pJailHour],PlayerInfo[playerid][pJailMinute],PlayerInfo[playerid][pBail]);
			SendClientMessage(playerid, COLOR_WANTED_LEVEL_5, string);
			PlayerInfo[playerid][pGiveDamageToPolice] =30;
		}else{
			if (PlayerInfo[playerid][pGiveDamageToPolice] <=1 && PlayerInfo[playerid][pAJailed] == 0 && !IsPlayerNPC(damagedid) && PlayerInfo[playerid][pTeam] != TEAM_LAW && PlayerInfo[playerid][pVigilante] == 0)
			{
				if (HouseInfo[Houseid][h_cpbustype] == BUS_TYPE_POLICE)
				{
					if (PlayerInfo[damagedid][pTeam] == TEAM_LAW || PlayerInfo[damagedid][pVigilante] == 1)
					{
						if (PlayerInfo[playerid][pWantedLevel] < 6) {
							PlayerInfo[playerid][pWantedLevel] =6;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}else{
							if (PlayerInfo[playerid][pWantedLevel] > 5) {
								PlayerInfo[playerid][pWantedLevel] =10;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
						}
					}
				}else{
					if (GetPlayerWeapon(playerid) == 0 || GetPlayerWeapon(playerid) == 2 || GetPlayerWeapon(playerid) == 5 || GetPlayerWeapon(playerid) ==  6
					|| GetPlayerWeapon(playerid) == 7 || GetPlayerWeapon(playerid) == 9 || GetPlayerWeapon(playerid) == 10|| GetPlayerWeapon(playerid) == 14
					|| GetPlayerWeapon(playerid) == 15|| GetPlayerWeapon(playerid) == 12|| GetPlayerWeapon(playerid) == 11|| GetPlayerWeapon(playerid) == 49)
					{
						if (PlayerInfo[playerid][pWantedLevel] < 3) {
							PlayerInfo[playerid][pWantedLevel] =3;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
						else
						if (PlayerInfo[playerid][pWantedLevel] > 2) {
							PlayerInfo[playerid][pWantedLevel] =6;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
						else
						if (PlayerInfo[playerid][pWantedLevel] > 5) {
							PlayerInfo[playerid][pWantedLevel] =10;

							SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
							PlayerInfo[playerid][pGiveDamageToPolice] =30;
						}
					}else{
						if (GetPlayerWeapon(playerid) == 22 || GetPlayerWeapon(playerid) == 23 || GetPlayerWeapon(playerid) == 24 || GetPlayerWeapon(playerid) == 25
						|| GetPlayerWeapon(playerid) == 26 || GetPlayerWeapon(playerid) == 27 || GetPlayerWeapon(playerid) == 28 || GetPlayerWeapon(playerid) == 29
						|| GetPlayerWeapon(playerid) == 30 || GetPlayerWeapon(playerid) == 31 || GetPlayerWeapon(playerid) == 32 || GetPlayerWeapon(playerid) == 33
						|| GetPlayerWeapon(playerid) == 34)
						{
							if (PlayerInfo[playerid][pWantedLevel] < 6) {
								PlayerInfo[playerid][pWantedLevel] =6;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
							else
							if (PlayerInfo[playerid][pWantedLevel] > 5) {
								PlayerInfo[playerid][pWantedLevel] =10;

								SetPlayerWantedStats(playerid,"Attacking On Law Enforcement");
								PlayerInfo[playerid][pGiveDamageToPolice] =30;
							}
						}
					}
				}
			}
		}
	}
	return 1;
}
Try this code.
Reply
#7

Yes I Mean That When 1st Civilain GiveDamege To 2nd Civilian It Show To First Civilian That He Attacked A Cop And Give Him Wanted Level
Reply
#8

Ok Worked Thanks
Here is one more code

Код:
COMMAND:i(playerid, params[])
{
	return cmd_info(playerid, params);
}
COMMAND:info(playerid, params[])
{
	new string[256], giveplayerid;
	new vehicleid = GetPlayerVehicleID(giveplayerid);
	new modelid = GetVehicleModel(giveplayerid);
	if (sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /info [Playerid]");
	new Levelstr[256], Locstr[256], vstr[256];

	if (!IsPlayerConnected(giveplayerid))
	{
		format(string, sizeof(string), "%d Is Not A Valid ID.", giveplayerid);
		SendClientMessage(playerid, COLOR_ERROR, string);
		return 1;
	}

	if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW || PlayerInfo[giveplayerid][pVigilante] == 1)
	{

		format(Levelstr, sizeof(Levelstr), "~b~Level %d Rank: %s",PlayerInfo[giveplayerid][pLevel],PoliceRanks[PlayerInfo[giveplayerid][pRank]]);
	}
	else
	{
		switch (PlayerInfo[giveplayerid][pWantedLevel])
		{
			case 0:format(Levelstr, sizeof(Levelstr), "~w~Wanted Level %d Innocent Civilian",PlayerInfo[giveplayerid][pWantedLevel]);
			case 1..5:format(Levelstr, sizeof(Levelstr), "~y~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]);
			case 6..9:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]);
			case 10:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d Most Wanted",PlayerInfo[giveplayerid][pWantedLevel]);
		}
	}
	if (PlayerInfo[giveplayerid][pSpawn] == 0)
	{
		Locstr = "~r~Dead in Whole Somewhere";
	}
	else if (PlayerInfo[giveplayerid][pSpecID] > -1 || PlayerInfo[giveplayerid][AdminDuty] == 1)
	{
		Locstr = "~p~San Andreas";
	}
	else
	{
		format(Locstr, sizeof(Locstr), "~p~%s",PlayerInfo[giveplayerid][pLocation]);
	}

	if (IsPlayerInVehicle(giveplayerid,vehicleid))
	{
		format(vstr, sizeof(vstr), "~p~In %s",aVehicleNames[modelid - 400]);
	}
	else
	{
		vstr = "~p~On Foot";
	}
	if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW)
	{
		HideAllServerTextDraws(playerid);
		HideTextDrawMenu(playerid);
		format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_");
		TextDrawSetString(InfoTD0, string);

		format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill: ~b~%s~n~%s~n~~n~~w~Location:~n~%s~n~~w~%s",
		PlayerInfo[giveplayerid][pName],giveplayerid,
		SkillNames[PlayerInfo[giveplayerid][pSkill]],
		Levelstr,
		Locstr,
		vstr);
		TextDrawSetString(InfoTD1, string);

		format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box");
		TextDrawSetString(InfoTD2, string);


		TextDrawShowForPlayer(playerid, InfoTD0);
		TextDrawShowForPlayer(playerid, InfoTD1);
		TextDrawShowForPlayer(playerid, InfoTD2);
	}
	else
	{
		HideAllServerTextDraws(playerid);
		HideTextDrawMenu(playerid);
		format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_");
		TextDrawSetString(InfoTD0, string);

		format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill:~g~ %s~n~~n~%s~n~~w~Location: ~n~%s~n~~w~%s",
		PlayerInfo[giveplayerid][pName],
		giveplayerid,
		SkillNames[PlayerInfo[giveplayerid][pSkill]],
		Levelstr,
		Locstr,
		vstr);
		TextDrawSetString(InfoTD1, string);

		format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box");
		TextDrawSetString(InfoTD2, string);


		TextDrawShowForPlayer(playerid, InfoTD0);
		TextDrawShowForPlayer(playerid, InfoTD1);
		TextDrawShowForPlayer(playerid, InfoTD2);
	}
	return 1;
}
Like if a player is in vehicle it does not show that the player is in vehicle
Reply
#9

Код:
COMMAND:i(playerid, params[])
{
	return cmd_info(playerid, params);
}
COMMAND:info(playerid, params[])
{
	new string[256], giveplayerid;
	new vehicleid = GetPlayerVehicleID(giveplayerid);
	new modelid = GetVehicleModel(giveplayerid);
	if (sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /info [Playerid]");
	new Levelstr[256], Locstr[256], vstr[256];

	if (!IsPlayerConnected(giveplayerid))
	{
		format(string, sizeof(string), "%d Is Not A Valid ID.", giveplayerid);
		SendClientMessage(playerid, COLOR_ERROR, string);
		return 1;
	}

	if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW || PlayerInfo[giveplayerid][pVigilante] == 1)
	{

		format(Levelstr, sizeof(Levelstr), "~b~Level %d Rank: %s",PlayerInfo[giveplayerid][pLevel],PoliceRanks[PlayerInfo[giveplayerid][pRank]]);
	}
	else
	{
		switch (PlayerInfo[giveplayerid][pWantedLevel])
		{
			case 0:format(Levelstr, sizeof(Levelstr), "~w~Wanted Level %d Innocent Civilian",PlayerInfo[giveplayerid][pWantedLevel]);
			case 1..5:format(Levelstr, sizeof(Levelstr), "~y~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]);
			case 6..9:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d",PlayerInfo[giveplayerid][pWantedLevel]);
			case 10:format(Levelstr, sizeof(Levelstr), "~r~Wanted Level %d Most Wanted",PlayerInfo[giveplayerid][pWantedLevel]);
		}
	}
	if (PlayerInfo[giveplayerid][pSpawn] == 0)
	{
		Locstr = "~r~Dead in Whole Somewhere";
	}
	else if (PlayerInfo[giveplayerid][pSpecID] > -1 || PlayerInfo[giveplayerid][AdminDuty] == 1)
	{
		Locstr = "~p~San Andreas";
	}
	else
	{
		format(Locstr, sizeof(Locstr), "~p~%s",PlayerInfo[giveplayerid][pLocation]);
	}

	if (IsPlayerInVehicle(giveplayerid,vehicleid))
	{
		format(vstr, sizeof(vstr), "~p~In %s",aVehicleNames[modelid - 400]);
	}
	else
	{
		vstr = "~p~On Foot";
	}
	if (PlayerInfo[giveplayerid][pTeam] == TEAM_LAW)
	{
		HideAllServerTextDraws(playerid);
		HideTextDrawMenu(playerid);
		format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_");
		TextDrawSetString(InfoTD0, string);

		format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill: ~b~%s~n~%s~n~~n~~w~Location:~n~%s~n~~w~%s",
		PlayerInfo[giveplayerid][pName],giveplayerid,
		SkillNames[PlayerInfo[giveplayerid][pSkill]],
		Levelstr,
		Locstr,
		vstr);
		TextDrawSetString(InfoTD1, string);

		format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box");
		TextDrawSetString(InfoTD2, string);


		TextDrawShowForPlayer(playerid, InfoTD0);
		TextDrawShowForPlayer(playerid, InfoTD1);
		TextDrawShowForPlayer(playerid, InfoTD2);
	}
	else
	{
		HideAllServerTextDraws(playerid);
		HideTextDrawMenu(playerid);
		format(string, sizeof(string), "~g~Player Information~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_~n~_");
		TextDrawSetString(InfoTD0, string);

		format(string, sizeof(string), "~b~%s (%d)~n~~n~~w~Skill:~g~ %s~n~~n~%s~n~~w~Location: ~n~%s~n~~w~%s",
		PlayerInfo[giveplayerid][pName],
		giveplayerid,
		SkillNames[PlayerInfo[giveplayerid][pSkill]],
		Levelstr,
		Locstr,
		vstr);
		TextDrawSetString(InfoTD1, string);

		format(string, sizeof(string), "Press~y~ LMB~w~ To Close The Box");
		TextDrawSetString(InfoTD2, string);


		TextDrawShowForPlayer(playerid, InfoTD0);
		TextDrawShowForPlayer(playerid, InfoTD1);
		TextDrawShowForPlayer(playerid, InfoTD2);
	}
	return 0;
}
Try this one.
Reply
#10

Not Working When In Vehicle In Using It showing Error Message (Unknown command....)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)