Guest User

Untitled

a guest
Jun 26th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.57 KB | None | 0 0
  1. #include <a_samp>
  2. #include <SII>
  3. #pragma tabsize 0
  4.  
  5. #define DIALOG_REGISTER 2000
  6. #define DIALOG_LOGIN 2001
  7. #define WHITE "{FFFFFF}"
  8. #define RED "{F81414}"
  9. #define GREEN "{00FF22}"
  10. #define LIGHTBLUE "{00CED1}"
  11. //KRAJ BOJA
  12. new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME];
  13. enum pInfo
  14. {
  15. pPass,
  16. pScore,
  17. pCash,
  18. pAdmin
  19. }
  20. new PlayerInfo[MAX_PLAYERS][pInfo];
  21. stock getINI(playerid)
  22. {
  23. new account[64];
  24. format(account,30,"Users/%s.ini",gPlayerName[playerid]);
  25. return account;
  26. }
  27. public OnPlayerConnect(playerid)
  28. {
  29. GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME);
  30. if (fexist(getINI(playerid)))
  31. {
  32. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
  33. }
  34. else
  35. {
  36. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""WHITE"Registering...",""WHITE"Type your password below to register a new account.","Register","Quit");
  37. }
  38. return 1;
  39. }
  40.  
  41. public OnFilterScriptInit()
  42. {
  43. print("\n--------------------------------------");
  44. print(" Blank Filterscript by your name here");
  45. print("--------------------------------------\n");
  46. return 1;
  47. }
  48.  
  49. public OnFilterScriptExit()
  50. {
  51. return 1;
  52. }
  53.  
  54.  
  55. main()
  56. {
  57. print("\n----------------------------------");
  58. print(" Blank Gamemode by your name here");
  59. print("----------------------------------\n");
  60. }
  61.  
  62.  
  63. public OnGameModeInit()
  64. {
  65. // Don't use these lines if it's a filterscript
  66. SetGameModeText("Blank Script");
  67. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  68. return 1;
  69. }
  70.  
  71. public OnGameModeExit()
  72. {
  73. return 1;
  74. }
  75.  
  76. public OnPlayerRequestClass(playerid, classid)
  77. {
  78. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  79. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  80. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  81. return 1;
  82. }
  83. public OnPlayerSpawn(playerid)
  84. {
  85. return 1;
  86. }
  87.  
  88. public OnPlayerDeath(playerid, killerid, reason)
  89. {
  90. return 1;
  91. }
  92.  
  93. public OnVehicleSpawn(vehicleid)
  94. {
  95. return 1;
  96. }
  97.  
  98. public OnVehicleDeath(vehicleid, killerid)
  99. {
  100. return 1;
  101. }
  102.  
  103. public OnPlayerText(playerid, text[])
  104. {
  105. return 1;
  106. }
  107.  
  108. public OnPlayerCommandText(playerid, cmdtext[])
  109. {
  110. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  111. {
  112. // Do something here
  113. return 1;
  114. }
  115. return 0;
  116. }
  117.  
  118. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  119. {
  120. return 1;
  121. }
  122.  
  123. public OnPlayerExitVehicle(playerid, vehicleid)
  124. {
  125. return 1;
  126. }
  127.  
  128. public OnPlayerStateChange(playerid, newstate, oldstate)
  129. {
  130. return 1;
  131. }
  132.  
  133. public OnPlayerEnterCheckpoint(playerid)
  134. {
  135. return 1;
  136. }
  137.  
  138. public OnPlayerLeaveCheckpoint(playerid)
  139. {
  140. return 1;
  141. }
  142.  
  143. public OnPlayerEnterRaceCheckpoint(playerid)
  144. {
  145. return 1;
  146. }
  147.  
  148. public OnPlayerLeaveRaceCheckpoint(playerid)
  149. {
  150. return 1;
  151. }
  152.  
  153. public OnRconCommand(cmd[])
  154. {
  155. return 1;
  156. }
  157.  
  158. public OnPlayerRequestSpawn(playerid)
  159. {
  160. return 1;
  161. }
  162.  
  163. public OnObjectMoved(objectid)
  164. {
  165. return 1;
  166. }
  167.  
  168. public OnPlayerObjectMoved(playerid, objectid)
  169. {
  170. return 1;
  171. }
  172.  
  173. public OnPlayerPickUpPickup(playerid, pickupid)
  174. {
  175. return 1;
  176. }
  177.  
  178. public OnVehicleMod(playerid, vehicleid, componentid)
  179. {
  180. return 1;
  181. }
  182.  
  183. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  184. {
  185. return 1;
  186. }
  187.  
  188. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  189. {
  190. return 1;
  191. }
  192.  
  193. public OnPlayerSelectedMenuRow(playerid, row)
  194. {
  195. return 1;
  196. }
  197.  
  198. public OnPlayerExitedMenu(playerid)
  199. {
  200. return 1;
  201. }
  202.  
  203. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  204. {
  205. return 1;
  206. }
  207.  
  208. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  209. {
  210. return 1;
  211. }
  212.  
  213. public OnRconLoginAttempt(ip[], password[], success)
  214. {
  215. return 1;
  216. }
  217.  
  218. public OnPlayerUpdate(playerid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnPlayerStreamIn(playerid, forplayerid)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnPlayerStreamOut(playerid, forplayerid)
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnVehicleStreamIn(vehicleid, forplayerid)
  234. {
  235. return 1;
  236. }
  237.  
  238. public OnVehicleStreamOut(vehicleid, forplayerid)
  239. {
  240. return 1;
  241. }
  242.  
  243. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  244. {
  245. switch( dialogid )
  246. {
  247. case DIALOG_REGISTER:
  248. {
  249. if (!response) return Kick(playerid);
  250. if (response)
  251. {
  252. if(!strlen(inputtext)) {
  253. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
  254. }
  255.  
  256. if(INI_Open(getINI(playerid))) {
  257. INI_WriteString("Password",inputtext);
  258. INI_WriteInt("Score",1);
  259. INI_WriteInt("Cash",5000);
  260. INI_WriteInt("Admin",0);
  261.  
  262. INI_Save();
  263. INI_Close();
  264.  
  265. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
  266. }
  267. }
  268. }
  269. case DIALOG_LOGIN:
  270. {
  271. if ( !response ) return Kick ( playerid );
  272. if( response )
  273. {
  274. if(!strlen(inputtext)) {
  275. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
  276. }
  277.  
  278. if(INI_Open(getINI(playerid))) {
  279. INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
  280.  
  281. if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
  282. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
  283. }
  284.  
  285. SetPlayerScore( playerid, INI_ReadInt("Score" ) );
  286. ResetPlayerMoney( playerid );
  287. GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
  288. PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
  289. INI_Close();
  290. }
  291. }
  292. }
  293. }
  294. return 1;
  295. }
  296. public OnPlayerDisconnect(playerid, reason)
  297. {
  298. if(INI_Open(getINI(playerid)))
  299. {
  300. INI_WriteInt("Score",PlayerInfo[playerid][pScore]);
  301. INI_WriteInt("Cash",GetPlayerMoney(playerid));
  302. INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]);
  303.  
  304. INI_Save();
  305. INI_Close();
  306. }
  307. return 1;
  308. }
  309. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  310. {
  311. return 1;
  312. }
Advertisement
Add Comment
Please, Sign In to add comment