Advertisement
Guest User

loginreg

a guest
Oct 14th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. //COLOR DEFINES
  2. #define COLOR_WHITE 0xFFFFFFAA
  3. #define COLOR_YELLOW 0xFFFF00AA
  4.  
  5. #include <a_samp>
  6. #include <YSI\y_ini>
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10. main()
  11. {
  12. print("\n----------------------------------");
  13. print(" Stunt GM by Aleksi");
  14. print("----------------------------------\n");
  15. }
  16.  
  17. #define Money 1
  18. #define AdminLevel 3
  19.  
  20. new player[MAX_PLAYERS];
  21. new setts[3][] = {"password","money","AdminLevel"};
  22. new playerPass[MAX_PLAYERS][128];
  23.  
  24. public OnFilterScriptExit()
  25. {
  26. return 1;
  27. }
  28.  
  29. #else
  30.  
  31. #endif
  32.  
  33. public OnGameModeInit()
  34. {
  35. // Don't use these lines if it's a filterscript
  36. SetGameModeText("Stunt GM");
  37. //Skins
  38. AddPlayerClass(0,1544.2236,-1353.1954,329.4745,355.1471,0,0,0,0,0,0); // spawnpoint
  39. AddPlayerClass(1,1544.2236,-1353.1954,329.4745,355.1471,0,0,0,0,0,0); // spawnpoint
  40. //Vehicles
  41.  
  42. //Objects
  43.  
  44. return 1;
  45. }
  46.  
  47. public OnGameModeExit()
  48. {
  49. return 1;
  50. }
  51.  
  52. public OnPlayerRequestClass(playerid, classid)
  53. {
  54. SetPlayerPos(playerid, 1093.9215,-807.1360,107.4194);
  55. SetPlayerCameraPos(playerid, 1093.6425,-805.5609,107.4196);
  56. SetPlayerCameraLookAt(playerid, 1093.9215,-807.1360,107.4194);
  57. return 1;
  58. }
  59.  
  60. // YSI //
  61. forward LoadSettings(playerid, name[], value[]);
  62. public LoadSettings(playerid, name[], value[])
  63. {
  64. for(new i=0; i<7; i++)
  65. {
  66. if(i==0)
  67. {
  68. INI_String(setts[i],player[playerid][i]);
  69. }
  70. else
  71. {
  72. INI_Int(setts[i],player[playerid][i]);
  73. }
  74. }
  75. return 0;
  76. }
  77.  
  78. public OnPlayerConnect(playerid)
  79. {
  80. if(!IsPlayerNPC(playerid))
  81. {
  82. newPlayer = false;
  83. TogglePlayerSpectating(playerid,1);
  84. new string[256], name[MAX_PLAYER_NAME];
  85. GetPlayerName(playerid,name,sizeof(name));
  86. format(string,256,"~r~Hello %s !",name);
  87. GameTextForPlayer(playerid,string,10000,6);
  88. format(string,256,"Players/%s.ini",name);
  89. MyTextDraw(playerid);
  90. if(fexist(string))
  91. {
  92. INI_ParseFile(string,"LoadSettings", .bExtra=true, .extra=playerid);
  93. SetPlayerScore(playerid,player[playerid]);
  94. ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Welcome! Please Login","Login","Exit");
  95. }
  96. else
  97. {
  98. ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register","Welcome! Please Register!","Register","Exit");
  99. newPlayer = true;
  100. }
  101. }
  102. return 1;
  103. }
  104.  
  105. public OnPlayerDisconnect(playerid, reason)
  106. {
  107. SavePlayerSettings(playerid);
  108. return 1;
  109. }
  110.  
  111. public OnPlayerSpawn(playerid)
  112. {
  113. return 1;
  114. }
  115.  
  116. public OnPlayerDeath(playerid, killerid, reason)
  117. {
  118. return 1;
  119. }
  120.  
  121. public OnVehicleSpawn(vehicleid)
  122. {
  123. return 1;
  124. }
  125.  
  126. public OnVehicleDeath(vehicleid, killerid)
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnPlayerText(playerid, text[])
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnPlayerCommandText(playerid, cmdtext[])
  137. {
  138. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  139. {
  140. // Do something here
  141. return 1;
  142. }
  143. return 0;
  144. }
  145.  
  146. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnPlayerExitVehicle(playerid, vehicleid)
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnPlayerStateChange(playerid, newstate, oldstate)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnPlayerEnterCheckpoint(playerid)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnPlayerLeaveCheckpoint(playerid)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnPlayerEnterRaceCheckpoint(playerid)
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnPlayerLeaveRaceCheckpoint(playerid)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnRconCommand(cmd[])
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerRequestSpawn(playerid)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnObjectMoved(objectid)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnPlayerObjectMoved(playerid, objectid)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnPlayerPickUpPickup(playerid, pickupid)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnVehicleMod(playerid, vehicleid, componentid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnPlayerSelectedMenuRow(playerid, row)
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnPlayerExitedMenu(playerid)
  227. {
  228. return 1;
  229. }
  230.  
  231. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  232. {
  233. return 1;
  234. }
  235.  
  236. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  237. {
  238. return 1;
  239. }
  240.  
  241. public OnRconLoginAttempt(ip[], password[], success)
  242. {
  243. return 1;
  244. }
  245.  
  246. public OnPlayerUpdate(playerid)
  247. {
  248. return 1;
  249. }
  250.  
  251. public OnPlayerStreamIn(playerid, forplayerid)
  252. {
  253. return 1;
  254. }
  255.  
  256. public OnPlayerStreamOut(playerid, forplayerid)
  257. {
  258. return 1;
  259. }
  260.  
  261. public OnVehicleStreamIn(vehicleid, forplayerid)
  262. {
  263. return 1;
  264. }
  265.  
  266. public OnVehicleStreamOut(vehicleid, forplayerid)
  267. {
  268. return 1;
  269. }
  270.  
  271. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  272. {
  273. return 1;
  274. }
  275.  
  276. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  277. {
  278. return 1;
  279. }
  280. // YSI //
  281. SavePlayerSettings(playerid)
  282. {
  283. new string[256],name[MAX_PLAYER_NAME];
  284. GetPlayerName(playerid,name,sizeof(name));
  285. format(string,256,"Players/%s.ini",name);
  286. new INI:acc = INI_Open(string);
  287. for(new i=0M i<7; i++)
  288. {
  289. if(i==0)
  290. INI_WriteString(acc,setts[i],playerPass[playerid]);
  291. else INI_WriteInt(acc,setts[i],player[playerid]);
  292. }
  293. INI_Close(acc);
  294. }
  295. // YSI END //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement