Advertisement
Guest User

Untitled

a guest
Mar 17th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.37 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 <zcmd>
  7. #include <sscanf2>
  8. #include <Dini>
  9.  
  10. #define rouge 0xFF0000FF
  11. #define gris 0xC0C0C0FF
  12. #define orange 0xFF8000FF
  13.  
  14. #define DIALOG_REGISTER 1
  15. #define DIALOG_LOGIN 2
  16. #define DIALOG_SUCCESS_1 3
  17. #define DIALOG_SUCCESS_2 4
  18. #define DIALOG_AIDE_1 5
  19. #define DIALOG_AIDE_2 6
  20.  
  21. #define save "/Comptes/%s.ini"
  22.  
  23.  
  24. enum pOptions
  25. {
  26. pMDP,
  27. pSkin,
  28. pAdmin,
  29. pModo,
  30. pMDC,
  31. };
  32. new pInfo[MAX_PLAYERS][pOptions];
  33.  
  34. #if defined FILTERSCRIPT
  35.  
  36. public OnFilterScriptInit()
  37. {
  38. print("\n--------------------------------------");
  39. print(" Blank Filterscript by your name here");
  40. print("--------------------------------------\n");
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. return 1;
  47. }
  48.  
  49. #else
  50.  
  51. main()
  52. {
  53. print("\n----------------------------------");
  54. print(" Blank Gamemode by your name here");
  55. print("----------------------------------\n");
  56. }
  57.  
  58. #endif
  59.  
  60. public OnGameModeInit()
  61. {
  62. // Don't use these lines if it's a filterscript
  63. SetGameModeText("Pre-Alpha v0.0.1");
  64. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  65. return 1;
  66. }
  67.  
  68. public OnGameModeExit()
  69. {
  70. return 1;
  71. }
  72.  
  73. public OnPlayerRequestClass(playerid, classid)
  74. {
  75. return 1;
  76. }
  77.  
  78. public OnPlayerConnect(playerid)
  79. {
  80. new pName[MAX_PLAYER_NAME];
  81. GetPlayerName(playerid, pName, sizeof(pName));
  82. new path[100];
  83. format(path, sizeof(path), save, pName);
  84. if(fexist(path))
  85. {
  86. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Connection","Veuillez entrer votre mot de passe pour vous connecter.","Connexion","Quitter");
  87. }
  88. else
  89. {
  90. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Enregistrement","Entrez un mot de passe afin de créer un compte.","S'enregistrer","Quitter");
  91. }
  92. return 1;
  93. }
  94. public OnPlayerDisconnect(playerid, reason)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerSpawn(playerid)
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerDeath(playerid, killerid, reason)
  105. {
  106. return 1;
  107. }
  108.  
  109. public OnVehicleSpawn(vehicleid)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnVehicleDeath(vehicleid, killerid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnPlayerText(playerid, text[])
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerCommandText(playerid, cmdtext[])
  125. {
  126. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  127. {
  128. // Do something here
  129. return 1;
  130. }
  131. return 0;
  132. }
  133.  
  134. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnPlayerExitVehicle(playerid, vehicleid)
  140. {
  141. return 1;
  142. }
  143.  
  144. public OnPlayerStateChange(playerid, newstate, oldstate)
  145. {
  146. return 1;
  147. }
  148.  
  149. public OnPlayerEnterCheckpoint(playerid)
  150. {
  151. return 1;
  152. }
  153.  
  154. public OnPlayerLeaveCheckpoint(playerid)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerEnterRaceCheckpoint(playerid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerLeaveRaceCheckpoint(playerid)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnRconCommand(cmd[])
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnPlayerRequestSpawn(playerid)
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnObjectMoved(objectid)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnPlayerObjectMoved(playerid, objectid)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnPlayerPickUpPickup(playerid, pickupid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnVehicleMod(playerid, vehicleid, componentid)
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnPlayerSelectedMenuRow(playerid, row)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerExitedMenu(playerid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnRconLoginAttempt(ip[], password[], success)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnPlayerUpdate(playerid)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerStreamIn(playerid, forplayerid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnPlayerStreamOut(playerid, forplayerid)
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnVehicleStreamIn(vehicleid, forplayerid)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnVehicleStreamOut(vehicleid, forplayerid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  260. {
  261. new pName[MAX_PLAYER_NAME];
  262. GetPlayerName(playerid, pName, sizeof(pName));
  263. new path[100];
  264. format(path, sizeof(path), save, pName);
  265. switch( dialogid )
  266. {
  267. case DIALOG_REGISTER:
  268. {
  269. if (!response) return Kick(playerid);
  270. if(response)
  271. {
  272. dini_Create(path);
  273. dini_IntSet(path, "MDP", strlen(inputtext));
  274. dini_IntSet(path, "Admin", 0);
  275. dini_IntSet(path, "Modo", 0);
  276. dini_IntSet(path, "MDC", 0);
  277. dini_IntSet(path, "Skin", 0);
  278. ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX, "Succès !", "Vous vous êtes enregistré avec succès !Bon jeu.", "OK", "");
  279. }
  280. }
  281.  
  282. case DIALOG_LOGIN:
  283. {
  284. new pw[300];
  285. pw = dini_Get(path, "MDP");
  286. if ( !response ) return Kick ( playerid );
  287. if( response )
  288. {
  289. if(strcmp(inputtext, pw, true) == 0)
  290. {
  291. SetPlayerSkin(playerid, dini_Int(path, "Skin"));
  292. dini_IntSet(path, "Admin",pInfo[playerid][pAdmin]);
  293. dini_IntSet(path, "Modo",pInfo[playerid][pModo]);
  294. dini_IntSet(path, "MDC",pInfo[playerid][pMDC]);
  295. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX, "Succès !", "Vous vous êtes connecté avec succès !Bon jeu.", "OK", "");
  296. }
  297. else return Kick(playerid);
  298. return 1;
  299. }
  300. }
  301. }
  302. return 1;
  303. }
  304. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  305. {
  306. return 1;
  307. }
  308. CMD:aide(playerid, params[])
  309. {
  310. if(pInfo[playerid][pAdmin] == 0 || pInfo[playerid][pMDC] == 0 || pInfo[playerid][pModo] == 0)
  311. {
  312. ShowPlayerDialog(playerid, DIALOG_AIDE_1, DIALOG_STYLE_MSGBOX,"AIDE", "{FFFF00}Commandes générales :\n", "OK", "");
  313. }
  314. else if(pInfo[playerid][pAdmin] == 1 || pInfo[playerid][pModo] == 1)
  315. {
  316. ShowPlayerDialog(playerid, DIALOG_AIDE_2, DIALOG_STYLE_MSGBOX,"AIDE", "{FFFF00}Commandes générales :\n\n{FF0000}Commandes d'administrations:\n/setskin - /vspawn", "OK", "");
  317. }
  318. return 1;
  319. }
  320. CMD:setskin(playerid, params[])
  321. {
  322. new skinid;
  323. new player;
  324. if(!sscanf(params, "ii", player, skinid))
  325. {
  326. if(skinid > 299)
  327. {
  328. SendClientMessage(playerid, rouge, "Attention ! Skin id ne doivent pas dépasser 299. Sous peine de crash.");
  329. }
  330. else if(player == INVALID_PLAYER_ID)
  331. {
  332. SendClientMessage(playerid, gris, "USAGE: /setskin <ID> <IDSKIN>");
  333. }
  334. else SetPlayerSkin(playerid, skinid);
  335. }
  336. else SendClientMessage(playerid, gris, "USAGE: /setskin <ID> <IDSKIN>");
  337. return 1;
  338. }
  339. CMD:vspawn(playerid, params[])
  340. {
  341. new vid;
  342. new Float:X, Float:Y, Float:Z, Float:Rot;
  343. GetPlayerFacingAngle(playerid, Rot);
  344. GetPlayerPos(playerid, X,Y,Z);
  345. if(pInfo[playerid][pAdmin] == 1 || pInfo[playerid][pModo] == 1)
  346. {
  347. if(!sscanf(params,"i", vid))
  348. {
  349. CreateVehicle(vid, X,Y,Z,Rot,-1,-1, 60);
  350. SendClientMessage(playerid, gris, "Véhicule spawn.");
  351. }
  352. else SendClientMessage(playerid, gris,"USAGE:/vspawn <ID>");
  353. }
  354. else SendClientMessage(playerid, rouge, "Vous n'êtes pas Administrateur/Modérateur du serveur. Faites une demande aux admins.");
  355. return 1;
  356. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement