Guest User

Untitled

a guest
May 4th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <sscanf2>
  7. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" Blank Filterscript by your name here");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23.  
  24.  
  25. dcmd_pay(playerid,params[])
  26. {
  27. static ID, amount, name[MAX_PLAYERS], string7[200], name2[MAX_PLAYERS], string8[200];
  28. if (sscanf(params, "ii", ID,amount)) return SendClientMessage(playerid, 0xff0000aa, "* Usage: /pay [playerid/name] [amount]");
  29. if (amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, 0xff0000aa, "* You do not have enough money to pay that player!");
  30. if (amount <= 0) return SendClientMessage(playerid, 0xff0000aa, "* You can't pay less than 1!");
  31. if (playerid == ID) return SendClientMessage(playerid, 0xff0000aa, "* You can't pay yourselve!");
  32.  
  33. GetPlayerName(ID, name2, sizeof(name2));
  34. format(string8,sizeof(string8),"{FFFF00}|- You have paid %s $%i -|",name2,amount);
  35. SendClientMessageToAll(COLOR_RED,string8);
  36.  
  37. GetPlayerName(playerid, name, sizeof(name));
  38. format(string7,sizeof(string7),"{FFFF00}* %s(%d) Has paid you: $%i",name,playerid,amount);
  39. SendClientMessage(ID,COLOR_RED,string7);
  40. GivePlayerMoney(ID,amount);
  41. GivePlayerMoney(playerid,-amount);
  42. return 1;
  43. }
  44.  
  45.  
  46. #endif
Advertisement
Add Comment
Please, Sign In to add comment