Advertisement
Guest User

heatON

a guest
Dec 21st, 2008
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. if(strcmp(cmd, "/hitman", true) == 0) {
  2. new tmp[256];
  3. tmp = strtok(cmdtext, idx);
  4.  
  5. if(!strlen(tmp)) {
  6. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
  7. return 1;
  8. }
  9. giveplayerid = strval(tmp);
  10.  
  11. tmp = strtok(cmdtext, idx);
  12. if(!strlen(tmp)) {
  13. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /hitman [playerid] [amount]");
  14. return 1;
  15. }
  16. moneys = strval(tmp);
  17.  
  18. if(moneys > GetPlayerMoney(playerid)) {
  19. SendClientMessage(playerid, COLOR_RED, "You don't have enough money!");
  20. return 1;
  21. }
  22. if(moneys < 1) {
  23. SendClientMessage(playerid, COLOR_YELLOW, "Hey what are you trying to pull here.");
  24. return 1;
  25. }
  26. if(IsPlayerConnected(giveplayerid)==0) {
  27. SendClientMessage(playerid, COLOR_RED, "No such player exists.");
  28. return 1;
  29. }
  30. new bounty[MAX_PLAYERS];
  31. bounty[giveplayerid]+=moneys;
  32. GivePlayerMoney(playerid, 0-moneys);
  33.  
  34. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  35. GetPlayerName(playerid, sendername, sizeof(sendername));
  36.  
  37. // format(string, sizeof(string), "You have put a $%d bounty on the head of %s (id: %d).", moneys, giveplayer,giveplayerid);
  38. // SendClientMessage(playerid, COLOR_YELLOW, string);
  39.  
  40. format(string, sizeof(string), "%s has had a $%d bounty put on his head from %s (total: $%d).", giveplayer, moneys, sendername, bounty[giveplayerid]);
  41. SendClientMessageToAll(COLOR_RED, string);
  42.  
  43. format(string, sizeof(string), "You have had a $%d bounty put on you from %s (id: %d).", moneys, sendername, playerid);
  44. SendClientMessage(giveplayerid, COLOR_RED, string);
  45.  
  46. return 1;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement