Guest User

REgister

a guest
Sep 23rd, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.26 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. //INCLUDES .INC
  5. #include <a_samp>
  6. #include <YSI\y_ini>
  7. //DEFINES
  8. #define DIALOG_REGISTER 1
  9. #define DIALOG_LOGIN 2
  10. #define DIALOG_SUCCESS_1 3
  11. #define DIALOG_SUCCESS_2 4
  12.  
  13. //COLORS
  14. #define COL_WHITE "{FFFFFF}"
  15. #define COL_RED "{F81414}"
  16. #define COL_GREEN "{00FF22}"
  17. #define COL_LIGHTBLUE "{00CED1}"
  18.  
  19. //PATH
  20. #define PATH "Test/Users/%s.ini"
  21.  
  22. #if defined FILTERSCRIPT
  23.  
  24. public OnFilterScriptInit()
  25. {
  26.     print("\n--------------------------------------");
  27.     print(" Test Loaded!");
  28.     print("--------------------------------------\n");
  29.     return 1;
  30. }
  31.  
  32. enum pInfo
  33. {
  34.     pPass,
  35.     pCash,
  36.     pAdmin,
  37.     pKills,
  38.     pDeaths
  39. }
  40. new PlayerInfo[MAX_PLAYERS][pInfo];
  41.  
  42. forward LoadUser_data(playerid,name[],value[]);
  43. public LoadUser_data(playerid,name[],value[])
  44. {
  45.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  46.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  47.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  48.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  49.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  50.     return 1;
  51. }
  52.  
  53. stock Test/Users/%s.ini(playerid)
  54. {
  55.     new string[128],playername[MAX_PLAYER_NAME];
  56.     GetPlayerName(playerid,playername,sizeof(playername));
  57.     format(string,sizeof(string),PATH,playername);
  58.     return string;
  59. }
  60.  
  61. stock udb_hash(buf[]) {
  62.     new length=strlen(buf);
  63.     new s1 = 1;
  64.     new s2 = 0;
  65.     new n;
  66.     for (n=0; n<length; n++)
  67.     {
  68.        s1 = (s1 + buf[n]) % 65521;
  69.        s2 = (s2 + s1)     % 65521;
  70.     }
  71.     return (s2 << 16) + s1;
  72. }
  73.  
  74. public OnFilterScriptExit()
  75. {
  76.     return 1;
  77. }
  78.  
  79. #else
  80.  
  81. main()
  82. {
  83.     print("\n----------------------------------");
  84.     print(" Blank Gamemode by your name here");
  85.     print("----------------------------------\n");
  86. }
  87.  
  88. #endif
  89.  
  90. public OnGameModeInit()
  91. {
  92.     // Don't use these lines if it's a filterscript
  93.     SetGameModeText("Blank Script");
  94.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  95.     return 1;
  96. }
  97.  
  98.  
  99.  
  100. public OnGameModeExit()
  101. {
  102.     return 1;
  103. }
  104.  
  105. public OnPlayerRequestClass(playerid, classid)
  106. {
  107.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  108.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  109.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  110.     return 1;
  111. }
  112.  
  113. public OnPlayerConnect(playerid)
  114. {
  115.     if(fexist(Test/Users/(playerid)))
  116.     {
  117.         INI_ParseFile(Test/Users/(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  118.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Leave!");
  119.     }
  120.     else
  121.     {
  122.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  123.     }
  124.     return 1;
  125. }
  126.  
  127. public OnPlayerDisconnect(playerid, reason)
  128. {
  129.     return 1;
  130. }
  131.  
  132. public OnPlayerSpawn(playerid)
  133. {
  134.     return 1;
  135. }
  136.  
  137. public OnPlayerDeath(playerid, killerid, reason)
  138. {
  139.     return 1;
  140. }
  141.  
  142. public OnVehicleSpawn(vehicleid)
  143. {
  144.     return 1;
  145. }
  146.  
  147. public OnVehicleDeath(vehicleid, killerid)
  148. {
  149.     return 1;
  150. }
  151.  
  152. public OnPlayerText(playerid, text[])
  153. {
  154.     return 1;
  155. }
  156.  
  157. public OnPlayerCommandText(playerid, cmdtext[])
  158. {
  159.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  160.     {
  161.         // Do something here
  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.     return 1;
  295. }
  296.  
  297. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  298. {
  299.     return 1;
  300. }
Advertisement
Add Comment
Please, Sign In to add comment