23.08.2016, 01:26
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; }