when the hitman place a contract it says you have already placed contract on this player
Код:
CMD:contract(playerid, params[])
{
new string[128], playerb, amount;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "ui", playerb, amount)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /contract [playerid] [amount]");
if(IsAHitman(playerb)) return SendClientMessage(playerid, COLOR_GREY, "No... just no Motherfucker!"); // This was something creating the problem i had IsAHitman(playerid)) instead of playerb.
if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_GREY, "You must be at least level 3 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, "Player is not connected.");
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));
format(string, sizeof(string), "HitmanWarn: %s has placed a contract on %s for $%d.", RPN(playerid), RPN(playerb), amount);
SendHitmanMessage(COLOR_YELLOW, string);
SendAdminMessage(COLOR_DARKRED, 3, string);
Log("logs/contract.log", string);
return 1;
}
only use the first if the rest should be else if( or it will call them all down the row untill it gets a return
ok i placed eles if except on the first one and im still getting the same message You have already placed a contract on this player