CMD:CONTRACT Need help urgently
#1

Код:
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(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can not do that, as a hitman your self.");
	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, "Invalid player id.");
	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));
	GiveDavidMoney(playerid, -amount);
	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;
}
Everytime I try to place a contract it just says,you have already placed a contract on this player, Tryed lots of things need urgent help.
Reply
#2

Replace this
Код:
if(!strcmp(RPN(playerid), PlayerInfo[playerb][pContractBy], false)) return SendClientMessage(playerid, COLOR_GREY, "You have already placed a contract on this player.");
with this
Код:
if(strcmp(RPN(playerid), PlayerInfo[playerb][pContractBy], false)) return SendClientMessage(playerid, COLOR_GREY, "You have already placed a contract on this player.");
Reply
#3

Thank you so much honestly, never noticed that atall, piece of shit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)