little request
#1

Can someone compile this into filter script and upload here please?

Quote:

new bounty[MAX_PLAYERS];

if(strcmp(cmd, "/hitman", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, WHITE, "USAGE: /hitman [playerid] [amount]");
return 1;
}
giveplayerid = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, WHITE, "USAGE: /hitman [playerid] [amount]");
return 1;
}
moneys = strval(tmp);

if(moneys > GetPlayerMoney(playerid)) {
SendClientMessage(playerid, RED, "You don't have enough money!");
return 1;
}
if(moneys < 1) {
SendClientMessage(playerid, YELLOW, "You need money to place a bounty.");
return 1;
}
if(IsPlayerConnected(giveplayerid)==0) {
SendClientMessage(playerid, RED, "That is not a connected player.");
return 1;
}

bounty[giveplayerid]+=moneys;
GivePlayerMoney(playerid, 0-moneys);

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "%s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]);
SendClientMessageToAll(ORANGE, string);

format(string, sizeof(string), "You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, RED, string);

return 1;
}
if(strcmp(cmd, "/bounty", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) {
SendClientMessage(playerid, WHITE, "USAGE: /bounty [playerid]");
return 1;
}
giveplayerid = strval(tmp);

if(IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Player %s (id: %d) has a $%d bounty on his head.", giveplayer,giveplayerid,bounty[giveplayerid]);
SendClientMessage(playerid, YELLOW, string);
} else {
SendClientMessage(playerid, RED, "No such player exists!");
}

return 1;
}
if(strcmp(cmd, "/bounties", true) == 0)
{
new x;

SendClientMessage(playerid, GREEN, "Current Bounties:");
for(new i=0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && bounty[i] > 0) {
GetPlayerName(i, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s%s(%d): $%d", string,giveplayer,i,bounty[i]);

x++;
if(x > 3) {
SendClientMessage(playerid, YELLOW, string);
x = 0;
format(string, sizeof(string), "");
} else {
format(string, sizeof(string), "%s, ", string);
}
}
}

if(x <= 3 && x > 0) {
string[strlen(string)-2] = '.';
SendClientMessage(playerid, YELLOW, string);
}

return 1;
}

Reply


Messages In This Thread
little request - by artogda - 09.11.2011, 13:11
Re: little request - by Hiddos - 09.11.2011, 14:02
Re: little request - by jiwan - 09.11.2011, 14:04
Re: little request - by Kostas' - 09.11.2011, 14:50

Forum Jump:


Users browsing this thread: 2 Guest(s)