PDA

View Full Version : Hitman


anassmaroc
01/10/2015, 09:04 PM
Bug in hitman he don't Show the who hitted u + /bounties don't work
CMD:hitman(playerid, params[])
{
if ( PlayerInfo[playerid][Jailed] == 1 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You Can't Use This Command in Jail" );
new id, amount;
if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, -1,"{FF9966}Info: {FFFFFF} /hitman [Player-ID][Amount]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "That player is not connected.");
if(isHitman[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Hitmen can not place contracts.");
if(isHitman[id] == 1) return SendClientMessage(playerid, COLOR_RED, "That player already has the maximum hit on him.");
if(hit[id] == 150000 || hit[id] > 150000) return SendClientMessage(playerid, COLOR_RED, "That player already has the maximum hit on him.");
if(amount < 50000 || amount > 150000) return SendClientMessage(playerid, COLOR_RED, "Hits range from $50,000 - $150,000.");
if(hit[id] + amount > 150000) return SendClientMessage(playerid, COLOR_RED, "That hit is too high for this player, please lower it.");
hit[id] = hit[id] + amount;
new result[128];
new tname[MAX_PLAYER_NAME];
GetPlayerName(id, tname, sizeof(tname));
format(result, sizeof(result), "{e4a186}%s has got a $%i bounty put on his head from %s (total:%i$).Kill this player and get a bounty!", amount, tname,GetName(playerid));
SendClientMessageToAll(-1, result);
new string[128];
format(string, sizeof(string), "{FF4444}You have got a %i$ bounty put on you from %s(%d)!", amount, tname,playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(isHitman[i])
{
SendClientMessage(i, -1, string);
}
}
}
return 1;
}
CMD:bounties(playerid, params[])
{
if ( PlayerInfo[playerid][Jailed] == 1 ) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You Can't Use This Command in Jail" );
if(isHitman[playerid] == 1)
{
SendClientMessage(playerid, 0x00D9ADFF, "- Current Bounties:");

new string[128];
new tname[MAX_PLAYER_NAME];
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(hit[i] > 0)
{
format(string, sizeof(string), "{fcff97}%s(%d): $%i,", tname,playerid,hit[i]);
SendClientMessage(playerid, -1, string);
}
}
}
}
return 1;
}
https://scontent-cdg2-1.xx.fbcdn.net/hphotos-xap1/v/t34.0-12/12064122_1623445857915248_297620015_n.jpg?oh=603eb bcd23d0cc6b35b58d5420c1a085&oe=560F3A02

CalvinC
02/10/2015, 06:44 AM
format(result, sizeof(result), "{e4a186}%s has got a $%i bounty put on his head from %s (total:%i$).Kill this player and get a bounty!", amount, tname,GetName(playerid));
You forgot to change the "amount, tname, GetName(playerid)" it looks like, they don't match.