Guest User

Untitled

a guest
Mar 16th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. if(strcmp(cmd, "/retireratm", true) == 0 || strcmp(cmd, "/ratm", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5.  
  6. if(!strlen(tmp))
  7. {
  8. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /retireratm [montant]");
  9. format(string, sizeof(string), "Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]);
  10. SendClientMessage(playerid, COLOR_GRAD3, string);
  11. return 1;
  12. }
  13. new cashdeposit = strval(tmp);
  14. if(!strlen(tmp))
  15. {
  16. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /retireratm [montant]");
  17. format(string, sizeof(string), " Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]);
  18. SendClientMessage(playerid, COLOR_GRAD3, string);
  19. return 1;
  20. }
  21. if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
  22. {
  23. SendClientMessage(playerid, COLOR_GRAD2, "Vous n'avez pas cette somme sur votre compte bancaire!");
  24. return 1;
  25. }
  26.  
  27. /*if (PlayerInfo[playerid][pJobTimer] > 0)
  28. {
  29. SendClientMessage(playerid, COLOR_GRAD2, "Attendez que votre transaction précédente se termine!");
  30. return 1;
  31. }*/
  32.  
  33. if (cashdeposit > 1000)
  34. {
  35. SendClientMessage(playerid, COLOR_GRAD2, "Vous ne pouvez pas retirer plus de $1.000!");
  36. return 1;
  37. }
  38.  
  39. ConsumingMoney[playerid] = 1;
  40. SafeGivePlayerMoney(playerid,cashdeposit);
  41. PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
  42. format(string, sizeof(string), "Vous avez retiré $%d de votre compte. Il vous reste: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
  43. SendClientMessage(playerid, COLOR_YELLOW, string);
  44. //PlayerInfo[playerid][pJobTimer] = 12;
  45.  
  46. GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
  47. format(string, sizeof(string), " ID(%d) -%s a retiré %d de son compte bancaire.", playerid,giveplayer,cashdeposit);
  48. ABroadCast(COLOR_YELLOW,string,1);
  49. PayLog(string);
  50. return 1;
  51. }
  52. return 1;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment