Hitman
#1

Hello friends!
i have a big problem with my Hitman System if anyone can help me i'll give him +3Rep
it doesn't work when a hitman kill his contract

CMD /Contract
Код:
CMD:contract(playerid, params[])
{
	new string[128], playerb, amount, detail[62];
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "First login.");
	if(sscanf(params, "uis[62]", playerb, amount, detail)) return SendClientMessage(playerid, COLOR_ALIREZA, "USAGE: /contract [playerid] [amount] [details]");
	if(IsAHitman(playerid)) return SendClientMessage(playerid, COLOR_GREY, "No  just no motherfucker!");
	if(PlayerInfo[playerid][pLevel] < 1) return SendClientMessage(playerid, COLOR_GREY, "You mus be at least level 1 to make a contract on someone.");
	if(amount < 3000 || amount > 50000) return SendClientMessage(playerid, COLOR_GREY, "Contracts are between $3000 and $50,000.");
	if(PlayerInfo[playerid][pMoney] < amount) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much on you at the moment.");
	if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "ID Bazikon Vared Shode Eshtebah Ast.");
	if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't contract yourself.");
	if(PlayerInfo[playerb][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You can't contract people under level 3.");
	//if(!strcmp(RPN(playerid), PlayerInfo[playerb][pContractBy], false)) return SendClientMessage(playerid, COLOR_GREY, "You have already placed a contract on this player.");
	if(PlayerInfo[playerb][pContract] >= 150000) return SendClientMessage(playerid, COLOR_GREY, "Player has the maximum contract amount on his head already.");
	PlayerInfo[playerb][pContract] += amount;
	format(PlayerInfo[playerb][pContractBy], 32, "%s", RPN(playerid));
	strmid(PlayerInfo[playerb][pContractDetail], detail, 0, strlen(detail), 32);
	GivePlayerMoney(playerid, -amount);
	format(string, sizeof(string), "HitmanWarn: %s has placed a contract on %s for $%d, Details: %s", RPN(playerid), RPN(playerb), amount, detail);
	SendHitmanMessage(COLOR_YELLOW, string);
	format(string, sizeof(string), "HitmanWarn: %s has placed a contract on %s for $%d, Details: %s", NORPN(playerid), NORPN(playerb), amount, detail);
	SendAdminMessage(COLOR_DARKRED, 3, string);
	Log("logs/contract.log", string);
	return 1;
}
and i put it under onplayerdeath
Код:
if(Hitman[killerid] == playerid)
					{
					    format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[playerid][pContract]/2);
					    SendClientMessage(playerid, COLOR_YELLOW, string);
					    format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(killerid), RPN(playerid), PlayerInfo[playerid][pContract]/2);
						SendHitmanMessage(COLOR_YELLOW, string);
						GivePlayerMoney(playerid, -PlayerInfo[playerid][pContract]/2);
						GivePlayerMoney(killerid, PlayerInfo[playerid][pContract]/2);
						PlayerInfo[playerid][pContract] = 0;
						format(PlayerInfo[playerid][pContract], 32, "");
						Hitman[killerid] = -1;
						PlayerInfo[killerid][pCSuccess] ++;
					}
					else if(Hitman[playerid] == killerid)
					{
					    format(string, sizeof(string), " You have critically injured a hitman and collected $%d, the contrat on your head was cleared.", PlayerInfo[killerid][pContract]);
					    SendClientMessage(killerid, COLOR_YELLOW, string);
					    format(string, sizeof(string), "HitmanWarn: %s has failed the contract on %s's head and lost $%d.", RPN(playerid), RPN(killerid), PlayerInfo[killerid][pContract]);
						SendHitmanMessage(COLOR_YELLOW, string);
						GivePlayerMoney(playerid, -PlayerInfo[killerid][pContract]);
						GivePlayerMoney(killerid, PlayerInfo[killerid][pContract]);
						PlayerInfo[killerid][pContract] = 0;
						format(PlayerInfo[killerid][pContract], 32, "");
						Hitman[playerid] = -1;
						PlayerInfo[playerid][pCFail] ++;
					}
and i put this under onplayershootplayer
Код:
	if(GetPlayerWeapon(Shooter) == 34 && PlayerInfo[Shooter][pScope] && Hitman[Shooter] == Target)
	{
		SetPlayerHealth(Target, 0);
		SetPlayerArmour(Target, 0);
		if(Hitman[Shooter] == Target)
		{
		    format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[Target][pContract]/2);
		    SendClientMessage(Target, COLOR_YELLOW, string);
		    format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(Shooter), RPN(Target), PlayerInfo[Target][pContract]/2);
			SendHitmanMessage(COLOR_YELLOW, string);
			GivePlayerMoney(Target, -PlayerInfo[Target][pContract]/2);
			GivePlayerMoney(Shooter, PlayerInfo[Target][pContract]/2);
			PlayerInfo[Target][pContract] = 0;
			format(PlayerInfo[Target][pContract], 32, "");
			Hitman[Shooter] = -1;
			PlayerInfo[Shooter][pCSuccess] ++;
		}
		PlayerInfo[Shooter][pScope] --;
	}
Where is the problem?
Pleas Help!!!
Reply


Messages In This Thread
Hitman - by Airblog - 04.03.2015, 08:04
Re: Hitman - by CalvinC - 04.03.2015, 08:45
Re: Hitman - by Airblog - 04.03.2015, 09:42
Re: Hitman - by ReshiramZekrom - 04.03.2015, 12:32
Re: Hitman - by Airblog - 04.03.2015, 12:35
Re: Hitman - by Airblog - 04.03.2015, 17:09
Re: Hitman - by CalvinC - 04.03.2015, 17:17

Forum Jump:


Users browsing this thread: 5 Guest(s)