Advertisement
Guest User

Untitled

a guest
Mar 8th, 2015
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.31 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 <dini>
  7. #include <dudb>
  8.  
  9. #pragma unused ret_memcpy
  10. #define COLOR_GRAD1 0xB4B5B7FF
  11. #define COLOR_GRAD2 0xBFC0C2FF
  12. #define COLOR_GRAD3 0xCBCCCEFF
  13. #define COLOR_GRAD4 0xD8D8D8FF
  14. #define COLOR_GRAD5 0xE3E3E3FF
  15. #define COLOR_GRAD6 0xF0F0F0FF
  16. #define COLOR_GREY 0xAFAFAFAA
  17. #define COLOR_GREEN 0x33AA33AA
  18. #define COLOR_RED 0xAA3333AA
  19. #define COLOR_YELLOW 0xFFFF00AA
  20. #define COLOR_WHITE 0xFFFFFFAA
  21. #define COLOR_FADE1 0xE6E6E6E6
  22. #define COLOR_FADE2 0xC8C8C8C8
  23. #define COLOR_FADE3 0xAAAAAAAA
  24. #define COLOR_FADE4 0x8C8C8C8C
  25. #define COLOR_FADE5 0x6E6E6E6E
  26. #define COLOR_PURPLE 0xC2A2DAAA
  27. #define COLOR_DARKBLUE 0x2641FEAA
  28. #define COLOR_ALLDEPT 0xFF8282AA
  29. //=================================
  30. //Register System
  31. #define DIALOGREG 1060
  32. #define DIALOGLOGIN 1061
  33. enum pInfo{pCash, pLogged, pSkin};
  34. new Player[MAX_PLAYERS][pInfo];
  35. //=================================
  36. #if defined FILTERSCRIPT
  37.  
  38. public OnFilterScriptInit()
  39. {
  40.     print("\n--------------------------------------");
  41.     print(" Blank Filterscript by your name here");
  42.     print("--------------------------------------\n");
  43.     return 1;
  44. }
  45.  
  46. public OnFilterScriptExit()
  47. {
  48.     return 1;
  49. }
  50.  
  51. #else
  52.  
  53. main()
  54. {
  55.     print("\n----------------------------------");
  56.     print(" Blank Gamemode by your name here");
  57.     print("----------------------------------\n");
  58. }
  59.  
  60. #endif
  61.  
  62. public OnGameModeInit()
  63. {
  64.     // Don't use these lines if it's a filterscript
  65.     SetGameModeText("Blank Script");
  66.     AddPlayerClass(24,1958.3783,1343.1572,15.3746,0,0,0,0,0,0,0);
  67.     return 1;
  68. }
  69.  
  70. public OnGameModeExit()
  71. {
  72.     return 1;
  73. }
  74.  
  75. public OnPlayerRequestClass(playerid, classid)
  76. {
  77. //  SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  78. //  SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  79. //  SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  80. //  TogglePlayerSpectating(playerid, true);
  81.     return 1;
  82. }
  83.  
  84. public OnPlayerConnect(playerid)
  85. {
  86.     new Name[MAX_PLAYER_NAME];
  87.     new file[256];
  88.     GetPlayerName(playerid, Name, sizeof(Name));
  89.     format(file, sizeof(file), "Utenti/%s", Name);
  90.     if(!dini_Exists(file))
  91.     ShowPlayerDialog(playerid, DIALOGREG, DIALOG_STYLE_PASSWORD, "You need to register", "Enter a password below to register a new account", "Done", "Exit");
  92.     else
  93.     ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Welcome!", " Enter your password below to Log-In ", "Done", "Exit");
  94.     return 1;
  95. }
  96.  
  97. public OnPlayerDisconnect(playerid, reason)
  98. {
  99.     new Name[MAX_PLAYER_NAME];
  100.     new file[256];
  101.     if(!Player[playerid][pLogged]) return 1;
  102.     GetPlayerName(playerid, Name, sizeof(Name));
  103.     format(file, sizeof(file), "Utenti/%s", Name);
  104.     dini_IntSet(file, "Money", GetPlayerMoney(playerid));
  105.     Player[playerid][pLogged] = 0;
  106.     return 1;
  107. }
  108.  
  109. public OnPlayerSpawn(playerid)
  110. {
  111.     return 1;
  112. }
  113.  
  114. public OnPlayerDeath(playerid, killerid, reason)
  115. {
  116.     return 1;
  117. }
  118.  
  119. public OnVehicleSpawn(vehicleid)
  120. {
  121.     return 1;
  122. }
  123.  
  124. public OnVehicleDeath(vehicleid, killerid)
  125. {
  126.     return 1;
  127. }
  128.  
  129. public OnPlayerText(playerid, text[])
  130. {
  131.     return 1;
  132. }
  133.  
  134. public OnPlayerCommandText(playerid, cmdtext[])
  135. {
  136.     if (strcmp("/suicide", cmdtext, true, 8) == 0)
  137.     {
  138.         SetPlayerHealth(playerid, 0);
  139.         return 1;
  140.     }
  141.     if (strcmp("/money", cmdtext, true, 6) == 0)
  142.     {
  143.         GivePlayerMoney(playerid, 2398);
  144.         return 1;
  145.     }
  146.     if(!strcmp(cmdtext, "/me", true, 3))
  147.     {
  148.         if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [Action]");
  149.         new name[128];
  150.         GetPlayerName(playerid, name, sizeof(name));
  151.         format(name, sizeof(name), "* %s %s", name, cmdtext[3]);
  152.         SendClientMessageToAll(0xFFFF00AA, name);
  153.         return 1;
  154.     }
  155.     if(!strcmp(cmdtext, "/do", true, 3))
  156.     {
  157.         if(!cmdtext[3]) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /do [Action]");
  158.         new name[128];
  159.         GetPlayerName(playerid, name, sizeof(name));
  160.         format(name, sizeof(name), "* %s (( %s ))", cmdtext[4], name);
  161.         SendClientMessageToAll(0xFFFF00AA, name);
  162.         return 1;
  163.     }
  164.     return 0;
  165. }
  166.  
  167. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  168. {
  169.     return 1;
  170. }
  171.  
  172. public OnPlayerExitVehicle(playerid, vehicleid)
  173. {
  174.     return 1;
  175. }
  176.  
  177. public OnPlayerStateChange(playerid, newstate, oldstate)
  178. {
  179.     return 1;
  180. }
  181.  
  182. public OnPlayerEnterCheckpoint(playerid)
  183. {
  184.     return 1;
  185. }
  186.  
  187. public OnPlayerLeaveCheckpoint(playerid)
  188. {
  189.     return 1;
  190. }
  191.  
  192. public OnPlayerEnterRaceCheckpoint(playerid)
  193. {
  194.     return 1;
  195. }
  196.  
  197. public OnPlayerLeaveRaceCheckpoint(playerid)
  198. {
  199.     return 1;
  200. }
  201.  
  202. public OnRconCommand(cmd[])
  203. {
  204.     return 1;
  205. }
  206.  
  207. public OnPlayerRequestSpawn(playerid)
  208. {
  209.     return 1;
  210. }
  211.  
  212. public OnObjectMoved(objectid)
  213. {
  214.     return 1;
  215. }
  216.  
  217. public OnPlayerObjectMoved(playerid, objectid)
  218. {
  219.     return 1;
  220. }
  221.  
  222. public OnPlayerPickUpPickup(playerid, pickupid)
  223. {
  224.     return 1;
  225. }
  226.  
  227. public OnVehicleMod(playerid, vehicleid, componentid)
  228. {
  229.     return 1;
  230. }
  231.  
  232. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  233. {
  234.     return 1;
  235. }
  236.  
  237. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  238. {
  239.     return 1;
  240. }
  241.  
  242. public OnPlayerSelectedMenuRow(playerid, row)
  243. {
  244.     return 1;
  245. }
  246.  
  247. public OnPlayerExitedMenu(playerid)
  248. {
  249.     return 1;
  250. }
  251.  
  252. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  253. {
  254.     return 1;
  255. }
  256.  
  257. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  258. {
  259.     return 1;
  260. }
  261.  
  262. public OnRconLoginAttempt(ip[], password[], success)
  263. {
  264.     return 1;
  265. }
  266.  
  267. public OnPlayerUpdate(playerid)
  268. {
  269.     return 1;
  270. }
  271.  
  272. public OnPlayerStreamIn(playerid, forplayerid)
  273. {
  274.     return 1;
  275. }
  276.  
  277. public OnPlayerStreamOut(playerid, forplayerid)
  278. {
  279.     return 1;
  280. }
  281.  
  282. public OnVehicleStreamIn(vehicleid, forplayerid)
  283. {
  284.     return 1;
  285. }
  286.  
  287. public OnVehicleStreamOut(vehicleid, forplayerid)
  288. {
  289.     return 1;
  290. }
  291.  
  292. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  293. {
  294.     if (dialogid == DIALOGREG)
  295.     {
  296.         new Name[MAX_PLAYER_NAME];
  297.         new file[256];
  298.         if(!response) return Kick(playerid);
  299.         if(!strlen(inputtext)) return
  300.         ShowPlayerDialog(playerid, DIALOGREG, DIALOG_STYLE_PASSWORD, "You need to register", "Enter a password below to register a new account", "Done", "Exit");
  301.         GetPlayerName(playerid, Name, sizeof(Name));
  302.         format(file, sizeof(file), "Utenti/%s", Name);
  303.         dini_Create(file);
  304.         dini_IntSet(file, "Money", 5000);
  305.         dini_Set(file, "Password", inputtext);
  306.         ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Welcome!", " Enter your password below to Log-In ", "Done", "Exit");
  307.         SetSpawnInfo(playerid, 0, 26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  308.         return 1;
  309.     }
  310.     if (dialogid == DIALOGLOGIN)
  311.     {
  312.         new Name[MAX_PLAYER_NAME];
  313.         new file[256];
  314.         if(!response) return Kick(playerid);
  315.         GetPlayerName(playerid, Name, sizeof(Name));
  316.         format(file, sizeof(file), "Utenti/%s", Name);
  317.         new Pass[260];
  318.         Pass = dini_Get(file, "Password");
  319.         if(strcmp(Pass, inputtext, true) || !strlen(inputtext))
  320.         {
  321.             ShowPlayerDialog(playerid, DIALOGLOGIN, DIALOG_STYLE_PASSWORD, "Wrong Password!", "Enter your own password below to LogIn", "Done", "Exit");
  322.             return 1;
  323.         }
  324.         GivePlayerMoney(playerid, dini_Int(file, "Money"));
  325.         Player[playerid][pLogged] = 1;
  326.         SetSpawnInfo(playerid, 0, 26, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  327.         SpawnPlayer(playerid);
  328.  
  329.         return 1;
  330.     }
  331.     return 1;
  332. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement