daily pastebin goal
20%
SHARE
TWEET

Untitled

a guest May 16th, 2018 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4.  
  5. #define MAX_PAacc 500
  6. enum Premium_Code
  7. {
  8. PA_Besitzer[64],premiumcode
  9. };
  10. new paInfo[MAX_PLAYERS][Premium_Code];
  11.  
  12. main()
  13. {
  14.     print("\n----------------------------------");
  15.     print(" Premiumaccountsystem mit Codes by Sven");
  16.     print("----------------------------------\n");
  17. }
  18. public OnGameModeInit()
  19. {
  20.     for(new pacc=1;pacc<MAX_PAacc;pacc++)
  21.     {
  22.         LoadPA(pacc);
  23.     }
  24.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  25.     return 1;
  26. }
  27.  
  28. public OnGameModeExit()
  29. {
  30.     return 1;
  31. }
  32.  
  33. public OnPlayerRequestClass(playerid, classid)
  34. {
  35.     return 1;
  36. }
  37.  
  38. public OnPlayerConnect(playerid)
  39. {
  40.     return 1;
  41. }
  42.  
  43. public OnPlayerDisconnect(playerid, reason)
  44. {
  45.     return 1;
  46. }
  47.  
  48. public OnPlayerSpawn(playerid)
  49. {
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerDeath(playerid, killerid, reason)
  54. {
  55.     return 1;
  56. }
  57.  
  58. public OnVehicleSpawn(vehicleid)
  59. {
  60.     return 1;
  61. }
  62.  
  63. public OnVehicleDeath(vehicleid, killerid)
  64. {
  65.     return 1;
  66. }
  67.  
  68. public OnPlayerText(playerid, text[])
  69. {
  70.     return 1;
  71. }
  72.  
  73. public OnPlayerCommandText(playerid, cmdtext[])
  74. {
  75.     if(strcmp("/premiumaccount", cmdtext, true, 10) == 0)
  76.     {
  77.         ShowPlayerDialog(playerid,999,DIALOG_STYLE_INPUT,"Premiumaccount-Code einlösen","Bitte gib hier den Premiumcode ein den du von einem Admin erhalten hast:","Einlösen","Abbrechen");
  78.         return 1;
  79.     }
  80.     if(strcmp("/createpa", cmdtext, true, 10) == 0)
  81.     {
  82.         ShowPlayerDialog(playerid,997,DIALOG_STYLE_MSGBOX,"Premiumaccount-Code erstellen","Bist du dir sicher das du einen neuen Premiumaccount erstellen möchtest?","Ja","Abbrechen");
  83.         return 1;
  84.     }
  85.     return 0;
  86. }
  87.  
  88. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  89. {
  90.     return 1;
  91. }
  92.  
  93. public OnPlayerExitVehicle(playerid, vehicleid)
  94. {
  95.     return 1;
  96. }
  97.  
  98. public OnPlayerStateChange(playerid, newstate, oldstate)
  99. {
  100.     return 1;
  101. }
  102.  
  103. public OnPlayerEnterCheckpoint(playerid)
  104. {
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerLeaveCheckpoint(playerid)
  109. {
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerEnterRaceCheckpoint(playerid)
  114. {
  115.     return 1;
  116. }
  117.  
  118. public OnPlayerLeaveRaceCheckpoint(playerid)
  119. {
  120.     return 1;
  121. }
  122.  
  123. public OnRconCommand(cmd[])
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerRequestSpawn(playerid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnObjectMoved(objectid)
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerObjectMoved(playerid, objectid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerPickUpPickup(playerid, pickupid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnVehicleMod(playerid, vehicleid, componentid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerSelectedMenuRow(playerid, row)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnPlayerExitedMenu(playerid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnRconLoginAttempt(ip[], password[], success)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnPlayerUpdate(playerid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnPlayerStreamIn(playerid, forplayerid)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerStreamOut(playerid, forplayerid)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnVehicleStreamIn(vehicleid, forplayerid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnVehicleStreamOut(vehicleid, forplayerid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  214. {
  215.     if(dialogid == 997)
  216.     {
  217.         if(response)
  218.         {
  219.             for(new pa=1;pa<MAX_PAacc;pa++)
  220.             {
  221.                 new save[50];
  222.                 format(save,50,"/Premiumaccounts/%d.txt",pa);
  223.                 if(!fexist(save))
  224.                 {
  225.                     dini_Create(save);
  226.                     new rand = 100 + random(10000);
  227.                     paInfo[pa][premiumcode] = rand;
  228.                     dini_IntSet(save,"PA_Code",paInfo[pa][premiumcode]);
  229.                     LoadPA(pa);
  230.                    
  231.                     new string[125];
  232.                     format(string,sizeof(string),"Du hast soeben erfolgreich einen Premiumaccount erstellt.\nFalls jemand ihn einlösen will muss er nun diesen Code einlösen: %d",paInfo[pa][premiumcode]);
  233.                     ShowPlayerDialog(playerid,998,DIALOG_STYLE_MSGBOX,"Erfolgreich",string,"Bestätigen","Bestätigen");
  234.                     break;
  235.                 }
  236.             }
  237.             return 1;
  238.         }
  239.         else if(!response)
  240.         {
  241.             return 1;
  242.         }
  243.     }
  244.     if(dialogid == 999)
  245.     {
  246.         if(response)
  247.         {
  248.             for(new pa=1;pa<MAX_PAacc;pa++)
  249.             {
  250.                 new save[128];
  251.                 format(save,sizeof(save),"Premiumaccounts/%s.txt",pa);
  252.                 format(paInfo[pa][premiumcode], 50,dini_Get(save, "PA_Code"));
  253.                 if(!strlen(inputtext))
  254.                 {
  255.                     ShowPlayerDialog(playerid,999,DIALOG_STYLE_INPUT,"Premiumaccount-Code einlösen","Wenn du keinen Code eingibst kannst du auch kein Premiumaccount einlösen.\nGib bitte nun einen Code ein:","Einlösen","Abbrechen");
  256.                     return SendClientMessage(playerid,0xFFFFFFFF,"Du hast kein Premiumcode eingegeben!");
  257.                 }
  258.                 if(strcmp(inputtext, paInfo[pa][premiumcode], true))
  259.                 {
  260.                     ShowPlayerDialog(playerid,999,DIALOG_STYLE_INPUT,"Falscher Code","{FFFFFF}Du hast keinen gültigen Premiumaccountcode eingegeben.\nBitte gib nun einen gültigen ein oder lass es gut sein:","Einlösen","Abbrechen");
  261.                     SendClientMessage(playerid,0xFFFFFFFF,"Falscher Premiumaccount Code!");
  262.                 }
  263.                 else if(!strcmp(inputtext, paInfo[pa][premiumcode], true))
  264.                 {
  265.                     new name[MAX_PLAYER_NAME];
  266.                     GetPlayerName(playerid,name,sizeof name);
  267.                     if(strcmp(paInfo[pa][PA_Besitzer],"Keiner",false))return SendClientMessage(playerid,0xFE0000FF,"Dieser Premiumaccount-Code ist schon benutzt!");
  268.                     SendClientMessage(playerid,0xFFFFFFFF,"Herzlichen Glückwunsch du bist nun erfolgreicher Premiumaccountuser.");
  269.                 }
  270.                 break;
  271.             }
  272.         }
  273.     }
  274.     return 1;
  275. }
  276.  
  277. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  278. {
  279.     return 1;
  280. }
  281. stock LoadPA(paid)
  282. {
  283.     new pfad[50];
  284.     format(pfad,50,"/Premiumaccounts/%d.txt",paid);
  285.     if(!fexist(pfad))return 0;
  286.     paInfo[paid][premiumcode] = dini_Int(pfad,"PA_Code");
  287.     format(paInfo[paid][PA_Besitzer],32,"%s",dini_Get(pfad,"PA_Besitzer"));
  288.     return print("Alle Premiumaccounts wurden geladen");
  289. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top