OnPlayerDeath
#1

i have create a new wanted system and i have a little problem. If, example i am in Faction Number 5 i killed my partner, i receive 1wanted point, but in script is isn't writed to receive 1 wantedpoints. Check this

Код:
if(PlayerInfo[killerid][pMembru] == 1 || PlayerInfo[killerid][pLider] == 1)
		{
			if(PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
            || PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
			|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
			|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
			|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10)
			return 1;
		}

		if(PlayerInfo[killerid][pMembru] == 2 || PlayerInfo[killerid][pLider] == 2)
		{
		    if(PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
            || PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
			|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
			|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
			|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10)
			return 1;
		}
//-----------------------------------The Forelli Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 4 || PlayerInfo[killerid][pLider] == 4)
		{
if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------The Sindacco Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 5 || PlayerInfo[killerid][pLider] == 5)
		{
				if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------The Leone Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 6 || PlayerInfo[killerid][pLider] == 6)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------Tow Truck Company WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 3 || PlayerInfo[killerid][pLider] == 3)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			   WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------News Reporters WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 9 || PlayerInfo[killerid][pLider] == 9)
		{
		if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------School Instructors WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 10 || PlayerInfo[killerid][pLider] == 10)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------Hitman Agency WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 8 || PlayerInfo[killerid][pLider] == 8)
		{
						if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------CIVILS WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 0 || PlayerInfo[killerid][pLider] == 0)
		{
					if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
I apologize if there are spelling mistakes
Reply
#2

someone?
Reply
#3

Probably somewhere else in the script you give the killerid a wanted point when he kills someone, try to search for that in your script.
Reply
#4

I have nothing in the script than what I described above! A being a possible problem in SetPlayerCriminal?

Код:
public SetPlayerCriminal(playerid,declare,reason[])
{//example: SetPlayerCriminal(playerid,255, "Stealing A Police Vehicle");
	if(IsPlayerConnected(playerid))
	{
	    PlayerInfo[playerid][pCrimes] += 1;
	    new points = WantedPoints[playerid];
		new turned[MAX_PLAYER_NAME];
		new turner[MAX_PLAYER_NAME];
		new turnmes[128];
		new wantedmes[128];
		new wlevel;
		strmid(PlayerCrime[playerid][pAccusedof], reason, 0, strlen(reason), 255);
		GetPlayerName(playerid, turned, sizeof(turned));
		if (declare == 255)
		{
			format(turner, sizeof(turner), "Unknown");
			strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
		}
		else
		{
		    if(IsPlayerConnected(declare))
		    {
				GetPlayerName(declare, turner, sizeof(turner));
				strmid(PlayerCrime[playerid][pVictim], turner, 0, strlen(turner), 255);
				strmid(PlayerCrime[declare][pBplayer], turned, 0, strlen(turned), 255);
				strmid(PlayerCrime[declare][pAccusing], reason, 0, strlen(reason), 255);
			}
		}
		format(turnmes, sizeof(turnmes), "You've commited a Crime ( %s ). Reporter: %s.",reason,turner);
		SendClientMessage(playerid, COLOR_1RED, turnmes);
		new wanted = GetPlayerWantedLevel(playerid);
		SetPlayerWantedLevel(playerid, wanted +1);
		if(points > 0)
		{
		    new yesno;
			if(points == 1) { WantedLevel[playerid] = 1; wlevel = 1; yesno = 1;}
			else if(points == 2) { WantedLevel[playerid] = 2; wlevel = 2; yesno = 1;}
			else if(points == 3) { WantedLevel[playerid] = 3; wlevel = 3; yesno = 1;}
			else if(points == 4) { WantedLevel[playerid] = 4; wlevel = 4; yesno = 1;}
			else if(points == 5) { WantedLevel[playerid] = 5; wlevel = 5; yesno = 1;}
			else if(points == 6) { WantedLevel[playerid] = 6; wlevel = 6; yesno = 1;}
			if(WantedLevel[playerid] >= 1) { if(gTeam[playerid] == 3) { gTeam[playerid] = 4; } }
			SetTimerEx( "dLevel", (600*1000), true, "d", playerid );
			OnPlayerUpdate(playerid);
			if(yesno)
			{
				format(wantedmes, sizeof(wantedmes), "Current Wanted Level: %d", wlevel);
				SendClientMessage(playerid, COLOR_YELLOW, wantedmes);
				for(new i = 0; i < MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i))
					{
					    if(PlayerInfo[i][pMembru] == 1||PlayerInfo[i][pLider] == 1 || PlayerInfo[i][pMembru] == 2||PlayerInfo[i][pLider] == 2)
					    {
							format(cbjstore, sizeof(turnmes), "HQ: All Units APB: Reporter: %s",turner);
							SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
							format(cbjstore, sizeof(turnmes), "HQ: Crime: %s, Suspect: %s",reason,turned);
							SendClientMessage(i, TEAM_BLUE_COLOR, cbjstore);
						}
					}
				}
			}
		}
	}//not connected
}
Reply
#5

Maybe SetPlayerCriminal is called somewhere where it isn't supposed to be called?
This can be anywhere, any place that's triggered when you kill someone.
Reply
#6

Quote:
Originally Posted by Shean
Посмотреть сообщение
i have create a new wanted system and i have a little problem. If, example i am in Faction Number 5 i killed my partner, i receive 1wanted point, but in script is isn't writed to receive 1 wantedpoints. Check this

Код:
if(PlayerInfo[killerid][pMembru] == 1 || PlayerInfo[killerid][pLider] == 1)
		{
			if(PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
            || PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
			|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
			|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
			|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10)
			return 1;
		}

		if(PlayerInfo[killerid][pMembru] == 2 || PlayerInfo[killerid][pLider] == 2)
		{
		    if(PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
            || PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
			|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
			|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
			|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10)
			return 1;
		}
//-----------------------------------The Forelli Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 4 || PlayerInfo[killerid][pLider] == 4)
		{
if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------The Sindacco Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 5 || PlayerInfo[killerid][pLider] == 5)
		{
				if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------The Leone Family WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 6 || PlayerInfo[killerid][pLider] == 6)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7
|| PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------Tow Truck Company WANTED---------------------------------//
		if(PlayerInfo[killerid][pMembru] == 3 || PlayerInfo[killerid][pLider] == 3)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			   WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------News Reporters WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 9 || PlayerInfo[killerid][pLider] == 9)
		{
		if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------School Instructors WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 10 || PlayerInfo[killerid][pLider] == 10)
		{
			if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------Hitman Agency WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 8 || PlayerInfo[killerid][pLider] == 8)
		{
						if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9
|| PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10 || PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
			}
//-----------------------------------CIVILS WANTED---------------------------------//
if(PlayerInfo[killerid][pMembru] == 0 || PlayerInfo[killerid][pLider] == 0)
		{
					if(PlayerInfo[playerid][pMembru] == 1 || PlayerInfo[playerid][pLider] == 1 || PlayerInfo[playerid][pMembru] == 2 || PlayerInfo[playerid][pLider] == 2
|| PlayerInfo[playerid][pMembru] == 3 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembru] == 4 || PlayerInfo[playerid][pLider] == 4
|| PlayerInfo[playerid][pMembru] == 5 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pMembru] == 6 || PlayerInfo[playerid][pLider] == 6
|| PlayerInfo[playerid][pMembru] == 7 || PlayerInfo[playerid][pLider] == 7 || PlayerInfo[playerid][pMembru] == 8 || PlayerInfo[playerid][pLider] == 8
|| PlayerInfo[playerid][pMembru] == 9 || PlayerInfo[playerid][pLider] == 9 || PlayerInfo[playerid][pMembru] == 10 || PlayerInfo[playerid][pLider] == 10
|| PlayerInfo[playerid][pMembru] == 0 || PlayerInfo[playerid][pLider] == 0)
			    WantedPoints[killerid] += 1; //+ 2 wanted points
				if(reason != 49)
				{
					SetPlayerCriminal(killerid,255, "First Degree Murder");
				}
				else if (reason == 49)
				{
					SetPlayerCriminal(killerid,255, "Hit And Run");
				}
			return 1;
I apologize if there are spelling mistakes
change your code with this

Код:
if(PlayerInfo[killerid][pMembru] == PlayerInfo[playerid][pMembru] || PlayerInfo[killerid][pLider] == PlayerInfo[playerid][pLider])
{
	WantedPoints[killerid] += 1; //+ 2 wanted points
	if(reason != 49)
	{
	    	SetPlayerCriminal(killerid,255, "First Degree Murder");
	}
	else if (reason == 49)
	{
		SetPlayerCriminal(killerid,255, "Hit And Run");
	}
}
Reply
#7

That's some of the worst code I've seen in awhile. Don't use the GodFather script as a reference.

Instead of doing if( ... || ... || ... || ...) use a SWITCH statement. If you don't know what that is, please look it up on the SA:MP Wiki.
Reply
#8

I searched at samp.wiki but i have not found
Reply
#9

You can just use ' <= ' or ' >= ' ..
Reply
#10

A switch statement is something like this:

pawn Код:
switch(variable)
{
    case 0: // basically like if(variable == 0)
    {
        return 1;
    }
    case 1: // basically like if(variable == 1)
    {
        return 1;
    }
    case 2: // basically like if(variable == 2)
    {
        return 1;
    }
    case 3, 4, 5: // basically like if(variable == 3 || variable == 4 || variable == 5)
    {
        return 1;
    }
    case 6 .. 10: // basically like if(variable >= 6 && variable <= 10)
    {
        return 1;
    }
    default: // or, the "else" statement; if none of the above cases match, this is what is called
    {
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)