samp /pay command


SUBMITTED BY: Guest

DATE: Nov. 16, 2013, 3:39 a.m.

FORMAT: Text only

SIZE: 756 Bytes

HITS: 1043

  1. #include <a_samp>
  2. #define COLOR_RED 0xAA3333AA
  3. public OnPlayerCommandText(playerid, cmdtext[])
  4. {
  5. if (strcmp("/pay", cmdtext, true, 10) == 0)
  6. {
  7. new money;
  8. money = GetPlayerMoney(playerid);
  9. if(IsPlayerInRangeOfPoint(playerid,0.0/*range*/,1105.6422,-1738.0181,13.4461))return SendClientMessage(playerid,COLOR_RED,"You are too far from the gate to pay");
  10. if(money < 500)return SendClientMessage(playerid,COLOR_RED,"You do not have enough money");
  11. MoveObject(980,1101.724609375,-1741.2763671875,15.273958206177);
  12. GivePlayerMoney(playerid, -250);
  13. SendClientMessage(playerid,COLOR_RED,"You have just paid and the gate is open");
  14. return 1;
  15. }
  16. return 0;
  17. }

comments powered by Disqus