Hitman System
#1

Hi all. I have problem with hitman system. When someone order a hit on some player using command /contract [id]. Then i or some member of the organisation take the hit using command /givehit [id], then marker shows me on that player to find him and kill him. But when i kill the player when he has a target on him, it shouldn't give me wanted level for killing him, also when i kill him without target it should give me wanted level beause it is normal kill. Sometimes it won't give me wanted level in both cases and sometimes i get wanted level in both cases. Here is a code.

Код:
Pod onplayerdeath

	if(killerid != INVALID_PLAYER_ID && PlayerInfo[ killerid ][ pDatameta ] == 0) {
		if( PlayerInfo[ playerid ][ pHitmenCena ] > 0) {
			if(PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) {
				if( HitmanInfo[ killerid ][ GoChase ] == playerid ) {
				GivePlayerMoney(killerid, PlayerInfo[ playerid ][ pHitmenCena ]);
 				format( globalstring, sizeof( globalstring ), "{FFFFFF}Hitman %s je izvrsio svoju narudzbu %s i zaradio %d rsd.", ImeIgraca( killerid ), ImeIgraca( playerid ), PlayerInfo[ playerid ][ pHitmenCena ] );
    			SendFamilyMessage(17,0xFF0000FF,globalstring);
				format( string, sizeof( string ), "Ubijeni ste od strane HITMANA");
				SCM(playerid, COLOR_LIGHTRED, string );
				format( string, sizeof( string ), "|Hitman| %s je ubio: %s", ImeIgraca( killerid ), ImeIgraca( playerid ) );
				PosaljiAdminima(COLOR_LIGHTRED, string);
				PlayerInfo[ playerid ][ pHitmenCena ] = 0;
				HitmanInfo[ killerid ][ GoChase ] = 999;
				HitmanInfo[ playerid ][ GetChased ] = 999;
				HitmanInfo[ playerid ][ GotHit ] = 0;
				PlayerInfo[ killerid ][ pDatameta ] = 1;
				DisablePlayerCheckpoint( playerid );
				DisablePlayerCheckpoint( killerid );
				SearchNadji[ playerid ] = -1;
   				SearchNadji[ killerid ] = -1;
   				PlayerInfo[ playerid ] [ pPlacen ] = 0;
   				PlayerInfo[ killerid ] [ pPlacen ] = 0;
				}
			}
		}
	}

	if(killerid != INVALID_PLAYER_ID && !IsACop(killerid) && PlayerInfo[ killerid ][ pDatameta ] == 0)
	{
		WantedLevel[killerid] += 2;
		SetPlayerCriminal(killerid,255, "Prvostepeno Ubistvo");
	}

CMD:givehit( playerid, params[] ) {

	    if( PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) {
				new IDs;
				if( sscanf( params, "u", IDs ) ) return SendClientMessage( playerid, -1,"/givehit [ ID Igraca/Deo Imena ]");
	        		if( IDs == INVALID_PLAYER_ID ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Pogresan ID!");
				if( PlayerInfo[ IDs ][ pAdmin ] > 0 ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Ne mozes na Admin-u." );
				if( PlayerInfo[ IDs ][ pHelper ] > 0 ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Ne mozes na Helper-u." );
				if( PlayerInfo[ playerid ][ pDatameta ] < 1) return SendErrorMessage(playerid, "Vec si preuzeo metu /gpsoff da iskljucis metu!");
                		if( HitmanInfo[ IDs ][ GoChase ] < 999 ) return SendErrorMessage( playerid, "{FF0000}[EX:YU] {FFFFFF}Neko je vec preuzeo metu !");
				if( PlayerInfo[ IDs ][ pPlacen ] < 1 ) return SendErrorMessage( playerid, "{FF0000}[EX:YU] {FFFFFF}Taj igrac nema metu!");
	
                
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos( IDs, X, Y, Z );
				SetPlayerCheckpoint( playerid, X, Y, Z, 1 );
				SearchNadji[ playerid ] = IDs;
				format( globalstring, sizeof( globalstring ), "{FFFFFF}* Hitman %s, je preuzeo da ubije: %s (ID:%d), za %d rsd.", ImeIgraca( playerid ), ImeIgraca( IDs ), IDs, PlayerInfo[ IDs ][ pHitmenCena ] );
				SendFamilyMessage(17,0xFF0000FF,globalstring);
				HitmanInfo[ playerid ][ GoChase ] = IDsa;
				HitmanInfo[ IDsa ][ GetChased ] = IDs;
				HitmanInfo[ IDsa ][ GotHit ] = 1;
				PlayerInfo[ playerid ] [ pDatameta ] = 0;
				IDsa = 0;

		}
		else return SendClientMessage( playerid, -1,"Niste u mogucnosti koristiti ovu komandu" );
	return true;
}
Reply
#2

Change your last lines to
PHP код:
if(killerid != INVALID_PLAYER_ID && !IsACop(killerid) && PlayerInfokillerid ][ pDatameta ] == 1)
    {
        
WantedLevel[killerid] += 2;
        
SetPlayerCriminal(killerid,255"Prvostepeno Ubistvo");
    } 
Reply
#3

Now when i take the hit with /givehit [id] command it will not give him wanted level which is good, But when i use command /givehit [id] and when i kill the player with hit on him, it won't give me money for completing the contract also it won't show me in a chat that I have fulfilled the contract and earned money.

Код:
if(killerid != INVALID_PLAYER_ID && PlayerInfo[ killerid ][ pDatameta ] == 0) {
		if( PlayerInfo[ playerid ][ pHitmenCena ] > 0) {
			if(PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) {
				if( HitmanInfo[ killerid ][ GoChase ] == playerid ) {
				GivePlayerMoney(killerid, PlayerInfo[ playerid ][ pHitmenCena ]);
 				format( globalstring, sizeof( globalstring ), "{FFFFFF}Hitman %s je izvrsio svoju narudzbu %s i zaradio %d rsd.", ImeIgraca( killerid ), ImeIgraca( playerid ), PlayerInfo[ playerid ][ pHitmenCena ] );
    			SendFamilyMessage(17,0xFF0000FF,globalstring);
				format( string, sizeof( string ), "Ubijeni ste od strane HITMANA");
				SCM(playerid, COLOR_LIGHTRED, string );
				format( string, sizeof( string ), "|Hitman| %s je ubio: %s", ImeIgraca( killerid ), ImeIgraca( playerid ) );
				PosaljiAdminima(COLOR_LIGHTRED, string);
				PlayerInfo[ playerid ][ pHitmenCena ] = 0;
				HitmanInfo[ killerid ][ GoChase ] = 999;
				HitmanInfo[ playerid ][ GetChased ] = 999;
				HitmanInfo[ playerid ][ GotHit ] = 0;
				PlayerInfo[ killerid ][ pDatameta ] = 1;
				DisablePlayerCheckpoint( playerid );
				DisablePlayerCheckpoint( killerid );
				SearchNadji[ playerid ] = -1;
   				SearchNadji[ killerid ] = -1;
   				PlayerInfo[ playerid ] [ pPlacen ] = 0;
   				PlayerInfo[ killerid ] [ pPlacen ] = 0;
				}
			}
		}
	}
Reply
#4

Hmmm you sure it was giving? show whole OnPlayerDeath
Reply
#5

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(ecp[playerid] != 0)
	{
		Prisustvuje[playerid] = false;
		vorcp[playerid] = 0;

	}
	new name[MAX_PLAYER_NAME];
	new string[256];
	//new playercash;
	//new victimteam;
	new Float:px,Float:py,Float:pz;
	//new killerteam;
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    KillTimer(DragTimer[playerid]);
	RCP[playerid] = 0;
	DisablePlayerRaceCheckpoint(playerid);
    DisablePlayerCheckpoint(playerid);
	PlayerInfo[playerid][pPilot] = 0;
    PlayerInfo[playerid][pPostar] = 0;
    PlayerInfo[playerid][pRazvozi] = 0;
    PlayerInfo[playerid][pGorivo] = 0;
    PlayerInfo[playerid][pPrehrana] = 0;
    PlayerInfo[playerid][pPrikuplja] = 0;
    PlayerInfo[playerid][pDjubretar] = 0;
    PlayerInfo[playerid][pCistac] = 0;
    PlayerInfo[playerid][pSvercRm] = 0;
    PlayerInfo[playerid][pSvercLcn] = 0;
    PlayerInfo[playerid][pSvercZk] = 0;
    PlayerInfo[playerid][pSvercYak] = 0;
    PlayerInfo[playerid][pRaznesiNovac] = 0;
    PlayerInfo[playerid][pKosi] = 0;
    PlayerInfo[playerid][pRiba] = 0;
    PlayerInfo[playerid][pZito] = 0;
    PlayerInfo[playerid][pStruja] = 0;
    MedicBill[playerid] = 1;
    NeMozeCMD[playerid] = 1;
   	/*prihvatiorgli[playerid] = 9999;
	prihvatiorg[playerid] = 0;*/
	aaaorg[playerid] = 9999;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
	/*victimteam = gTeam[playerid];
	killerteam = gTeam[killerid];*/
	gPlayerSpawned[playerid] = 1;
	PlayerInfo[playerid][pInvWeapon] = 0;
 	PlayerInfo[playerid][pInvAmmo] = 0;
	GetPlayerName(playerid, name, sizeof(name));
	PlayerInfo[playerid][pLocal] = 255;
	GetPlayerPos(playerid, px, py, pz);
    //PlayerInfo[killerid][pKills]++;
    PlayerInfo[playerid][pDeaths]++;
    KillTimer(DragTimer[playerid]);
    //
	if( SearchNadji[ playerid ] != -1 ) {

		SearchNadji[ playerid ] = -1;
		Dimi_DisablePlayerCheckpoint( playerid );
	}
	if(killerid != INVALID_PLAYER_ID && PlayerInfo[ killerid ][ pDatameta ] == 1) {
		if( PlayerInfo[ playerid ][ pHitmenCena ] > 0) {
			if(PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) {
				if( HitmanInfo[ killerid ][ GoChase ] == playerid ) {
				GivePlayerMoney(killerid, PlayerInfo[ playerid ][ pHitmenCena ]);
 				format( globalstring, sizeof( globalstring ), "{FFFFFF}Hitman %s je izvrsio svoju narudzbu %s i zaradio %d rsd.", ImeIgraca( killerid ), ImeIgraca( playerid ), PlayerInfo[ playerid ][ pHitmenCena ] );
    			SendFamilyMessage(17,0xFF0000FF,globalstring);
				format( string, sizeof( string ), "Ubijeni ste od strane HITMANA");
				SCM(playerid, COLOR_LIGHTRED, string );
				format( string, sizeof( string ), "|Hitman| %s je ubio: %s", ImeIgraca( killerid ), ImeIgraca( playerid ) );
				PosaljiAdminima(COLOR_LIGHTRED, string);
				PlayerInfo[ playerid ][ pHitmenCena ] = 0;
				HitmanInfo[ killerid ][ GoChase ] = 999;
				HitmanInfo[ playerid ][ GetChased ] = 999;
				HitmanInfo[ playerid ][ GotHit ] = 0;
				PlayerInfo[ killerid ][ pDatameta ] = 0;
				Dimi_DisablePlayerCheckpoint( playerid );
				Dimi_DisablePlayerCheckpoint( killerid );
				SearchNadji[ playerid ] = -1;
   				SearchNadji[ killerid ] = -1;
   				PlayerInfo[ playerid ] [ pPlacen ] = 0;
   				PlayerInfo[ killerid ] [ pPlacen ] = 0;
				}
			}
		}
	}
	if(killerid != INVALID_PLAYER_ID)
	{
 		PlayerInfo[killerid][pKills]++;
    }
    if(killerid != INVALID_PLAYER_ID && !IsACop(killerid) && PlayerInfo[ killerid ][ pDatameta ] == 1)
	{
		WantedLevel[killerid] += 2;
		SetPlayerCriminal(killerid,255, "Prvostepeno Ubistvo");
	}
	if(killerid != INVALID_PLAYER_ID)
	{
		if(GetPlayerState(killerid) == 2)
		{
		    if(ProxDetectorS(20, killerid, playerid))
		    {
		        if(!IsPlayerInAnyVehicle(playerid))
		        {
					if(PlayerInfo[killerid][pMember] == 1||PlayerInfo[killerid][pLeader] == 1||PlayerInfo[killerid][pMember] == 2||PlayerInfo[killerid][pLeader] ==2||PlayerInfo[killerid][pMember] == 3||PlayerInfo[killerid][pLeader] ==3)
		    		{
		    		    SendClientMessage(killerid, COLOR_YELLOW, "To je bilo drive-by ubistvo ne radi to vise!.");
						return 1;
					}
					SetPlayerCriminal(killerid,255,"Ubistvo");
					SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
					return 1;
				}
			}
		}
	}
	new caller = Mobile[playerid];
	if(caller != 255)
	{
		if(caller < 255)
		{
			SendClientMessage(caller,  COLOR_GRAD2, "   Linija se prekinula....");
			CellTime[caller] = 0;
			CellTime[playerid] = 0;
			Mobile[caller] = 255;
		}
		Mobile[playerid] = 255;
		CellTime[playerid] = 0;
	}
	ClearCrime(playerid);
	if(GettingCK[playerid] < 999)
	{
	    if(IsPlayerConnected(killerid))
	    {
	        if(OnCK[killerid] < 999)
	        {
	            new killer[MAX_PLAYER_NAME];
	            new dier[MAX_PLAYER_NAME];
	            GetPlayerName(playerid, dier, sizeof(dier));
				GetPlayerName(killerid, killer, sizeof(killer));
	            format(string, sizeof(string), "* %s je izvrsio Character Kill na vama, ne mozete igrati sa vasim likom vise.",killer);
	            SendClientMessage(playerid, COLOR_LIGHTRED, string);
	            format(string, sizeof(string), "** %s je izvrsio Character Kill na %s **",killer,dier);
	            CKLog(string);
	            BroadCast(COLOR_LIGHTRED, string);
	            PlayerInfo[playerid][pCK] = 1;
	            if(GettingCK[playerid] < 999) { GettingCK[playerid] = 999; }
	            else if(OnCK[playerid] < 999) { OnCK[playerid] = 999; }
	            if(GettingCK[killerid] < 999) { GettingCK[killerid] = 999; }
	            else if(OnCK[killerid] < 999) { OnCK[killerid] = 999; }
	            KickPlayer[playerid] = 1;
	        }
	    }
	}
	if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0)
	{
		if (BusrouteEast[playerid][0] != 0) BusrouteEnd(playerid, BusrouteEast[playerid][1]);
		else if (BusrouteWest[playerid][0] != 0) BusrouteEnd(playerid, BusrouteWest[playerid][1]);
		else BusrouteEnd(playerid, 0);
	}
	if(FarmerVar[playerid] != 0)
	{
	    FarmerVar[playerid] = 0;
	    DisablePlayerCheckpoint(playerid);
	}
	if(DrugFarmerVar[playerid] != 0)
	{
		DrugFarmerVar[playerid] = 0;
		DisablePlayerCheckpoint(playerid);
	}
	if(SmugglerWork[playerid] != 0)
	{
	    SmugglerWork[playerid] = 0;
	    DisablePlayerCheckpoint(playerid);
	}
	if(BackOut[playerid] == 1)
	{
    	BackOut[playerid] = 0;
	}
	if( ListaPrikazana[ playerid ] ) {
		KladionicaTDControl( playerid, false );
	}
    if( MojListicPrikazan[ playerid ] ) {
		KladionicaListicTDControl( playerid, false );
	}
	if( RezultatiPrikazana[ playerid ] ) {
		RezultatiTDControl( playerid, false );
	}
    if( PlayerInBlowJob[ playerid ] != 0 ) {

		switch( PlayerInBlowJob[ playerid ] ) {

	        case 1: {

				DestroyActor( Sex_Lisa );
				WhoreLisa = false;
			}
	        case 2: {

				DestroyActor( Sex_Angelina );
				WhoreAngelina = false;
			}
	        case 3: {

				DestroyActor( Sex_Mia );
				WhoreMia = false;
			}
	        case 4: {

				DestroyActor( Sex_Sendy );
				WhoreSendy = false;
			}
		}
		StopAudioStreamForPlayer( playerid );
	    SetCameraBehindPlayer( playerid );
        PlayerInBlowJob[ playerid ] = 0;
    	SexTDControl( playerid, false );
    	BlowJobCount[ playerid ] = 0;
	    TogglePlayerControllable( playerid, ( true ) );
		ClearAnimations( playerid );
    	KillTimer( PusenjeTimer[ playerid ] );
	}
	killerid = INVALID_PLAYER_ID;
	SetPlayerToTeamColor(playerid);
	return 1;
}
Код:
CMD:contract( playerid, params[] ) {
    if( IsPlayerConnected( playerid ) ) {
        new IDs, amount;
		if( sscanf(params,"ui", IDs, amount)) return SendClientMessage( playerid, -1,"/contract [ID Igraca/Deo Imena] [ novac ]");
        if( IDs == INVALID_PLAYER_ID ) return SendErrorMessage(playerid, "Pogresan ID!");
        if( amount < 1000 || amount > 200000 ) return SendErrorMessage( playerid, "Cena mete mora biti minimum $1000, ili maksimum $200000!");
        if( amount > GetPlayerMoney(playerid) ) return SendErrorMessage( playerid, "Nemate toliko novca sa sobom.");
		if( PlayerInfo[ playerid ][ pLevel ] < 5 ) return SendErrorMessage( playerid, "Morate biti level 5." );
		if( PlayerInfo[ IDs ][ pLevel ] < 5 ) return SendErrorMessage( playerid, "Igrac mora biti level 5." );
		if( PlayerInfo[ ID ][ pAdmin ] >= 1  ) return SendErrorMessage( playerid, "Ne mozete to uraditi na ASM TEAM." );
        if( PlayerInfo[ ID ][ pHelper ] >= 1  ) return SendErrorMessage( playerid, "Ne mozete na supportera." );
		if( IsPlayerConnected( IDs ) ){
            if( IDs != INVALID_PLAYER_ID ) {
                if(PlayerInfo[ IDs ][ pMember ] == 17 || PlayerInfo[IDs][pLeader] == 17) return SendErrorMessage( playerid, "* Ne mozete naruciti ubistvo clanova agencije !");
			    if( IDs == playerid ) return SendErrorMessage( playerid, "* Ne mozete naruciti svoje ubistvo!");

                if( amount > 0 && GetPlayerMoney(playerid) >= amount ) {
                    GivePlayerMoney( playerid, -amount );
                    PlayerInfo[ IDs ][ pHitmenCena ] += amount;
                    format( globalstring, sizeof( globalstring ), "{FFFFFF}* Narucili ste ubistvo %s-a, za %d rsd.",ImeIgraca( IDs ), amount);
                    SCM(playerid, COLOR_WHITE, globalstring );
                    PlayerPlaySound( playerid, 1052, 0.0, 0.0, 0.0 );
					format( globalstring, sizeof( globalstring ), "{FFFFFF}%s je narucio ubistvo %s-a, za %d.", ImeIgraca( playerid ), ImeIgraca( IDs ), amount);
                    SendFamilyMessage(17,0xFF0000FF,globalstring);
                    PlayerInfo[ IDs ][ pPlacen ] = 1;
                	}
                	else
					{
                    	SendErrorMessage( playerid, "Nepravilan iznos transakcije.");
                	}
            	}
        	}
        	else
			{
  			SendErrorMessage( playerid, "Pogresan ID" );
        	}
    }
    return 1;
}
Код:
CMD:givehit( playerid, params[] ) {
	    if( PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) {
				new IDs;
				if( sscanf( params, "u", IDs ) ) return SendClientMessage( playerid, -1,"/givehit [ ID Igraca/Deo Imena ]");
	        	if( IDs == INVALID_PLAYER_ID ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Pogresan ID!");
				if( PlayerInfo[ IDs ][ pAdmin ] > 0 ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Ne mozes na Admin-u." );
				if( PlayerInfo[ IDs ][ pHelper ] > 0 ) return SendErrorMessage(playerid, "{FF0000}[EX:YU] {FFFFFF}Ne mozes na Helper-u." );
				if( PlayerInfo[ playerid ][ pDatameta ] > 0) return SendErrorMessage(playerid, "Vec si preuzeo metu /gpsoff da iskljucis metu!");
                if( HitmanInfo[ IDs ][ GoChase ] < 999 ) return SendErrorMessage( playerid, "{FF0000}[EX:YU] {FFFFFF}Neko je vec preuzeo metu !");
				if(PlayerInfo[IDs][pPlacen] < 1 ) return SendErrorMessage( playerid, "{FF0000}[EX:YU] {FFFFFF}Taj igrac nema metu!");
                
				new Float:X, Float:Y, Float:Z;
				GetPlayerPos( IDs, X, Y, Z );
				Dimi_SetPlayerCheckpoint( playerid, X, Y, Z, 1 );
				SearchNadji[ playerid ] = IDs;
				format( globalstring, sizeof( globalstring ), "{FFFFFF}* Hitman %s, je preuzeo da ubije: %s (ID:%d), za %d rsd.", ImeIgraca( playerid ), ImeIgraca( IDs ), IDs, PlayerInfo[ IDs ][ pHitmenCena ] );
				SendFamilyMessage(17,0xFF0000FF,globalstring);
				HitmanInfo[ playerid ][ GoChase ] = IDsa;
				HitmanInfo[ IDsa ][ GetChased ] = IDs;
				HitmanInfo[ IDsa ][ GotHit ] = 1;
				PlayerInfo[ playerid ] [ pDatameta ] = 1;
				IDsa = 0;
		}
		else return SendClientMessage( playerid, -1,"Niste u mogucnosti koristiti ovu komandu" );
	return true;
}
Reply
#6

Change
PHP код:
//OnPlayerDeath
if(killerid != INVALID_PLAYER_ID && PlayerInfokillerid ][ pDatameta ] == 1) {
        if( 
PlayerInfoplayerid ][ pHitmenCena ] > 0) {
            if(
PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) {
                if( 
HitmanInfokillerid ][ GoChase ] == playerid ) {
                
GivePlayerMoney(killeridPlayerInfoplayerid ][ pHitmenCena ]); 
to
PHP код:
if(killerid != INVALID_PLAYER_ID && PlayerInfokillerid ][ pDatameta ] == 0) {
        if( 
PlayerInfoplayerid ][ pHitmenCena ] > 0) {
            if(
PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) {
                if( 
HitmanInfokillerid ][ GoChase ] == playerid ) {
                
GivePlayerMoney(killeridPlayerInfoplayerid ][ pHitmenCena ]); 
Reply
#7

After resetting hitman stuff in OnPlayerDeath, you can return 1 to stop the code right there so the wanted level won't be executed. These two must be at the bottom of the callback though.

It'd be easier for us if you could translate the text and give some info about what "pDatameta" is about.

EDIT: I just saw you posted the whole code. You need to determinate if the killer is not the hitman of the player who died and if it's not in a "hitman mission" to increase the wanted.

Resetting the variables and then checking their value for the wanted level won't have any affect.
Reply
#8

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
After resetting hitman stuff in OnPlayerDeath, you can return 1 to stop the code right there so the wanted level won't be executed. These two must be at the bottom of the callback though.

It'd be easier for us if you could translate the text and give some info about what "pDatameta" is about.

EDIT: I just saw you posted the whole code. You need to determinate if the killer is not the hitman of the player who died and if it's not in a "hitman mission" to increase the wanted.

Resetting the variables and then checking their value for the wanted level won't have any affect.
"pDatameta" means when i take hit on some player with /givehit command and i can't take other hit until i finish my original mission or i cancel the hit.
Reply
#9

Combining the two makes it:
PHP код:
if (killerid != INVALID_PLAYER_ID && PlayerInfo[killerid][pDatameta] == 1)
{
    if (
PlayerInfo[playerid][pHitmenCena] > && (PlayerInfo[killerid][pMember] == 17 || PlayerInfo[killerid][pLeader] == 17) && HitmanInfo[killerid][GoChase] == playerid)
    {
        
GivePlayerMoney(killeridPlayerInfo[playerid][pHitmenCena]);
        
format(globalstringsizeof(globalstring), "{FFFFFF}Hitman %s je izvrsio svoju narudzbu %s i zaradio %d rsd."ImeIgraca(killerid), ImeIgraca(playerid), PlayerInfo[playerid][pHitmenCena]);
        
SendFamilyMessage(170xFF0000FFglobalstring);
        
format(stringsizeof(string), "Ubijeni ste od strane HITMANA");
        
SCM(playeridCOLOR_LIGHTREDstring);
        
format(stringsizeof(string), "|Hitman| %s je ubio: %s"ImeIgraca(killerid), ImeIgraca(playerid));
        
PosaljiAdminima(COLOR_LIGHTREDstring);
        
PlayerInfo[playerid][pHitmenCena] = 0;
        
HitmanInfo[killerid][GoChase] = 999;
        
HitmanInfo[playerid][GetChased] = 999;
        
HitmanInfo[playerid][GotHit] = 0;
        
PlayerInfo[killerid][pDatameta] = 0;
        
DisablePlayerCheckpoint(playerid);
        
DisablePlayerCheckpoint(killerid);
        
SearchNadji[playerid] = -1;
        
SearchNadji[killerid] = -1;
        
PlayerInfo[playerid][pPlacen] = 0;
        
PlayerInfo[killerid][pPlacen] = 0;
    }
    else
    {
        if (!
IsACop(killerid))
        {
            
WantedLevel[killerid] += 2;
            
SetPlayerCriminal(killerid255"Prvostepeno Ubistvo");
        }
    }

and something I noticed. In /givehit you have both "IDs" and "IDsa" and if those two are two different variables, they will most likely bug it.

PS: Change the values of "pDatameta" to match yours as in the first post and your post with the whole code, they are switched.
Reply
#10

That wanted level system must work on other organisation when they kill each other and not only for hitman. This what you send me gives member of the hitman organisation wanted level when he take the hit using command /givehit [id] and with normal kill wothout hit. It shouldnt give wanted level when player use /givehit [id] command to take the hit on some player. I tried like you said but it won't says that i completed contract and kill the target.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)