Advertisement
FamiliaSAMP

FILTERSCRIPT - Cash Activation Code [FAMILIASAMP.COM]

Mar 19th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #if defined FILTERSCRIPT
  4.  
  5. #endif
  6.  
  7. public OnPlayerCommandText(playerid, cmdtext[])
  8. {
  9. if (strcmp("/cactivate", cmdtext, true, 10) == 0)
  10. {
  11. ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{00FF00}Please enter activation code:", "Enter", "Cancel");
  12. return 1;
  13. }
  14. return 0;
  15. }
  16.  
  17. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  18. {
  19. if(dialogid == 12)
  20. {
  21. if(!response) return 0;
  22. if(!strlen(inputtext)) ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{00FF00}Please enter activation code: (letter case sensivity)", "Enter", "Cancel");
  23. if(response)
  24. {
  25. new Str[128];
  26. format(Str, sizeof(Str), "%s", inputtext);
  27. if(!strcmp(inputtext, Str, false))
  28. {
  29. new Str2[128];
  30. format(Str2, sizeof(Str2), "Codes/%s.txt", inputtext);
  31. if(fexist(Str2))
  32. {
  33. GivePlayerMoney(playerid, 5000000);
  34. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  35. new Str3[128];
  36. format(Str3, sizeof(Str3), "{FFFFFF}Code: {00FF00}%s {FFFF00}activated {00FF00}succesfully {FF0000}this code cannot be used anymore!", inputtext);
  37. SendClientMessage(playerid, 0xFFFFFFFF, Str3);
  38. fremove(Str2);
  39. }
  40. else
  41. {
  42. ShowPlayerDialog(playerid, 12, DIALOG_STYLE_INPUT, "{00FF00}Activation", "{FF0000}The code youve entered is either wrong either used allready! try again.", "Enter", "Cancel");
  43. }
  44. }
  45. }
  46. }
  47. return 1;
  48. }
  49.  
  50. //By UltraScripter//////////////////////////////////////////////////////
  51. //By UltraScripter//////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement