Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/hitman", true) == 0) {
- new tmp[256];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
- return 1;
- }
- giveplayerid = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
- return 1;
- }
- moneys = strval(tmp);
- if(moneys > GetPlayerMoney(playerid)) {
- SendClientMessage(playerid, COLOR_RED, "You don't have enough money!");
- return 1;
- }
- if(moneys < 1) {
- SendClientMessage(playerid, COLOR_YELLOW, "Hey what are you trying to pull here.");
- return 1;
- }
- if(IsPlayerConnected(giveplayerid)==0) {
- SendClientMessage(playerid, COLOR_RED, "No such player exists.");
- return 1;
- }
- new bounty[MAX_PLAYERS];
- bounty[giveplayerid]+=moneys;
- GivePlayerMoney(playerid, 0-moneys);
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- // format(string, sizeof(string), "You have put a $%d bounty on the head of %s (id: %d).", moneys, giveplayer,giveplayerid);
- // SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "%s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]);
- SendClientMessageToAll(COLOR_RED, string);
- format(string, sizeof(string), "You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid);
- SendClientMessage(giveplayerid, COLOR_RED, string);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement