Advertisement
Guest User

Prblema

a guest
Aug 14th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.67 KB | None | 0 0
  1. /* _______________________________________________________________________
  2.  
  3. ~ReVo admin. By .iGs.BP~
  4.  
  5.  
  6.  
  7.  
  8.  
  9. Versione: 1.0 BETA RELOADED
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. ~Thanks to:
  17.  
  18. SA:MP Team for a_samp.inc
  19. Y_Less for sscanf and streamer
  20. Dini for i dont know
  21. TheHarlan aka Dampyr for Serial Ban
  22.  
  23.  
  24.  
  25.  
  26. // ________________________________________________________________________
  27. */
  28.  
  29. //======================Dini, dutils e a_samp
  30. #include <a_samp>
  31. #include <dini>
  32. #include <dutils>
  33.  
  34.  
  35. #pragma unused ret_memcpy
  36.  
  37.  
  38. //============================Native del Serial
  39. native gpci(playerid, serial[], maxlen);
  40.  
  41.  
  42.  
  43. //============================DcmD
  44. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  45.  
  46.  
  47. //=============== Anti DeAMX
  48. AntiDeAMX()
  49. {
  50. new a[][] =
  51. {
  52. "Unarmed (Fist)",
  53. "Brass K"
  54. };
  55. #pragma unused a
  56. }
  57.  
  58. WasteDeAMXersTime()
  59. {
  60. new b;
  61. #emit load.pri b
  62. #emit stor.pri b
  63. }
  64.  
  65.  
  66.  
  67.  
  68. //==========================Colori Definiti
  69. #define COLOR_GREY 0xAFAFAFAA
  70. #define COLOR_ACTIVEBORDER 0xB4B4B4FF
  71. #define COLOR_ACTIVECAPTION 0x99B4D1FF
  72. #define COLOR_ACTIVECAPTIONTEXT 0x000000FF
  73. #define COLOR_ALICEBLUE 0xF0F8FFFF
  74. #define COLOR_ANTIQUEWHITE 0xFAEBD7FF
  75. #define COLOR_APPWORKSPACE 0xABABABFF
  76. #define COLOR_AQUA 0x00FFFFFF
  77. #define COLOR_AQUAMARINE 0x7FFFD4FF
  78. #define COLOR_AZURE 0xF0FFFFFF
  79. #define COLOR_BEIGE 0xF5F5DCFF
  80. #define COLOR_BISQUE 0xFFE4C4FF
  81. #define COLOR_BLACK 0x000000FF
  82. #define COLOR_BLANCHEDALMOND 0xFFEBCDFF
  83. #define COLOR_BLUE 0x0000FFFF
  84. #define COLOR_BLUEVIOLET 0x8A2BE2FF
  85. #define COLOR_BROWN 0xA52A2AFF
  86. #define COLOR_BURLYWOOD 0xDEB887FF
  87. #define COLOR_BUTTONFACE 0xF0F0F0FF
  88. #define COLOR_BUTTONHIGHLIGHT 0xFFFFFFFF
  89. #define COLOR_BUTTONSHADOW 0xA0A0A0FF
  90. #define COLOR_CADETBLUE 0x5F9EA0FF
  91. #define COLOR_CHARTREUSE 0x7FFF00FF
  92. #define COLOR_CHOCOLATE 0xD2691EFF
  93. #define COLOR_CONTROL 0xF0F0F0FF
  94. #define COLOR_CONTROLDARK 0xA0A0A0FF
  95. #define COLOR_CONTROLDARKDARK 0x696969FF
  96. #define COLOR_CONTROLLIGHT 0xE3E3E3FF
  97. #define COLOR_CONTROLLIGHTLIGHT 0xFFFFFFFF
  98. #define COLOR_CONTROLTEXT 0x000000FF
  99. #define COLOR_CORAL 0xFF7F50FF
  100. #define COLOR_CORNFLOWERBLUE 0x6495EDFF
  101. #define COLOR_CORNSILK 0xFFF8DCFF
  102. #define COLOR_CRIMSON 0xDC143CFF
  103. #define COLOR_CYAN 0x00FFFFFF
  104. #define COLOR_DARKBLUE 0x00008BFF
  105. #define COLOR_DARKCYAN 0x008B8BFF
  106. #define COLOR_DARKGOLDENROD 0xB8860BFF
  107. #define COLOR_DARKGRAY 0xA9A9A9FF
  108. #define COLOR_DARKGREEN 0x006400FF
  109. #define COLOR_DARKKHAKI 0xBDB76BFF
  110. #define COLOR_DARKMAGENTA 0x8B008BFF
  111. #define COLOR_DARKOLIVEGREEN 0x556B2FFF
  112. #define COLOR_DARKORANGE 0xFF8C00FF
  113. #define COLOR_DARKORCHID 0x9932CCFF
  114. #define COLOR_DARKRED 0x8B0000FF
  115. #define COLOR_DARKSALMON 0xE9967AFF
  116. #define COLOR_DARKSEAGREEN 0x8FBC8BFF
  117. #define COLOR_DARKSLATEBLUE 0x483D8BFF
  118. #define COLOR_DARKSLATEGRAY 0x2F4F4FFF
  119. #define COLOR_DARKTURQUOISE 0x00CED1FF
  120. #define COLOR_DARKVIOLET 0x9400D3FF
  121. #define COLOR_DEEPPINK 0xFF1493FF
  122. #define COLOR_DEEPSKYBLUE 0x00BFFFFF
  123. #define COLOR_DESKTOP 0x000000FF
  124. #define COLOR_DIMGRAY 0x696969FF
  125. #define COLOR_DODGERBLUE 0x1E90FFFF
  126. #define COLOR_FIREBRICK 0xB22222FF
  127. #define COLOR_FLORALWHITE 0xFFFAF0FF
  128. #define COLOR_FORESTGREEN 0x228B22FF
  129. #define COLOR_FUCHSIA 0xFF00FFFF
  130. #define COLOR_GAINSBORO 0xDCDCDCFF
  131. #define COLOR_GHOSTWHITE 0xF8F8FFFF
  132. #define COLOR_GOLD 0xFFD700FF
  133. #define COLOR_GOLDENROD 0xDAA520FF
  134. #define COLOR_GRADIENTACTIVECAPTION 0xB9D1EAFF
  135. #define COLOR_GRADIENTINACTIVECAPTION 0xD7E4F2FF
  136. #define COLOR_GRAY 0x808080FF
  137. #define COLOR_GRAYTEXT 0x808080FF
  138. #define COLOR_GREEN 0x008000FF
  139. #define COLOR_GREENYELLOW 0xADFF2FFF
  140. #define COLOR_HIGHLIGHT 0x3399FFFF
  141. #define COLOR_HIGHLIGHTTEXT 0xFFFFFFFF
  142. #define COLOR_HONEYDEW 0xF0FFF0FF
  143. #define COLOR_HOTPINK 0xFF69B4FF
  144. #define COLOR_HOTTRACK 0x0066CCFF
  145. #define COLOR_INACTIVEBORDER 0xF4F7FCFF
  146. #define COLOR_INACTIVECAPTION 0xBFCDDBFF
  147. #define COLOR_INACTIVECAPTIONTEXT 0x434E54FF
  148. #define COLOR_INDIANRED 0xCD5C5CFF
  149. #define COLOR_INDIGO 0x4B0082FF
  150. #define COLOR_INFO 0xFFFFE1FF
  151. #define COLOR_INFOTEXT 0x000000FF
  152. #define COLOR_IVORY 0xFFFFF0FF
  153. #define COLOR_KHAKI 0xF0E68CFF
  154. #define COLOR_LAVENDER 0xE6E6FAFF
  155. #define COLOR_LAVENDERBLUSH 0xFFF0F5FF
  156. #define COLOR_LAWNGREEN 0x7CFC00FF
  157. #define COLOR_LEMONCHIFFON 0xFFFACDFF
  158. #define COLOR_LIGHTBLUE 0xADD8E6FF
  159. #define COLOR_LIGHTCORAL 0xF08080FF
  160. #define COLOR_LIGHTCYAN 0xE0FFFFFF
  161. #define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
  162. #define COLOR_LIGHTGRAY 0xD3D3D3FF
  163. #define COLOR_LIGHTGREEN 0x90EE90FF
  164. #define COLOR_LIGHTPINK 0xFFB6C1FF
  165. #define COLOR_LIGHTSALMON 0xFFA07AFF
  166. #define COLOR_LIGHTSEAGREEN 0x20B2AAFF
  167. #define COLOR_LIGHTSKYBLUE 0x87CEFAFF
  168. #define COLOR_LIGHTSLATEGRAY 0x778899FF
  169. #define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
  170. #define COLOR_LIGHTYELLOW 0xFFFFE0FF
  171. #define COLOR_LIME 0x00FF00FF
  172. #define COLOR_LIMEGREEN 0x32CD32FF
  173. #define COLOR_LINEN 0xFAF0E6FF
  174. #define COLOR_MAGENTA 0xFF00FFFF
  175. #define COLOR_MAROON 0x800000FF
  176. #define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
  177. #define COLOR_MEDIUMBLUE 0x0000CDFF
  178. #define COLOR_MEDIUMORCHID 0xBA55D3FF
  179. #define COLOR_MEDIUMPURPLE 0x9370DBFF
  180. #define COLOR_MEDIUMSEAGREEN 0x3CB371FF
  181. #define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
  182. #define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
  183. #define COLOR_MEDIUMTURQUOISE 0x48D1CCFF
  184. #define COLOR_MEDIUMVIOLETRED 0xC71585FF
  185. #define COLOR_MENU 0xF0F0F0FF
  186. #define COLOR_MENUBAR 0xF0F0F0FF
  187. #define COLOR_MENUHIGHLIGHT 0x3399FFFF
  188. #define COLOR_MENUTEXT 0x000000FF
  189. #define COLOR_MIDNIGHTBLUE 0x191970FF
  190. #define COLOR_MINTCREAM 0xF5FFFAFF
  191. #define COLOR_MISTYROSE 0xFFE4E1FF
  192. #define COLOR_MOCCASIN 0xFFE4B5FF
  193. #define COLOR_NAVAJOWHITE 0xFFDEADFF
  194. #define COLOR_NAVY 0x000080FF
  195. #define COLOR_OLDLACE 0xFDF5E6FF
  196. #define COLOR_OLIVE 0x808000FF
  197. #define COLOR_OLIVEDRAB 0x6B8E23FF
  198. #define COLOR_ORANGE 0xFFA500FF
  199. #define COLOR_ORANGERED 0xFF4500FF
  200. #define COLOR_ORCHID 0xDA70D6FF
  201. #define COLOR_PALEGOLDENROD 0xEEE8AAFF
  202. #define COLOR_PALEGREEN 0x98FB98FF
  203. #define COLOR_PALETURQUOISE 0xAFEEEEFF
  204. #define COLOR_PALEVIOLETRED 0xDB7093FF
  205. #define COLOR_PAPAYAWHIP 0xFFEFD5FF
  206. #define COLOR_PEACHPUFF 0xFFDAB9FF
  207. #define COLOR_PERU 0xCD853FFF
  208. #define COLOR_PINK 0xFFC0CBFF
  209. #define COLOR_PLUM 0xDDA0DDFF
  210. #define COLOR_POWDERBLUE 0xB0E0E6FF
  211. #define COLOR_PURPLE 0x800080FF
  212. #define COLOR_RED 0xFF0000FF
  213. #define COLOR_ROSYBROWN 0xBC8F8FFF
  214. #define COLOR_ROYALBLUE 0x4169E1FF
  215. #define COLOR_SADDLEBROWN 0x8B4513FF
  216. #define COLOR_SALMON 0xFA8072FF
  217. #define COLOR_SANDYBROWN 0xF4A460FF
  218. #define COLOR_SCROLLBAR 0xC8C8C8FF
  219. #define COLOR_SEAGREEN 0x2E8B57FF
  220. #define COLOR_SEASHELL 0xFFF5EEFF
  221. #define COLOR_SIENNA 0xA0522DFF
  222. #define COLOR_SILVER 0xC0C0C0FF
  223. #define COLOR_SKYBLUE 0x87CEEBFF
  224. #define COLOR_SLATEBLUE 0x6A5ACDFF
  225. #define COLOR_SLATEGRAY 0x708090FF
  226. #define COLOR_SNOW 0xFFFAFAFF
  227. #define COLOR_SPRINGGREEN 0x00FF7FFF
  228. #define COLOR_STEELBLUE 0x4682B4FF
  229. #define COLOR_TAN 0xD2B48CFF
  230. #define COLOR_TEAL 0x008080FF
  231. #define COLOR_THISTLE 0xD8BFD8FF
  232. #define COLOR_TOMATO 0xFF6347FF
  233. #define COLOR_TRANSPARENT 0xFFFFFF00
  234. #define COLOR_TURQUOISE 0x40E0D0FF
  235. #define COLOR_VIOLET 0xEE82EEFF
  236. #define COLOR_WHEAT 0xF5DEB3FF
  237. #define COLOR_WHITE 0xFFFFFFFF
  238. #define COLOR_WHITESMOKE 0xF5F5F5FF
  239. #define COLOR_WINDOW 0xFFFFFFFF
  240. #define COLOR_WINDOWFRAME 0x646464FF
  241. #define COLOR_WINDOWTEXT 0x000000FF
  242. #define COLOR_YELLOW 0xFFFF00FF
  243. #define COLOR_YELLOWGREEN 0x9ACD32FF
  244. #define STEALTH_ORANGE 0xFF880000
  245. #define STEALTH_OLIVE 0x66660000
  246. #define STEALTH_GREEN 0x33DD1100
  247. #define STEALTH_PINK 0xFF22EE00
  248. #define STEALTH_BLUE 0x0077BB00
  249. #define FILTERSCRIPT
  250. #if defined FILTERSCRIPT
  251. #define PlayerFile "revo/utenti/%s.ini"
  252. #define CommandFile "revo/impostazioni/comandi.ini"
  253. #define antispam_behavior_doublecheck true
  254. #define antispam_behavior_ignorecaps true
  255. #define antispam_throttle_msec 1500
  256.  
  257. #define IP_LIMIT 2
  258. #define SAME_IP_CONNECT 4
  259. new Same_IP=0,Join_Stamp,ban_s[25],exceed=0;
  260. #define Time_Limit 3500
  261.  
  262. #undef MAX_PLAYERS
  263. #define MAX_PLAYERS 100
  264.  
  265. //===========================================Variabili
  266. new String[128], Float:SpecX[MAX_PLAYERS], Float:SpecY[MAX_PLAYERS], Float:SpecZ[MAX_PLAYERS], vWorld[MAX_PLAYERS], Inter[MAX_PLAYERS];
  267. new IsSpecing[MAX_PLAYERS], Name[MAX_PLAYER_NAME], IsBeingSpeced[MAX_PLAYERS],spectatorid[MAX_PLAYERS];
  268. new Warns[MAX_PLAYERS];
  269. new Mutato[MAX_PLAYERS];
  270. new Flood[MAX_PLAYERS];
  271. new Cartella[128] = "/seriali/%s.ban";
  272. new Jailato[MAX_PLAYERS];
  273. new file[100];
  274.  
  275.  
  276. // All Enums
  277.  
  278. enum PLAYER_MAIN {
  279. PLAYER_NAME[MAX_PLAYER_NAME],
  280. PLAYER_IP[16],
  281. PLAYER_REGGED,
  282. PLAYER_PASS,
  283. PLAYER_LEVEL,
  284. PLAYER_MONEY,
  285. PLAYER_MEMBRO,
  286. }
  287. new gPlayerInfo[MAX_PLAYERS][PLAYER_MAIN];
  288. new gPlayerLogged[MAX_PLAYERS];
  289.  
  290. enum COMMANDS_MAIN {
  291. KICK,
  292. BAN
  293. }
  294. new gCommands[COMMANDS_MAIN];
  295.  
  296.  
  297.  
  298.  
  299.  
  300. forward FloodOff(playerid);
  301. public FloodOff(playerid)
  302. {
  303. Flood[playerid]=0;
  304. return 1;
  305. }
  306.  
  307. public OnFilterScriptInit()
  308. {
  309. print("\n--------------------------------------");
  310. print(" _________________________________");
  311. print(" ReVo REVOLUTION ADMIN SYSTEM");
  312. print(" _________________________________");
  313. print(" Secourity for your server!");
  314. print("--------------------------------------\n");
  315.  
  316.  
  317. if(!fexist(CommandFile))
  318. {
  319. dini_Create(CommandFile);
  320. dini_IntSet(CommandFile, "Kick", 2);
  321. dini_IntSet(CommandFile, "Ban", 3);
  322. }
  323.  
  324. gCommands[KICK] = dini_Int(CommandFile, "Kick");
  325. gCommands[BAN] = dini_Int(CommandFile, "Ban");
  326.  
  327. //AntiDeAmx
  328. AntiDeAMX();
  329. WasteDeAMXersTime();
  330. return 1;
  331. }
  332.  
  333. public OnFilterScriptExit()
  334. {
  335. return 1;
  336. }
  337.  
  338.  
  339. #endif
  340.  
  341. public OnPlayerConnect(playerid)
  342. {
  343.  
  344. new name[MAX_PLAYER_NAME];
  345. GetPlayerName(playerid, name, sizeof(name));
  346. format(file, sizeof(file), PlayerFile, name);
  347. if(!fexist(file))
  348. {
  349. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registrazione", "Inserisci la password per poter entrare e giocare nel server.", "Invio", "Esci");
  350. }
  351. else if(fexist(file))
  352. {
  353. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Inserisci la password che hai inserito alla registrazione.", "Login", "Esci");
  354. }
  355.  
  356. Warns[playerid] = 0;
  357.  
  358.  
  359. new ConnIP[16];
  360. GetPlayerIp(playerid,ConnIP,16);
  361. new compare_IP[16];
  362. new number_IP = 0;
  363. for(new i=0; i<MAX_PLAYERS; i++) {
  364. if(IsPlayerConnected(i)) {
  365. GetPlayerIp(i,compare_IP,16);
  366. if(!strcmp(compare_IP,ConnIP)) number_IP++;
  367. }
  368. }
  369. if((GetTickCount() - Join_Stamp) < Time_Limit)
  370. exceed=1;
  371. else
  372. exceed=0;
  373. if(strcmp(ban_s, ConnIP, false) == 0 && exceed == 1 )
  374. {
  375. Same_IP++;
  376. if(Same_IP > SAME_IP_CONNECT)
  377. {
  378. Ban(playerid);
  379. Same_IP=0;
  380. }
  381. }
  382. else
  383. {
  384. Same_IP=0;
  385. }
  386. if(number_IP > IP_LIMIT)
  387. Kick(playerid);
  388. GetStampIP(playerid);
  389.  
  390.  
  391.  
  392. Mutato[playerid] = 1;
  393. Jailato[playerid]=1;
  394.  
  395. CheckSeriale(playerid);
  396. return 1;
  397. }
  398.  
  399. public OnPlayerDisconnect(playerid, reason)
  400. {
  401. format(file, sizeof(file), PlayerFile, gPlayerInfo[playerid][PLAYER_NAME]);
  402. dini_Set(file, "Name", gPlayerInfo[playerid][PLAYER_NAME]);
  403. dini_Set(file, "Ip", gPlayerInfo[playerid][PLAYER_IP]);
  404. dini_IntSet(file, "Registered", gPlayerInfo[playerid][PLAYER_REGGED]);
  405. dini_IntSet(file, "Password", gPlayerInfo[playerid][PLAYER_PASS]);
  406. dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
  407. dini_IntSet(file, "Money", GetPlayerMoney(playerid));
  408. dini_IntSet(file, "Membro", gPlayerInfo[playerid][PLAYER_MEMBRO]);
  409. gPlayerLogged[playerid] = 0;
  410. return 1;
  411. }
  412.  
  413. public OnPlayerSpawn(playerid)
  414. {
  415. if(gPlayerLogged[playerid] == 0)
  416. {
  417. new stringa[260], nome[26];
  418. GetPlayerName(playerid, nome, sizeof(nome));
  419. format(stringa, 260, "** {FF0000}%s è stato autokickato per aver by-passato il login.", nome);
  420. SendClientMessageToAll(-1, stringa);
  421. Kick(playerid);
  422. }
  423. Mutato[playerid] = 0;
  424. Jailato[playerid]=0;
  425. return 1;
  426. }
  427.  
  428. public OnPlayerDeath(playerid, killerid, reason)
  429. {
  430. return 1;
  431. }
  432.  
  433. public OnVehicleSpawn(vehicleid)
  434. {
  435. return 1;
  436. }
  437.  
  438. public OnVehicleDeath(vehicleid, killerid)
  439. {
  440. return 1;
  441. }
  442.  
  443. public OnPlayerText(playerid, text[])
  444. {
  445. if(Mutato[playerid] == 1)
  446. {
  447. SendClientMessage(playerid, COLOR_RED, "Sei mutato, perciò non puoi parlare!");
  448. return 0;
  449. }
  450.  
  451. if(text[0] == '#' && gPlayerInfo[playerid][PLAYER_LEVEL] >=1)
  452. {
  453. new string[128]; GetPlayerName(playerid,string,sizeof(string));
  454. format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
  455. SendMessageToAdmins(COLOR_RED, string);
  456. return 0;
  457. }
  458.  
  459. if(Flood[playerid] >= 1)
  460. {
  461. SendClientMessage(playerid, COLOR_RED, "Non puoi flooddare, aspetta due secondo prima di scrivere!");
  462. return 0;
  463. }
  464. Flood[playerid]++;
  465. SetTimerEx("FloodOff", 2000, false, "i", playerid);
  466.  
  467. print(text);
  468.  
  469. return 1;
  470. }
  471.  
  472.  
  473.  
  474. public OnPlayerCommandText(playerid, cmdtext[])
  475. {
  476.  
  477.  
  478. new stringa[260];
  479. new nome[26];
  480. GetPlayerName(playerid, nome, sizeof(nome));
  481. format(stringa, 260, "** %s(%d) digita %s", nome, playerid, cmdtext);
  482. SendMessageToAdmins(COLOR_GREY, stringa);
  483. print(stringa);
  484.  
  485. if(Jailato[playerid] == 1)
  486. {
  487. SendClientMessage(playerid, COLOR_RED, "Sei in prigione, perciò non puoi fare comandi!");
  488. return 0;
  489. }
  490.  
  491.  
  492.  
  493. //cmds
  494. dcmd(acmd,4,cmdtext);
  495.  
  496.  
  497.  
  498.  
  499. // comando setta livello
  500. dcmd(setlivello,10,cmdtext);
  501.  
  502. //CMDS Livello 1
  503. dcmd(ip,2,cmdtext);
  504. dcmd(spec,4,cmdtext);
  505. dcmd(specoff,7,cmdtext);
  506. dcmd(asay,4,cmdtext);
  507. dcmd(levaveicolo,11,cmdtext);
  508. dcmd(goto,4,cmdtext);
  509. dcmd(info, 4, cmdtext);
  510.  
  511. //CMDS Livello 2
  512. dcmd(warna,5,cmdtext);
  513. dcmd(armat,5,cmdtext);
  514. dcmd(tempo,5,cmdtext);
  515. dcmd(ora,3,cmdtext);
  516. dcmd(muta,4,cmdtext);
  517. dcmd(smuta,5,cmdtext);
  518. dcmd(cc,2,cmdtext);
  519. dcmd(ferma,5,cmdtext);
  520. dcmd(sferma,6,cmdtext);
  521. dcmd(ann,3,cmdtext);
  522.  
  523. //Utenti
  524. dcmd(pm,2,cmdtext);
  525. dcmd(report,6,cmdtext);
  526.  
  527.  
  528.  
  529. //CMDS Livello 3
  530. dcmd(kick,4,cmdtext);
  531. dcmd(slappa,6,cmdtext);
  532. dcmd(jaila,5,cmdtext);
  533. dcmd(vitat,5,cmdtext);
  534. dcmd(armaturat,9,cmdtext);
  535. dcmd(killa,5,cmdtext);
  536. dcmd(unjaila,7,cmdtext);
  537. dcmd(get,3,cmdtext);
  538. dcmd(setnome,7,cmdtext);
  539.  
  540. //CMDS Livello 4
  541. dcmd(ban,3,cmdtext);
  542. dcmd(god,3,cmdtext);
  543. dcmd(sgod,4,cmdtext);
  544. dcmd(seban,5,cmdtext);
  545. dcmd(disarmat,8,cmdtext);
  546. dcmd(disarma,7,cmdtext);
  547. dcmd(asoldi,6,cmdtext);
  548. dcmd(dais,4,cmdtext);
  549.  
  550. //CMD Livello 5
  551. dcmd(console,7,cmdtext);
  552. dcmd(rban,4,cmdtext);
  553. dcmd(setmembro,9,cmdtext);
  554. return 0;
  555. }
  556.  
  557. //=================================================================================
  558. //-------------------------------------------------------------------------------
  559. // LIVELLO 1
  560. //--------------------------------------------------------------------------------
  561. //==================================================================================
  562.  
  563. dcmd_setlivello(playerid, params[])
  564. {
  565. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Devi essere RCON o lvl 5 per usare questo cmd!");
  566.  
  567. new id, livello;
  568.  
  569. if(sscanf(params,"ui",id,livello)) return SendClientMessage(playerid, COLOR_RED, "USA: /setlivello <id> <livello>");
  570.  
  571. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il player non è connesso!");
  572.  
  573. if(livello > 5) return SendClientMessage(playerid, COLOR_RED, "** I livelli sono da 0 a 5");
  574.  
  575. gPlayerInfo[id][PLAYER_LEVEL] = livello;
  576.  
  577. dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
  578.  
  579. new stringa[259];
  580. new nome1[260];
  581. new nome2[260];
  582. GetPlayerName(playerid, nome1, sizeof(nome1));
  583. GetPlayerName(id, nome2, sizeof(nome2));
  584. format(stringa,600,"** {00FF15}L'admin %s ha settato %s {FFFFFF}livello: %d!",nome1, nome2, livello);
  585. SendClientMessageToAll(-1, stringa);
  586.  
  587. return 1;
  588. }
  589.  
  590. dcmd_ip(playerid, params[])
  591. {
  592. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  593.  
  594. new id;
  595.  
  596. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /ip <id>");
  597.  
  598. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player NON connesso!");
  599.  
  600. new stringa[290];
  601. new ip[200];
  602. new nome2[270];
  603. GetPlayerIp(id, ip, sizeof(ip));
  604. GetPlayerName(id, nome2, sizeof(nome2));
  605. format(stringa,600,"** {00FF15} L'ip di %s è %s",nome2, ip);
  606. SendClientMessage(playerid, -1, stringa);
  607. return 1;
  608. }
  609.  
  610. dcmd_info(playerid, params[])
  611. {
  612. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  613.  
  614. new id;
  615. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /info <id>");
  616.  
  617. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Playerid non connesso! Ritenta.");
  618.  
  619. new stringa[260];
  620. new ip[200];
  621. GetPlayerIp(id, ip, sizeof(ip));
  622. format(stringa, 260, "Ip: %s, Soldi: %d, Livello Admin: %d", ip, GetPlayerMoney(id), gPlayerInfo[id][PLAYER_LEVEL]);
  623. SendClientMessage(playerid, COLOR_GREEN, stringa);
  624. return 1;
  625. }
  626.  
  627.  
  628. dcmd_spec(playerid, params[])
  629. {
  630. new id;
  631. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  632. if(sscanf(params,"u", id))return SendClientMessage(playerid, COLOR_ORANGE, "USA: /spec [id]");
  633. if(id == playerid) return SendClientMessage(playerid,COLOR_RED,"Non puoi speccarti da solo.");
  634. if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, COLOR_RED, "Player non trovato!");
  635. if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,COLOR_RED,"Stai già speccando qualcuno. Digita /specoff.");// This will make you not automatically spec someone else by mistake.
  636. GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
  637. Inter[playerid] = GetPlayerInterior(playerid);
  638. vWorld[playerid] = GetPlayerVirtualWorld(playerid);
  639. TogglePlayerSpectating(playerid, true);
  640. if(IsPlayerInAnyVehicle(id))
  641. {
  642. if(GetPlayerInterior(id) > 0)
  643. {
  644. SetPlayerInterior(playerid,GetPlayerInterior(id));
  645. }
  646. if(GetPlayerVirtualWorld(id) > 0)
  647. {
  648. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  649. }
  650. PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
  651. }
  652. else
  653. {
  654. if(GetPlayerInterior(id) > 0)
  655. {
  656. SetPlayerInterior(playerid,GetPlayerInterior(id));
  657. }
  658. if(GetPlayerVirtualWorld(id) > 0)
  659. {
  660. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  661. }
  662. PlayerSpectatePlayer(playerid,id);
  663. }
  664. GetPlayerName(id, Name, sizeof(Name));
  665. format(String, sizeof(String),"Stai speccando %s!",Name);
  666. SendClientMessage(playerid,0x0080C0FF,String);
  667. IsSpecing[playerid] = 1;
  668. IsBeingSpeced[id] = 1;
  669. spectatorid[playerid] = id;
  670. return 1;
  671. }
  672.  
  673. dcmd_specoff(playerid, params[])
  674. {
  675. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  676. if(IsSpecing[playerid] == 0)return SendClientMessage(playerid,COLOR_RED,"Non stai speccando nessuno!");
  677. IsSpecing[playerid]=0;
  678. TogglePlayerSpectating(playerid, 0);
  679. return 1;
  680. }
  681.  
  682. dcmd_asay(playerid, params[])
  683. {
  684. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  685. new stringa[260];
  686. new nome1[200];
  687. GetPlayerName(playerid, nome1, sizeof(nome1));
  688. format(stringa,600,"** {00FF15} L'admin %s dice:{FFFFFF} %s",nome1,params);
  689. SendClientMessageToAll(-1, stringa);
  690. return 1;
  691. }
  692.  
  693. dcmd_levaveicolo(playerid, params[])
  694. {
  695. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  696. new vehicleid = GetPlayerVehicleID(playerid);
  697. DestroyVehicle(vehicleid);
  698. return 1;
  699. }
  700.  
  701. dcmd_goto(playerid, params[])
  702. {
  703. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 1) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 1 per usare questo cmd!");
  704.  
  705. new id;
  706. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /goto [id]");
  707.  
  708. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il player id non è connesso!");
  709.  
  710. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Non puoi teletrasportarti da te stesso!");
  711.  
  712. new Float:x, Float:y, Float:z;
  713. GetPlayerPos(id, x, y, z);
  714. SetPlayerPos(playerid, x+1, y+1, z);
  715.  
  716. new stringa[260];
  717. new nome1[200];
  718. GetPlayerName(id, nome1, sizeof(nome1));
  719. format(stringa,600,"** {00FF15} Ti sei gotato da {FFFFFF} %s",nome1);
  720. SendClientMessage(playerid, -1, stringa);
  721. return 1;
  722. }
  723.  
  724.  
  725.  
  726. //=================================================================================
  727. //-------------------------------------------------------------------------------
  728. // LIVELLO 2
  729. //--------------------------------------------------------------------------------
  730. //==================================================================================
  731.  
  732. dcmd_warna(playerid, params[])
  733. {
  734. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  735.  
  736. new id, motivo[200];
  737. if(sscanf(params,"is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /warna <id> <motivo>");
  738.  
  739. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player NON connesso!");
  740.  
  741. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED," Questo admin ha il livello più alto del tuo!");
  742.  
  743. Warns[id]++;
  744.  
  745. new stringa[260];
  746. new nome1[200];
  747. new nome2[220];
  748. GetPlayerName(playerid, nome1, sizeof(nome1));
  749. GetPlayerName(id, nome2, sizeof(nome2));
  750. format(stringa,600,"** {F6FF00} L'admin %s ha warnato %s! {FFFFFF}Motivo: %s. (Avv: %d/3)",nome1,nome2, motivo, Warns[id]);
  751. SendClientMessageToAll(-1, stringa);
  752.  
  753. if(Warns[id] == 3)
  754. {
  755. format(stringa,600,"** {FF0000}%s è stato kickato. {FFFFFF}Motivo: 3 Avvertimenti superati!",nome2, motivo);
  756. SendClientMessageToAll(-1, stringa);
  757. Kick(id);
  758. }
  759. return 1;
  760. }
  761.  
  762. dcmd_armat(playerid, params[])
  763. {
  764. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  765.  
  766. new armaid;
  767. if(sscanf(params,"d", armaid)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /armat <arma>");
  768.  
  769. if(armaid > 46) return SendClientMessage(playerid, COLOR_RED, "Le armi sono da 0 a 46!");
  770.  
  771. for(new i = 0; i < MAX_PLAYERS; i++)
  772. {
  773. GivePlayerWeapon(i, armaid, 9999);
  774. PlayerPlaySound(playerid, 1058, 0, 0, 0);
  775. }
  776.  
  777. new stringa[200];
  778. new nome1[200];
  779. GetPlayerName(playerid, nome1, sizeof(nome1));
  780. format(stringa,600,"** {0800FF}L'admin %s ha dato a tutti l'arma id {FFFFFF}%d!",nome1, armaid);
  781. SendClientMessageToAll(-1, stringa);
  782. return 1;
  783. }
  784.  
  785. dcmd_tempo(playerid, params[])
  786. {
  787. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  788.  
  789. new idtempo;
  790. if(sscanf(params,"d", idtempo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /tempo <id tempo>");
  791.  
  792. for(new i = 0; i < MAX_PLAYERS; i++)
  793. {
  794. SetPlayerWeather(i, idtempo);
  795. PlayerPlaySound(playerid, 1058, 0, 0, 0);
  796. }
  797.  
  798. new stringa[200];
  799. new nome1[200];
  800. GetPlayerName(playerid, nome1, sizeof(nome1));
  801. format(stringa,600,"** {0800FF}L'admin %s ha impostato il tempo del server a {FFFFFF}%d!",nome1, idtempo);
  802. SendClientMessageToAll(-1, stringa);
  803. return 1;
  804. }
  805.  
  806. dcmd_ora(playerid, params[])
  807. {
  808. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  809.  
  810. new idora;
  811. if(sscanf(params,"d", idora)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /ora <id ora>");
  812.  
  813. for(new i = 0; i < MAX_PLAYERS; i++)
  814. {
  815. SetPlayerTime(i, idora, 0);
  816. PlayerPlaySound(playerid, 1058, 0, 0, 0);
  817. }
  818.  
  819. new stringa[200];
  820. new nome1[200];
  821. GetPlayerName(playerid, nome1, sizeof(nome1));
  822. format(stringa,600,"** {0800FF}L'admin %s ha impostato l'ora del server a {FFFFFF}%d!",nome1, idora);
  823. SendClientMessageToAll(-1, stringa);
  824. return 1;
  825. }
  826.  
  827. dcmd_muta(playerid, params[])
  828. {
  829. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  830.  
  831. new id, motivo[200];
  832. if(sscanf(params,"is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /muta <id> <motivo>");
  833.  
  834. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Questo player non è connesso!");
  835.  
  836. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED," Questo admin ha il livello più alto del tuo!");
  837.  
  838. Mutato[id]=1;
  839.  
  840. new stringa[200];
  841. new nome1[200];
  842. new nome2[200];
  843. GetPlayerName(playerid, nome1, sizeof(nome1));
  844. GetPlayerName(id, nome2, sizeof(nome2));
  845. format(stringa,600,"L'admin %s ha mutato %s! Motivo: %s",nome1, nome2,motivo);
  846. SendClientMessageToAll(COLOR_RED, stringa);
  847. return 1;
  848. }
  849.  
  850. dcmd_smuta(playerid, params[])
  851. {
  852. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  853.  
  854. new id;
  855. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /smuta <id>");
  856.  
  857. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player non connesso!");
  858.  
  859. if(Mutato[id] == 0) return SendClientMessage(playerid, COLOR_RED, "Il player id non è mutato!");
  860.  
  861. Mutato[id] = 0;
  862.  
  863. new stringa[200];
  864. new nome1[200];
  865. new nome2[200];
  866. GetPlayerName(playerid, nome1, sizeof(nome1));
  867. GetPlayerName(id, nome2, sizeof(nome2));
  868. format(stringa,600,"L'admin %s ha smutato %s!",nome1, nome2);
  869. SendClientMessageToAll(COLOR_GREEN, stringa);
  870. return 1;
  871. }
  872.  
  873. dcmd_cc(playerid, params[])
  874. {
  875. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  876.  
  877. SendClientMessageToAll(-1, " ");
  878. SendClientMessageToAll(-1, " ");
  879. SendClientMessageToAll(-1, " ");
  880. SendClientMessageToAll(-1, " ");
  881. SendClientMessageToAll(-1, " ");
  882. SendClientMessageToAll(-1, " ");
  883. SendClientMessageToAll(-1 ," ");
  884. SendClientMessageToAll(-1, " ");
  885. SendClientMessageToAll(-1 ," ");
  886. SendClientMessageToAll(-1, " ");
  887. SendClientMessageToAll(-1, " ");
  888. SendClientMessageToAll(-1, " ");
  889. SendClientMessageToAll(-1, " ");
  890. SendClientMessageToAll(-1, " ");
  891. SendClientMessageToAll(-1 ," ");
  892. SendClientMessageToAll(-1, " ");
  893. SendClientMessageToAll(-1, " ");
  894. SendClientMessageToAll(-1, " ");
  895. SendClientMessageToAll(-1, " ");
  896. SendClientMessageToAll(-1, " ");
  897. SendClientMessageToAll(-1, " ");
  898. SendClientMessageToAll(-1 ," ");
  899. SendClientMessageToAll(-1 ," ");
  900. SendClientMessageToAll(-1, " ");
  901. SendClientMessageToAll(-1, " ");
  902. SendClientMessageToAll(-1, " ");
  903. SendClientMessageToAll(-1, " ");
  904. SendClientMessageToAll(-1 ," ");
  905. SendClientMessageToAll(-1, " ");
  906. SendClientMessageToAll(-1 ," ");
  907. SendClientMessageToAll(-1 ," ");
  908. SendClientMessageToAll(-1 ," ");
  909.  
  910. new stringa[200];
  911. new nome1[260];
  912. GetPlayerName(playerid, nome1, sizeof(nome1));
  913. format(stringa,600,"L'admin %s ha ripulito la chat!",nome1);
  914. SendClientMessageToAll(COLOR_GREEN, stringa);
  915. return 1;
  916. }
  917.  
  918. dcmd_ferma(playerid, params[])
  919. {
  920. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  921.  
  922. new id;
  923. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /ferma <id>");
  924.  
  925. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player non connesso!");
  926.  
  927. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  928.  
  929. new stringa[200];
  930. new nome1[200];
  931. new nome2[200];
  932. GetPlayerName(playerid, nome1, sizeof(nome1));
  933. GetPlayerName(id, nome2, sizeof(nome2));
  934. format(stringa,600,"L'admin %s ha freezzato %s!",nome1, nome2);
  935. SendClientMessageToAll(COLOR_GREEN, stringa);
  936.  
  937. TogglePlayerControllable(id, 0);
  938. return 1;
  939. }
  940.  
  941. dcmd_sferma(playerid, params[])
  942. {
  943. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  944.  
  945. new id;
  946. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /sferma <id>");
  947.  
  948. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player non connesso!");
  949.  
  950. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  951.  
  952. new stringa[200];
  953. new nome1[200];
  954. new nome2[200];
  955. GetPlayerName(playerid, nome1, sizeof(nome1));
  956. GetPlayerName(id, nome2, sizeof(nome2));
  957. format(stringa,600,"L'admin %s ha sfreezzato %s!",nome1, nome2);
  958. SendClientMessageToAll(COLOR_GREEN, stringa);
  959.  
  960. TogglePlayerControllable(id, 1);
  961. return 1;
  962. }
  963.  
  964. dcmd_ann(playerid, params[])
  965. {
  966. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 2) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 2 per usare questo cmd!");
  967.  
  968. new stringa[260];
  969. format(stringa,600,"%s",params);
  970. GameTextForAll(params, 6000, 4);
  971. return 1;
  972. }
  973.  
  974. dcmd_pm(playerid, params[])
  975. {
  976.  
  977. new id, messaggio[260];
  978. if(sscanf(params,"is", id, messaggio)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /pm <id> <messaggio>");
  979.  
  980. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player non connesso!");
  981.  
  982. new stringa[260];
  983. new nome1[269];
  984. new nome2[256];
  985. GetPlayerName(playerid, nome1, sizeof(nome1));
  986. GetPlayerName(id, nome2, sizeof(nome2));
  987. format(stringa,600,"[PM] Da %s: %s",nome1, messaggio);
  988. SendClientMessage(id, COLOR_YELLOW, stringa);
  989. format(stringa,600,"[PM] Inviato a %s: %s",nome2, messaggio);
  990. SendClientMessage(playerid, COLOR_YELLOW, stringa);
  991. return 1;
  992. }
  993.  
  994. //=================================================================================
  995. //-------------------------------------------------------------------------------
  996. // LIVELLO 3
  997. //--------------------------------------------------------------------------------
  998. //==================================================================================
  999.  
  1000. dcmd_kick(playerid, params[])
  1001. {
  1002. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1003.  
  1004. new id, motivo[250];
  1005. if(sscanf(params,"is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /kick <id> <motivo>");
  1006.  
  1007. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player id non connesso!");
  1008.  
  1009. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  1010.  
  1011. new stringa[260];
  1012. new nome1[269];
  1013. new nome2[256];
  1014. GetPlayerName(playerid, nome1, sizeof(nome1));
  1015. GetPlayerName(id, nome2, sizeof(nome2));
  1016. format(stringa,600,"** {FF0000}L'admin %s ha kickato %s! {FFFFFF}Motivo: %s.",nome1, nome2, motivo);
  1017. SendClientMessageToAll(-1, stringa);
  1018.  
  1019.  
  1020.  
  1021. Kick(id);
  1022. return 1;
  1023. }
  1024.  
  1025. dcmd_slappa(playerid, params[])
  1026. {
  1027. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1028.  
  1029. new id;
  1030. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /slappa <id>");
  1031.  
  1032. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Playerid non connesso!");
  1033.  
  1034. new Float:x, Float:y, Float:z;
  1035. GetPlayerPos(id,x,y,z);
  1036. SetPlayerPos(id,x,y,z+5);
  1037. PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
  1038. PlayerPlaySound(id,1190,0.0,0.0,0.0);
  1039.  
  1040. new stringa[260];
  1041. new nome1[269];
  1042. new nome2[256];
  1043. GetPlayerName(playerid, nome1, sizeof(nome1));
  1044. GetPlayerName(id, nome2, sizeof(nome2));
  1045. format(stringa,600,"** {FF0000}L'admin %s ha slappato %s! ",nome1, nome2);
  1046. SendClientMessageToAll(-1, stringa);
  1047. return 1;
  1048. }
  1049.  
  1050. dcmd_jaila(playerid, params[])
  1051. {
  1052. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1053.  
  1054. new id, motivo[250];
  1055. if(sscanf(params,"is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /jaila <id> <motivo>");
  1056.  
  1057. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Playerid non connesso!");
  1058.  
  1059. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  1060.  
  1061. SetPlayerPos(id,197.6661,173.8179,1003.0234);
  1062. SetPlayerInterior(id,3);
  1063. Jailato[id] = 1;
  1064.  
  1065. new stringa[260];
  1066. new nome1[269];
  1067. new nome2[256];
  1068. GetPlayerName(playerid, nome1, sizeof(nome1));
  1069. GetPlayerName(id, nome2, sizeof(nome2));
  1070. format(stringa,600,"** {FF0000}L'admin %s ha jailato %s! {FFFFFF}Motivo: %s.",nome1, nome2, motivo);
  1071. SendClientMessageToAll(-1, stringa);
  1072. return 1;
  1073. }
  1074.  
  1075. dcmd_vitat(playerid, params[])
  1076. {
  1077. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1078.  
  1079. for(new i = 0; i < MAX_PLAYERS; i++)
  1080. {
  1081. SetPlayerHealth(i, 100);
  1082. PlayerPlaySound(i, 1058, 0, 0, 0);
  1083. }
  1084. new stringa[260];
  1085. new nome1[260];
  1086. GetPlayerName(playerid, nome1, sizeof(nome1));
  1087. format(stringa,600,"L'admin %s ha ricaricato la vita a tutto il server!",nome1);
  1088. SendClientMessageToAll(COLOR_BLUE, stringa);
  1089. return 1;
  1090. }
  1091.  
  1092. dcmd_armaturat(playerid, params[])
  1093. {
  1094. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1095.  
  1096. for(new i = 0; i < MAX_PLAYERS; i++)
  1097. {
  1098. SetPlayerArmour(i, 100);
  1099. PlayerPlaySound(i, 1058, 0, 0, 0);
  1100. }
  1101. new stringa[260];
  1102. new nome1[260];
  1103. GetPlayerName(playerid, nome1, sizeof(nome1));
  1104. format(stringa,600,"L'admin %s ha ricaricato l'armatura a tutto il server!",nome1);
  1105. SendClientMessageToAll(COLOR_BLUE, stringa);
  1106. return 1;
  1107. }
  1108.  
  1109. dcmd_killa(playerid, params[])
  1110. {
  1111. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1112.  
  1113. new id;
  1114. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /killa <id>");
  1115.  
  1116. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il playerid non è connesso!");
  1117.  
  1118. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  1119.  
  1120. SetPlayerHealth(id, 0);
  1121.  
  1122. new stringa[260];
  1123. new nome1[260];
  1124. new nome2[260];
  1125. GetPlayerName(playerid, nome1, sizeof(nome1));
  1126. GetPlayerName(id, nome2, sizeof(nome2));
  1127. format(stringa,600,"L'admin %s ha ucciso %s!",nome1, nome2);
  1128. SendClientMessageToAll(COLOR_RED, stringa);
  1129. return 1;
  1130. }
  1131.  
  1132. dcmd_unjaila(playerid, params[])
  1133. {
  1134. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1135.  
  1136. new id;
  1137. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /unjaila <id>");
  1138.  
  1139. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il playerid non è connesso!");
  1140.  
  1141. SetPlayerPos(id, 0.0, 0.0, 0.0);
  1142. SpawnPlayer(id);
  1143. PlayerPlaySound(id,1057,0.0,0.0,0.0);
  1144. Jailato[id]=0;
  1145.  
  1146. new stringa[260];
  1147. new nome2[260];
  1148. GetPlayerName(id, nome2, sizeof(nome2));
  1149. format(stringa,600,"Hai rilasciato %s dalla jail!",nome2);
  1150. SendClientMessage(playerid, COLOR_GREEN ,stringa);
  1151. return 1;
  1152. }
  1153.  
  1154. dcmd_get(playerid, params[])
  1155. {
  1156. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1157.  
  1158. new id;
  1159. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /get <id>");
  1160.  
  1161. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il playerid non è connesso!");
  1162.  
  1163. new Float:x, Float:y, Float:z;
  1164. GetPlayerPos(playerid, x,y,z);
  1165. SetPlayerPos(id, x,y,z);
  1166. return 1;
  1167. }
  1168.  
  1169. dcmd_setnome(playerid, params[])
  1170. {
  1171. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 3) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 3 per usare questo cmd!");
  1172.  
  1173. new id, nomec[260];
  1174. if(sscanf(params, "is", id, nomec)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /setnome <id> <nome>");
  1175.  
  1176. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il playerid non è connesso!");
  1177.  
  1178. SetPlayerName(id, nomec);
  1179.  
  1180. new stringa[260];
  1181. new nome1[260];
  1182. new nome2[260];
  1183. GetPlayerName(playerid, nome1, sizeof(nome1));
  1184. GetPlayerName(id, nome2, sizeof(nome2));
  1185. format(stringa,600,"** {00FF15}L'admin %s ha cambiato il nome a %s {FFFFFF}a: %s",nome1, nome2, nomec);
  1186. SendClientMessageToAll(-1 ,stringa);
  1187. return 1;
  1188. }
  1189.  
  1190. //=================================================================================
  1191. //-------------------------------------------------------------------------------
  1192. // LIVELLO 4
  1193. //--------------------------------------------------------------------------------
  1194. //==================================================================================
  1195.  
  1196. dcmd_ban(playerid, params[])
  1197. {
  1198. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 4 per usare questo cmd!");
  1199.  
  1200. new id, motivo[260];
  1201. if(sscanf(params, "is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /ban <id> <motivo>");
  1202.  
  1203. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Il playerid non è connesso!");
  1204.  
  1205. if(gPlayerInfo[playerid][PLAYER_LEVEL] < gPlayerInfo[id][PLAYER_LEVEL]) return SendClientMessage(playerid, COLOR_RED, "Questo playerid ha il grado admin maggiore del tuo!");
  1206.  
  1207. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Non ti puoi bannare da solo!");
  1208.  
  1209. new stringa[260];
  1210. new nome1[260];
  1211. new nome2[260];
  1212. GetPlayerName(playerid, nome1, sizeof(nome1));
  1213. GetPlayerName(id, nome2, sizeof(nome2));
  1214. format(stringa,600,"** {FF0000L}'admin %s ha bannato %s. {FFFFFF}Motivo: %s.",nome1, nome2, motivo);
  1215. SendClientMessageToAll(-1 ,stringa);
  1216. Ban(id);
  1217. return 1;
  1218. }
  1219.  
  1220. dcmd_god(playerid, params[])
  1221. {
  1222. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 4 per usare questo cmd!");
  1223.  
  1224. SetPlayerHealth(playerid, 99999);
  1225. SendClientMessage(playerid, COLOR_GREEN, "GodMode Admin ON");
  1226. return 1;
  1227. }
  1228.  
  1229. dcmd_sgod(playerid, params[])
  1230. {
  1231. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 4 per usare questo cmd!");
  1232.  
  1233. SetPlayerHealth(playerid, 100);
  1234. SendClientMessage(playerid, COLOR_RED, "GodMode Admin OFF");
  1235. return 1;
  1236. }
  1237.  
  1238. dcmd_seban(playerid, params[])
  1239. {
  1240. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere livello 4 per utilizzare questo cmd!");
  1241.  
  1242. new id, motivo[128];
  1243. if(sscanf(params, "uz", id, motivo)) return SendClientMessage(playerid, -1, "{FF0000}Utilizzo: {FFFFFF}/seban <playerid> <motivo>");
  1244. else if (id == INVALID_PLAYER_ID || !IsPlayerConnected(id))
  1245. {
  1246. SendClientMessage(playerid, -1, "{FF0000}Player non Connesso!");
  1247. return 0;
  1248. }
  1249. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Non puoi serialbannare te stesso!");
  1250. new seriale[128], str[256], nome[24], nome2[28];
  1251. GetPlayerName(id, nome, 24);
  1252. GetPlayerName(playerid, nome2, sizeof(nome2));
  1253. gpci(id, seriale, 128);
  1254. format(file, 256, Cartella, seriale);
  1255. new File:Banf = fopen(file, io_write);
  1256. fwrite(Banf, nome);
  1257. fclose(Banf);
  1258. if(strlen(motivo) != 0) format(str, 256, "** {FF0000}L'admin %s ha SERIAL-BANNATO %s. {FFFFFF}Motivo: %s.", nome2, nome, motivo);
  1259. else if(strlen(motivo) == 0) format(str, 256, "** {FF0000}L'admin %s ha SERIAL-BANNATO %s. {FFFFFF}Motivo: ", nome2, nome);
  1260. SendClientMessageToAll(-1, str);
  1261. new ip[32], cmd[128];
  1262. GetPlayerIp(id, ip, 32);
  1263. format(cmd, 128, "banip %d", ip);
  1264. SendRconCommand(cmd);
  1265. Ban(id);
  1266. return 1;
  1267. }
  1268.  
  1269. dcmd_disarmat(playerid, params[])
  1270. {
  1271. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere livello 4 per utilizzare questo cmd!");
  1272.  
  1273. for(new i = 0; i < MAX_PLAYERS; i++)
  1274. {
  1275. ResetPlayerWeapons(i);
  1276. PlayerPlaySound(i, 1058, 0, 0, 0);
  1277. }
  1278.  
  1279. new stringa[260];
  1280. new nome1[260];
  1281. GetPlayerName(playerid, nome1, sizeof(nome1));
  1282. format(stringa, 260, "L'admin %s ha disarmato tutto il server!", nome1);
  1283. SendClientMessageToAll(COLOR_BLUE, stringa);
  1284. return 1;
  1285. }
  1286.  
  1287. dcmd_disarma(playerid, params[])
  1288. {
  1289. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere livello 4 per utilizzare questo cmd!");
  1290.  
  1291. new id;
  1292. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /disarma <id>");
  1293.  
  1294. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Id non connesso!");
  1295.  
  1296. ResetPlayerWeapons(id);
  1297.  
  1298. new stringa[260];
  1299. new nome1[260];
  1300. new nome2[260];
  1301. GetPlayerName(playerid, nome1, sizeof(nome1));
  1302. GetPlayerName(id, nome2, sizeof(nome2));
  1303. format(stringa, 260, "L'admin %s ha disarmato %s!", nome1, nome2);
  1304. SendClientMessageToAll(COLOR_RED, stringa);
  1305. return 1;
  1306. }
  1307.  
  1308. dcmd_asoldi(playerid, params[])
  1309. {
  1310. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere livello 4 per utilizzare questo cmd!");
  1311.  
  1312. new soldi;
  1313. if(sscanf(params, "i", soldi)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /asoldi <soldi>");
  1314.  
  1315. for(new i = 0; i < MAX_PLAYERS; i++)
  1316. {
  1317. GivePlayerMoney(i, soldi);
  1318. PlayerPlaySound(i, 1058, 0, 0, 0);
  1319. }
  1320.  
  1321. new stringa[260];
  1322. new nome1[200];
  1323. GetPlayerName(playerid, nome1, sizeof(nome1));
  1324. format(stringa, 260, "** {1F8C56}L'admin %s ha dato al server {FFFFFF}%d$!", nome1, soldi);
  1325. SendClientMessageToAll(COLOR_RED, stringa);
  1326. return 1;
  1327. }
  1328.  
  1329. dcmd_dais(playerid, params[])
  1330. {
  1331. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 4) return SendClientMessage(playerid, COLOR_RED, "Devi essere livello 4 per utilizzare questo cmd!");
  1332.  
  1333. new id, soldi;
  1334. if(sscanf(params, "ui", id, soldi)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /dais <soldi>");
  1335.  
  1336. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player id non connesso!");
  1337.  
  1338. GivePlayerMoney(id, soldi);
  1339. return 1;
  1340. }
  1341.  
  1342. dcmd_report(playerid, params[])
  1343. {
  1344. new id, motivo[260];
  1345. if(sscanf(params, "is", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /report <id> <motivo>");
  1346. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Id non connesso, riprova.");
  1347. new nome1[260], nome2[260], stringa[260];
  1348. GetPlayerName(playerid, nome1, sizeof(nome1));
  1349. GetPlayerName(id, nome2, sizeof(nome2));
  1350. format(stringa, 260, "{FF0000}[Report] {FFFFFF}%s reporta %s per:{FF0000} %s.", nome1, nome2, motivo);
  1351. SendMessageToAdmins( -1, stringa);
  1352. SendClientMessage(playerid, COLOR_GREEN, "Report inviato con successo!");
  1353. return 1;
  1354. }
  1355.  
  1356.  
  1357. dcmd_console(playerid, params[])
  1358. {
  1359. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 5) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 5 per usare questo cmd!");
  1360.  
  1361. new stringa[260];
  1362. format(stringa, 260, "%s", params);
  1363. SendRconCommand(stringa);
  1364.  
  1365. format(stringa, 260, "Comando /rcon %s inviato!", params);
  1366. SendClientMessage(playerid, COLOR_GREEN, stringa);
  1367. return 1;
  1368. }
  1369.  
  1370. dcmd_setmembro(playerid, params[])
  1371. {
  1372. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 5) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 5 per usare questo cmd!");
  1373.  
  1374. new id;
  1375. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USA: /setmembro <id>");
  1376.  
  1377. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ORANGE, "Playerid non connesso!");
  1378.  
  1379. gPlayerInfo[id][PLAYER_MEMBRO] = 1;
  1380.  
  1381. dini_IntSet(file, "Membro", gPlayerInfo[playerid][PLAYER_MEMBRO]);
  1382.  
  1383. new nome[26], nome2[26], stringa[260];
  1384. GetPlayerName(playerid, nome, sizeof(nome));
  1385. GetPlayerName(id, nome2, sizeof(nome));
  1386. format(stringa, 260, "L'admin %s ha settato %s membro!", nome, nome2);
  1387. SendClientMessageToAll(COLOR_GREY, stringa);
  1388. return 1;
  1389. }
  1390.  
  1391.  
  1392. dcmd_rban(playerid, params[])
  1393. {
  1394. if(gPlayerInfo[playerid][PLAYER_LEVEL] < 5) return SendClientMessage(playerid, COLOR_RED, "Devi essere admin di livello 5 per usare questo cmd!");
  1395.  
  1396. new id, motivo[260], ip[260];
  1397. if(sscanf(params, "uz", id, motivo)) return SendClientMessage(playerid, COLOR_ORANGE, "-> Usa: /rban <id> <motivo>");
  1398.  
  1399. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player id non connesso! Riprova con un'altro!");
  1400.  
  1401. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Non puoi range bannare te stesso!");
  1402.  
  1403. new stringa[269], nome[26], nome2[26];
  1404. GetPlayerName(playerid, nome, sizeof(nome));
  1405. GetPlayerName(id, nome2, sizeof(nome2));
  1406. format(stringa, 260, "[Bye Bye] L'admin %s ha RangeBannato %s. Motivo: %s", nome, nome2, motivo);
  1407. SendClientMessageToAll(COLOR_RED, stringa);
  1408.  
  1409. GetPlayerIp(id,ip,sizeof(ip));
  1410. strdel(ip,strlen(ip)-2,strlen(ip));
  1411. format(ip,128,"%s**",ip);
  1412. format(ip,128,"banip %s",ip);
  1413. SendRconCommand(ip);
  1414.  
  1415. print(stringa);
  1416. return 1;
  1417. }
  1418.  
  1419. //=================================================================================
  1420. //-------------------------------------------------------------------------------
  1421. // ~Membri~
  1422. //--------------------------------------------------------------------------------
  1423. //==================================================================================
  1424.  
  1425.  
  1426. dcmd_acmd(playerid, params[])
  1427. {
  1428. if(strcmp(params,"1",true) == 0)
  1429. {
  1430. if(gPlayerInfo[playerid][PLAYER_LEVEL] >= 1)
  1431. {
  1432. SendClientMessage(playerid, COLOR_RED, "---> Comandi da Livello 1!");
  1433. SendClientMessage(playerid, COLOR_RED, "/ip, /spec, /specoff, /asay, /levaveicolo, /goto");
  1434. }
  1435. else return SendClientMessage(playerid, COLOR_RED, "Non hai i permessi per accedere a questo cmd!");
  1436. }
  1437. if(strcmp(params,"2",true) == 0)
  1438. {
  1439. if(gPlayerInfo[playerid][PLAYER_LEVEL] >= 2)
  1440. {
  1441. SendClientMessage(playerid, COLOR_RED, "---> Comandi da Livello 2!");
  1442. SendClientMessage(playerid, COLOR_RED, "/warna, /armat, /tempo, /ora, /muta, /smuta, /cc, /ferma, /sferma, /ann");
  1443. }
  1444. else return SendClientMessage(playerid, COLOR_RED, "Non hai i permessi per accedere a questo cmd!");
  1445. }
  1446. if(strcmp(params,"3",true) == 0)
  1447. {
  1448. if(gPlayerInfo[playerid][PLAYER_LEVEL] >= 3)
  1449. {
  1450. SendClientMessage(playerid, COLOR_RED, "---> Comandi da Livello 3!");
  1451. SendClientMessage(playerid, COLOR_RED, "/kick, /slappa, /jaila, /vitat, /armaturat, /killa, /unjaila, /get, /setnome");
  1452. }
  1453. else return SendClientMessage(playerid, COLOR_RED, "Non hai i permessi per accedere a questo cmd!");
  1454. }
  1455. if(strcmp(params,"4",true) == 0)
  1456. {
  1457. if(gPlayerInfo[playerid][PLAYER_LEVEL] >= 4)
  1458. {
  1459. SendClientMessage(playerid, COLOR_RED, "---> Comandi da Livello 4!");
  1460. SendClientMessage(playerid, COLOR_RED, "/ban, /god, /sgod, /seban, /disarmat, /disarma, /asoldi, /dais");
  1461. }
  1462. else return SendClientMessage(playerid, COLOR_RED, "Non hai i permessi per accedere a questo cmd!");
  1463. }
  1464. return 1;
  1465. }
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1472. {
  1473. return 1;
  1474. }
  1475.  
  1476. public OnPlayerExitVehicle(playerid, vehicleid)
  1477. {
  1478. return 1;
  1479. }
  1480.  
  1481. public OnPlayerStateChange(playerid, newstate, oldstate)
  1482. {
  1483. return 1;
  1484. }
  1485.  
  1486. public OnPlayerEnterCheckpoint(playerid)
  1487. {
  1488. return 1;
  1489. }
  1490.  
  1491. public OnPlayerLeaveCheckpoint(playerid)
  1492. {
  1493. return 1;
  1494. }
  1495.  
  1496. public OnPlayerEnterRaceCheckpoint(playerid)
  1497. {
  1498. return 1;
  1499. }
  1500.  
  1501. public OnPlayerLeaveRaceCheckpoint(playerid)
  1502. {
  1503. return 1;
  1504. }
  1505.  
  1506. public OnRconCommand(cmd[])
  1507. {
  1508. return 1;
  1509. }
  1510.  
  1511. public OnPlayerRequestSpawn(playerid)
  1512. {
  1513. return 1;
  1514. }
  1515.  
  1516. public OnObjectMoved(objectid)
  1517. {
  1518. return 1;
  1519. }
  1520.  
  1521. public OnPlayerObjectMoved(playerid, objectid)
  1522. {
  1523. return 1;
  1524. }
  1525.  
  1526. public OnPlayerPickUpPickup(playerid, pickupid)
  1527. {
  1528. return 1;
  1529. }
  1530.  
  1531. public OnVehicleMod(playerid, vehicleid, componentid)
  1532. {
  1533. if(GetPlayerInterior(playerid) == 0)
  1534. {
  1535. new nome[26];
  1536. new stringa[260];
  1537. GetPlayerName(playerid, nome, sizeof(nome));
  1538. format(stringa, 260, "** {FF0000}%s è stato automaticamente bannato. {FFFFFF}Motivo: Crasher", nome);
  1539. SendClientMessageToAll(-1, stringa);
  1540. TogglePlayerControllable(playerid, 0);
  1541. Ban(playerid);
  1542. }
  1543. return 1;
  1544. }
  1545.  
  1546. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1547. {
  1548. return 1;
  1549. }
  1550.  
  1551. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1552. {
  1553. return 1;
  1554. }
  1555.  
  1556. public OnPlayerSelectedMenuRow(playerid, row)
  1557. {
  1558. return 1;
  1559. }
  1560.  
  1561. public OnPlayerExitedMenu(playerid)
  1562. {
  1563. return 1;
  1564. }
  1565.  
  1566. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1567. {
  1568. return 1;
  1569. }
  1570.  
  1571. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1572. {
  1573. return 1;
  1574. }
  1575.  
  1576. public OnRconLoginAttempt(ip[], password[], success)
  1577. {
  1578. return 1;
  1579. }
  1580.  
  1581. public OnPlayerUpdate(playerid)
  1582. {
  1583. return 1;
  1584. }
  1585.  
  1586. public OnPlayerStreamIn(playerid, forplayerid)
  1587. {
  1588. return 1;
  1589. }
  1590.  
  1591. public OnPlayerStreamOut(playerid, forplayerid)
  1592. {
  1593. return 1;
  1594. }
  1595.  
  1596. public OnVehicleStreamIn(vehicleid, forplayerid)
  1597. {
  1598. return 1;
  1599. }
  1600.  
  1601. public OnVehicleStreamOut(vehicleid, forplayerid)
  1602. {
  1603. return 1;
  1604. }
  1605.  
  1606.  
  1607.  
  1608. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1609. {
  1610. if(dialogid == 1)
  1611. {
  1612. if(response)
  1613. {
  1614. if(strlen(inputtext))
  1615. {
  1616. new name[MAX_PLAYER_NAME], ip[16], string[128];
  1617. GetPlayerName(playerid, name, sizeof(name));
  1618. GetPlayerIp(playerid, ip, sizeof(ip));
  1619. format(file, sizeof(file), PlayerFile, name);
  1620. dini_Create(file);
  1621. dini_Set(file, "Name", name);
  1622. dini_Set(file, "Ip", ip);
  1623. dini_IntSet(file, "Registered", 1);
  1624. dini_IntSet(file, "Password", num_hash(inputtext));
  1625. dini_IntSet(file, "Level", gPlayerInfo[playerid][PLAYER_LEVEL]);
  1626. dini_IntSet(file, "Money", 50);
  1627. dini_IntSet(file, "Membro", 0);
  1628. format(string, sizeof(string), "[ReVo] Nome %s registrato con successo. ", name);
  1629. SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
  1630. strcat(gPlayerInfo[playerid][PLAYER_NAME], dini_Get(file, "Name"));
  1631. strcat(gPlayerInfo[playerid][PLAYER_IP], dini_Get(file, "Ip"));
  1632. gPlayerInfo[playerid][PLAYER_PASS] = dini_Int(file, "Password");
  1633. gPlayerInfo[playerid][PLAYER_MEMBRO] = dini_Int(file, "Membro");
  1634. gPlayerInfo[playerid][PLAYER_LEVEL] = dini_Int(file, "Level");
  1635. GivePlayerMoney(playerid, dini_Int(file, "Money"));
  1636. gPlayerLogged[playerid] = 1;
  1637. }
  1638. else if(!strlen(inputtext))
  1639. {
  1640. SendClientMessage(playerid, COLOR_RED, "(ReVo) [Errore] Password non inserita!");
  1641. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Inserisci la password che hai inserito alla registrazione", "Invio", "Esci");
  1642. }
  1643. }
  1644. else if(!response)
  1645. {
  1646. Kick(playerid);
  1647. }
  1648. }
  1649.  
  1650. if(dialogid == 2)
  1651. {
  1652. if(response)
  1653. {
  1654. if(strlen(inputtext))
  1655. {
  1656. new name[MAX_PLAYER_NAME], string[128];
  1657. GetPlayerName(playerid, name, sizeof(name));
  1658. format(file, sizeof(file), PlayerFile, name);
  1659. if(num_hash(inputtext) == dini_Int(file, "Password"))
  1660. {
  1661. strcat(gPlayerInfo[playerid][PLAYER_NAME], dini_Get(file, "Name"));
  1662. strcat(gPlayerInfo[playerid][PLAYER_IP], dini_Get(file, "Ip"));
  1663. gPlayerInfo[playerid][PLAYER_PASS] = dini_Int(file, "Password");
  1664. gPlayerInfo[playerid][PLAYER_LEVEL] = dini_Int(file, "Level");
  1665. gPlayerInfo[playerid][PLAYER_MEMBRO] = dini_Int(file, "Membro");
  1666. GivePlayerMoney(playerid, dini_Int(file, "Money"));
  1667. gPlayerLogged[playerid] = 1;
  1668. format(string, sizeof(string), "Bentornato %s nel tuo ReVo account!", name);
  1669. SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
  1670. }
  1671. else if(num_hash(inputtext) != dini_Int(file, "Password"))
  1672. {
  1673. SendClientMessage(playerid, COLOR_RED, "Password Sbagliata!");
  1674. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Inserisci la password che hai inserito alla registrazione.", "Login", "Esci");
  1675. }
  1676. }
  1677. else if(!strlen(inputtext))
  1678. {
  1679. SendClientMessage(playerid, COLOR_RED, "Non hai inserito la password!");
  1680. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Inserisci la password che hai inserito alla registrazione.", "Login", "Esci");
  1681. }
  1682. }
  1683. else if(!response)
  1684. {
  1685. Kick(playerid);
  1686. }
  1687. }
  1688. return 1;
  1689. }
  1690.  
  1691. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1692. {
  1693. return 1;
  1694. }
  1695.  
  1696. stock sscanf(string[], format[], {Float,_}:...)
  1697. {
  1698. #if defined isnull
  1699. if (isnull(string))
  1700. #else
  1701. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  1702. #endif
  1703. {
  1704. return format[0];
  1705. }
  1706. #pragma tabsize 4
  1707. new
  1708. formatPos = 0,
  1709. stringPos = 0,
  1710. paramPos = 2,
  1711. paramCount = numargs(),
  1712. delim = ' ';
  1713. while (string[stringPos] && string[stringPos] <= ' ')
  1714. {
  1715. stringPos++;
  1716. }
  1717. while (paramPos < paramCount && string[stringPos])
  1718. {
  1719. switch (format[formatPos++])
  1720. {
  1721. case '\0':
  1722. {
  1723. return 0;
  1724. }
  1725. case 'i', 'd':
  1726. {
  1727. new
  1728. neg = 1,
  1729. num = 0,
  1730. ch = string[stringPos];
  1731. if (ch == '-')
  1732. {
  1733. neg = -1;
  1734. ch = string[++stringPos];
  1735. }
  1736. do
  1737. {
  1738. stringPos++;
  1739. if ('0' <= ch <= '9')
  1740. {
  1741. num = (num * 10) + (ch - '0');
  1742. }
  1743. else
  1744. {
  1745. return -1;
  1746. }
  1747. }
  1748. while ((ch = string[stringPos]) > ' ' && ch != delim);
  1749. setarg(paramPos, 0, num * neg);
  1750. }
  1751. case 'h', 'x':
  1752. {
  1753. new
  1754. num = 0,
  1755. ch = string[stringPos];
  1756. do
  1757. {
  1758. stringPos++;
  1759. switch (ch)
  1760. {
  1761. case 'x', 'X':
  1762. {
  1763. num = 0;
  1764. continue;
  1765. }
  1766. case '0' .. '9':
  1767. {
  1768. num = (num << 4) | (ch - '0');
  1769. }
  1770. case 'a' .. 'f':
  1771. {
  1772. num = (num << 4) | (ch - ('a' - 10));
  1773. }
  1774. case 'A' .. 'F':
  1775. {
  1776. num = (num << 4) | (ch - ('A' - 10));
  1777. }
  1778. default:
  1779. {
  1780. return -1;
  1781. }
  1782. }
  1783. }
  1784. while ((ch = string[stringPos]) > ' ' && ch != delim);
  1785. setarg(paramPos, 0, num);
  1786. }
  1787. case 'c':
  1788. {
  1789. setarg(paramPos, 0, string[stringPos++]);
  1790. }
  1791. case 'f':
  1792. {
  1793.  
  1794. new changestr[16], changepos = 0, strpos = stringPos;
  1795. while(changepos < 16 && string[strpos] && string[strpos] != delim)
  1796. {
  1797. changestr[changepos++] = string[strpos++];
  1798. }
  1799. changestr[changepos] = '\0';
  1800. setarg(paramPos,0,_:floatstr(changestr));
  1801. }
  1802. case 'p':
  1803. {
  1804. delim = format[formatPos++];
  1805. continue;
  1806. }
  1807. case '\'':
  1808. {
  1809. new
  1810. end = formatPos - 1,
  1811. ch;
  1812. while ((ch = format[++end]) && ch != '\'') {}
  1813. if (!ch)
  1814. {
  1815. return -1;
  1816. }
  1817. format[end] = '\0';
  1818. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  1819. {
  1820. if (format[end + 1])
  1821. {
  1822. return -1;
  1823. }
  1824. return 0;
  1825. }
  1826. format[end] = '\'';
  1827. stringPos = ch + (end - formatPos);
  1828. formatPos = end + 1;
  1829. }
  1830. case 'u':
  1831. {
  1832. new
  1833. end = stringPos - 1,
  1834. id = 0,
  1835. bool:num = true,
  1836. ch;
  1837. while ((ch = string[++end]) && ch != delim)
  1838. {
  1839. if (num)
  1840. {
  1841. if ('0' <= ch <= '9')
  1842. {
  1843. id = (id * 10) + (ch - '0');
  1844. }
  1845. else
  1846. {
  1847. num = false;
  1848. }
  1849. }
  1850. }
  1851. if (num && IsPlayerConnected(id))
  1852. {
  1853. setarg(paramPos, 0, id);
  1854. }
  1855. else
  1856. {
  1857. #if !defined foreach
  1858. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  1859. #define __SSCANF_FOREACH__
  1860. #endif
  1861. string[end] = '\0';
  1862. num = false;
  1863. new
  1864. name[MAX_PLAYER_NAME];
  1865. id = end - stringPos;
  1866. foreach (Player, playerid)
  1867. {
  1868. GetPlayerName(playerid, name, sizeof (name));
  1869. if (!strcmp(name, string[stringPos], true, id))
  1870. {
  1871. setarg(paramPos, 0, playerid);
  1872. num = true;
  1873. break;
  1874. }
  1875. }
  1876. if (!num)
  1877. {
  1878. setarg(paramPos, 0, INVALID_PLAYER_ID);
  1879. }
  1880. string[end] = ch;
  1881. #if defined __SSCANF_FOREACH__
  1882. #undef foreach
  1883. #undef __SSCANF_FOREACH__
  1884. #endif
  1885. }
  1886. stringPos = end;
  1887. }
  1888. case 's', 'z':
  1889. {
  1890. new
  1891. i = 0,
  1892. ch;
  1893. if (format[formatPos])
  1894. {
  1895. while ((ch = string[stringPos++]) && ch != delim)
  1896. {
  1897. setarg(paramPos, i++, ch);
  1898. }
  1899. if (!i)
  1900. {
  1901. return -1;
  1902. }
  1903. }
  1904. else
  1905. {
  1906. while ((ch = string[stringPos++]))
  1907. {
  1908. setarg(paramPos, i++, ch);
  1909. }
  1910. }
  1911. stringPos--;
  1912. setarg(paramPos, i, '\0');
  1913. }
  1914. default:
  1915. {
  1916. continue;
  1917. }
  1918. }
  1919. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  1920. {
  1921. stringPos++;
  1922. }
  1923. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  1924. {
  1925. stringPos++;
  1926. }
  1927. paramPos++;
  1928. }
  1929. do
  1930. {
  1931. if ((delim = format[formatPos++]) > ' ')
  1932. {
  1933. if (delim == '\'')
  1934. {
  1935. while ((delim = format[formatPos++]) && delim != '\'') {}
  1936. }
  1937. else if (delim != 'z')
  1938. {
  1939. return delim;
  1940. }
  1941. }
  1942. }
  1943. while (delim > ' ');
  1944. return 0;
  1945. }
  1946.  
  1947. stock GetStampIP(playerid){
  1948. new S_IP[16];
  1949. Join_Stamp=GetTickCount();
  1950. GetPlayerIp(playerid,S_IP,16);
  1951. format(ban_s, 16, "%s", S_IP);
  1952. }
  1953.  
  1954. forward CheckSeriale(playerid);
  1955. public CheckSeriale(playerid)
  1956. {
  1957. new seriale[128];
  1958. gpci(playerid, seriale, 128);
  1959. format(file, 256, Cartella, seriale);
  1960. if(fexist(file))
  1961. {
  1962. SetTimerEx("Bannato", 2000, 0, "i", playerid);
  1963. }
  1964. }
  1965.  
  1966. forward Bannato(playerid);
  1967. public Bannato(playerid)
  1968. {
  1969. new stringa[256], nome[24], cmd[128], ip[32];
  1970. GetPlayerIp(playerid, ip, 32);
  1971. format(cmd, 128, "banip %d", ip);
  1972. GetPlayerName(playerid, nome, 24);
  1973. format(stringa, 256, "Caro %s, \n Le abbiamo bannato il suo account per motivi. \n Se ritiene ingiusto questo ban, fai un ricorso sul forum.", nome);
  1974. ShowPlayerDialog(playerid, 350, DIALOG_STYLE_MSGBOX, "Account Bannato!", stringa, "Chiudi", "");
  1975. SendRconCommand(cmd);
  1976. Ban(playerid);
  1977. return 1;
  1978. }
  1979.  
  1980. stock SendMessageToAdmins(color,const msg[])
  1981. {
  1982. for (new i=0; i<MAX_PLAYERS; i++)
  1983. {
  1984. if (IsPlayerConnected(i) && gPlayerInfo[i][PLAYER_LEVEL] >= 1) SendClientMessage(i,color,msg);
  1985. }
  1986. }
  1987.  
  1988. /*
  1989.  
  1990. Tutti i diritti riservati a BasePlate aka ErmeS, NicoZ etc...
  1991. Ne è vietata la copia totale o parziale del contentuto di questo file.
  1992. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement