LVPYassine

Admin System

Jan 21st, 2017
739
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 139.22 KB | None | 0 0
  1. /**************************************************************************/
  2. // Admin & VIP System
  3. /*************************************************************************/
  4. /**************************************************************************/
  5. // Version 1.0 | Build 1
  6. /*************************************************************************/
  7. /**
  8. * Copyright (c) 2015-2016 San Andreas Playground
  9. *
  10. * This program is free software: you can redistribute it and/or modify it under the terms of the
  11. * GNU General Public License as published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
  15. * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with this program.
  19. * If not, see <http://www.gnu.org/licenses/>.
  20. */
  21.  
  22. /*AUTHOR ********************
  23. @Yaa - SA-MP Scripter
  24. ***************************/
  25.  
  26.  
  27. #include <a_samp>
  28. #include <YSI/y_iterate>
  29. #include <a_mysql>
  30. #include <irc>
  31. #include <streamer>
  32. #include <zcmd>
  33. #include <sscanf2>
  34.  
  35. #define SERVNAME "San Andreas Server"
  36. #define SERVWEB "sa-mp.com"
  37. #define DIALOG_HELP 10
  38. #define Login 12
  39. #define Register 13
  40. #define DIALOG_CONSOLE 14
  41. #define DIALOG_FEATURES 1000
  42. #define DIALOG_GMTEXT 1900
  43. #define DIALOG_FS 2000
  44. #define DIALOG_HOSTNAME 3000
  45. #define DIALOG_ANIMALSCARS 3100
  46. #define EDITOBJ_DIALOG 3200
  47.  
  48. #define G "{6EF83C}"
  49. #define R "{F81414}"
  50. #define W "{FFFFFF}"
  51. #define O "{FFAF00}"
  52. #define YE "{FFFF00}"
  53. #define GRI "{C0C0C0}"
  54.  
  55. #define COLOR_VIOLET 0xEE82EEFF
  56. #define COLOR_PURPLE 0xC2A2DAAA
  57. #define COLOR_GREY 0xAFAFAFAA
  58. #define COLOR_GREEN 0x33AA33AA
  59. #define COLOR_RED 0xE01B4CFF
  60. #define COLOR_YELLOW 0xFFFF00AA
  61. #define COLOR_WHITE 0xFFFFFFAA
  62. #define COLOR_BLUE 0x2587CEAA
  63. #define COLOR_LIGHTBLUE 0x33CCFFAA
  64. #define COLOR_ORANGE 0xFF9900AA
  65. #define COLOR_LIME 0x10F441AA
  66. #define COLOR_MAGENTA 0xFF00FFFF
  67. #define COLOR_NAVY 0x000080AA
  68. #define COLOR_AQUA 0xF0F8FFAA
  69. #define COLOR_CRIMSON 0xDC143CAA
  70. #define COLOR_FLBLUE 0x6495EDAA
  71. #define COLOR_BISQUE 0xFFE4C4AA
  72. #define COLOR_BLACK 0x000000AA
  73. #define COLOR_CHARTREUSE 0x7FFF00AA
  74. #define COLOR_BROWN 0XA52A2AAA
  75. #define COLOR_CORAL 0xFF7F50AA
  76. #define COLOR_GOLD 0xB8860BAA
  77. #define COLOR_GREENYELLOW 0xADFF2FAA
  78. #define COLOR_INDIGO 0x4B00B0AA
  79. #define COLOR_IVORY 0xFFFF82AA
  80. #define COLOR_LAWNGREEN 0x7CFC00AA
  81. #define COLOR_SEAGREEN 0x20B2AAAA
  82. #define COLOR_LIMEGREEN 0x32CD32AA
  83. #define COLOR_MIDNIGHTBLUE 0X191970AA
  84. #define COLOR_MAROON 0x800000AA
  85. #define COLOR_OLIVE 0x808000AA
  86. #define COLOR_ORANGERED 0xFF4500AA
  87. #define COLOR_PINK 0xFFC0CBAA
  88. #define COLOR_SPRINGGREEN 0x00FF7FAA
  89. #define COLOR_TOMATO 0xFF6347AA
  90. #define COLOR_YELLOWGREEN 0x9ACD32AA
  91. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  92. #define COLOR_MEDIUMMAGENTA 0x8B008BAA
  93.  
  94. #define getPlayerworld GetPlayerVirtualWorld(playerid)
  95.  
  96. native WP_Hash(buffer[], len, const str[]);
  97.  
  98. new
  99.  
  100. /****** MySQL Configurations ********/
  101.  
  102. MySQL_Host[20] = "localhost",
  103. MySQL_Database[20] = "test",
  104. MySQL_User[20] = "root",
  105. MySQL_Password[20] = "",
  106. MySQL_Port = 3306,
  107.  
  108. /****** IRC Configurations ********/
  109.  
  110. IRCServer[50] = "pool.irc.tl",
  111. IRCChannel[20] = "#SAP.echo", // echo channel
  112. IRCChannel2[20] = "#SAP",
  113. IRCPort = 6667,
  114. IRCBot[20] = "StrikerX",
  115. IRCBot2[20] = "StrikerZ",
  116. IRCBot3[20] = "EliteX",
  117. IRCBot4[20] = "EliteZ",
  118. IRCBot5[20] = "TitanX",
  119. IRCBot6[20] = "TitanZ"
  120.  
  121. ;
  122.  
  123. enum PlayerYa
  124. {
  125. ID,
  126. Password[129],
  127. Kills,
  128. Deaths,
  129. Level,
  130. VIP,
  131. Skin,
  132. Hours,
  133. Minutes,
  134. DMsg[50],
  135. Bans,
  136. Kicks
  137.  
  138. }
  139.  
  140. static
  141.  
  142. myzobject,
  143. objectid2[3],
  144. vehicleid2[3],
  145. groupID,
  146. Type[MAX_PLAYERS],
  147. Animal[MAX_PLAYERS],
  148. IsFlying[MAX_PLAYERS],
  149. Enabled[MAX_PLAYERS],
  150. AREnabled[MAX_PLAYERS],
  151. REnabled[MAX_PLAYERS],
  152. VehicleBoost[MAX_PLAYERS],
  153. BlockPm[MAX_PLAYERS],
  154. botIDs[8],
  155. IsLoggedIn[MAX_PLAYERS],
  156. MySQL:yadmin,
  157. PlayerInfo[MAX_PLAYERS][PlayerYa],
  158. bool:CRamp[MAX_PLAYERS],
  159. Ramp[MAX_PLAYERS],
  160. muted[MAX_PLAYERS],
  161. IsJailed[MAX_PLAYERS],
  162. MAPTP[MAX_PLAYERS],
  163. godmode[MAX_PLAYERS],
  164. Given[MAX_PLAYERS],
  165. IsFreezed[MAX_PLAYERS],
  166. vCar[MAX_PLAYERS],
  167. Spec[MAX_PLAYERS],
  168. GodMode[MAX_PLAYERS],
  169. Mute,
  170. Jail,
  171. bool:OnFly[MAX_PLAYERS]
  172. ;
  173.  
  174.  
  175. forward InitFly(playerid);
  176. //forward bool:StartFly(playerid);
  177. forward Fly(playerid);
  178. forward bool:StopFly(playerid);
  179. forward static SetPlayerLookAt(playerid,Float:x,Float:y);
  180. forward onMySQLCheck(playerid);
  181. forward destroy(playerid);
  182. forward DelayBans(playerid);
  183. forward DelayKicks(playerid);
  184. forward unjail(playerid, reason);
  185. forward TimeOnServer();
  186. forward unmuteTimer(playerid);
  187. forward DelayBan(playerid);
  188. forward DelayKick(playerid);
  189.  
  190. public OnFilterScriptInit()
  191. {
  192. new MySQLOpt:options = mysql_init_options();
  193. mysql_set_option(options, SERVER_PORT, MySQL_Port);
  194. mysql_log(ALL);
  195. yadmin = mysql_connect(MySQL_Host, MySQL_User, MySQL_Password, MySQL_Database, options);
  196. if(mysql_errno() != 0)
  197. {
  198. printf("[MySQL Connection]: The connection to Database `%s` has failed.", MySQL_Database);
  199. printf("[MySQL Notice]: Fail to Create `accounts` & `banlist` tables on database `%s`", MySQL_Database);
  200. }
  201. else
  202. {
  203. printf("[MySQL Connection]: The connection to Database `%s` was successful.", MySQL_Database);
  204. mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `accounts` (`Name` VARCHAR(64),`Password` VARCHAR(129), `IP` VARCHAR(20), `Admin` INT(20), `VIP` INT(20), `Deaths` INT(20), `Kills` INT(20), `Bans` INT(20), `Kicks` INT(20), `DeathMessage` VARCHAR(50))");
  205. mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `accounts_2` ( `Name` VARCHAR(64), `Hours` INT(50), `Minutes` INT(50), `SkinID` INT(3))");
  206. mysql_query(yadmin, "CREATE TABLE IF NOT EXISTS `banlist` ( `name` VARCHAR(50), `ip` VARCHAR(50), `Admin` VARCHAR(64), `Reason` VARCHAR(64))");
  207. printf("[MySQL Notice]: all Tables are created on database `%s` ! ", MySQL_Database);
  208. }
  209.  
  210. botIDs[0] = IRC_Connect(IRCServer, IRCPort, IRCBot, "SAP", "SAP");
  211. IRC_SetIntData(botIDs[0], E_IRC_CONNECT_DELAY, 2);
  212.  
  213. botIDs[1] = IRC_Connect(IRCServer, IRCPort, IRCBot2, "SAP", "SAP");
  214. IRC_SetIntData(botIDs[1], E_IRC_CONNECT_DELAY, 2);
  215.  
  216. botIDs[2] = IRC_Connect(IRCServer, IRCPort, IRCBot3, "SAP", "SAP");
  217. IRC_SetIntData(botIDs[2], E_IRC_CONNECT_DELAY, 2);
  218.  
  219. botIDs[3] = IRC_Connect(IRCServer, IRCPort, IRCBot4, "SAP", "SAP");
  220. IRC_SetIntData(botIDs[3], E_IRC_CONNECT_DELAY, 2);
  221.  
  222. botIDs[4] = IRC_Connect(IRCServer, IRCPort, IRCBot5, "SAP", "SAP");
  223. IRC_SetIntData(botIDs[4], E_IRC_CONNECT_DELAY, 2);
  224.  
  225. botIDs[5] = IRC_Connect(IRCServer, IRCPort, IRCBot6, "SAP", "SAP");
  226. IRC_SetIntData(botIDs[5], E_IRC_CONNECT_DELAY, 2);
  227.  
  228. return 1;
  229. }
  230.  
  231. public OnPlayerRequestClass(playerid, classid)
  232. {
  233. if(IsLoggedIn[playerid] == 1)
  234. {
  235. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
  236. SpawnPlayer(playerid);
  237. }
  238. return 1;
  239. }
  240. public OnPlayerDisconnect(playerid, reason)
  241. {
  242. if(PlayerInfo[playerid][DMsg] != 0)
  243. {
  244. new querylist[512];
  245. format(querylist, sizeof(querylist),
  246. "UPDATE `accounts` SET `Kills` = '%d', `Deaths` = '%d',`Admin` = '%d', `VIP` = '%d', `Kicks` = '%d', `Bans` = '%d', `Deathmessage` = '%s' WHERE `name` = '%s'"
  247. , PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Level], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Kicks], PlayerInfo[playerid][Bans], PlayerInfo[playerid][DMsg], GetName(playerid));
  248. mysql_query(yadmin, querylist);
  249. }
  250. if(PlayerInfo[playerid][DMsg] == 0)
  251. {
  252. new querylist[512];
  253. format(querylist, sizeof(querylist),
  254. "UPDATE `accounts` SET `Kills` = '%d', `Deaths` = '%d', `Admin` = '%d', `VIP` = '%d', `Kicks` = '%d', `Bans` = '%d', `Deathmessage` = '0' WHERE `name` = '%s'"
  255. , PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Level], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Kicks], PlayerInfo[playerid][Bans], GetName(playerid));
  256. mysql_query(yadmin, querylist);
  257. }
  258. new querylistS[512];
  259. format(querylistS, sizeof(querylistS),"UPDATE `accounts_2` SET `Hours` = '%d', `Minutes` = '%d', `SkinID` = '%d' WHERE `name` = '%s'", PlayerInfo[playerid][Hours], PlayerInfo[playerid][Minutes], GetPlayerSkin(playerid), GetName(playerid));
  260. mysql_query(yadmin, querylistS);
  261. printf("[YAdmin]: Player %s(Id: %d) Account Saved !", GetName(playerid), playerid);
  262. return 1;
  263. }
  264.  
  265. public OnPlayerText(playerid, text[])
  266. {
  267. if(muted[playerid] == 1)
  268. {
  269. SendClientMessage(playerid, -1, ""R"You are Muted no one can hear you!");
  270. return 0;
  271. }
  272. if(text[0] == '#' && PlayerInfo[playerid][VIP] > 1)
  273. {
  274. new str[144];
  275. if(PlayerInfo[playerid][VIP] == 2)
  276. {
  277. format(str, sizeof(str), ""O"*VIP Golden(%s): "W"%s", GetName(playerid), text[1]);
  278. VSCM(str);
  279. format(str,sizeof(str),"07*VIP Golden(%s) : %s", GetName(playerid), text[1]);
  280. IRC_SendMessageToAdmins(1,str);
  281. return 0;
  282. }
  283. if(PlayerInfo[playerid][VIP] == 1)
  284. {
  285. format(str, sizeof(str), ""O"*VIP Silver(%s): "W"%s", GetName(playerid), text[1]);
  286. VSCM(str);
  287. format(str,sizeof(str),"07*VIP Golden(%s) : %s", GetName(playerid), text[1]);
  288. IRC_SendMessageToAdmins(1,str);
  289. return 0;
  290. }
  291. }
  292. if(text[0] == '@')
  293. {
  294. new stringX[150];
  295. if(PlayerInfo[playerid][Level] == 0)
  296. {
  297. format(stringX,sizeof(stringX),""YE"*Player(%s) ask for: "W"%s", GetName(playerid), text[1]);
  298. ASCM(stringX);
  299. SendClientMessage(playerid, -1, ""G"You Message Has Been Sended to the staff connected !");
  300. format(stringX,sizeof(stringX),"07*Player(%s) ask for: %s", GetName(playerid), text[1]);
  301. IRC_SendMessageToAdmins(2,stringX);
  302. return 0;
  303. }
  304. else if(PlayerInfo[playerid][Level] == 1)
  305. {
  306. format(stringX,sizeof(stringX),""YE"*Moderator(%s): "W"%s", GetName(playerid), text[1]);
  307. ASCM(stringX);
  308. format(stringX,sizeof(stringX),"07*Moderator(%s): %s", GetName(playerid), text[1]);
  309. IRC_SendMessageToAdmins(2,stringX);
  310. return 0;
  311. }
  312. else if(PlayerInfo[playerid][Level] == 2)
  313. {
  314. format(stringX,sizeof(stringX),""YE"*Admin(%s): "W"%s", GetName(playerid), text[1]);
  315. ASCM(stringX);
  316. format(stringX,sizeof(stringX),"07*Admin(%s): %s", GetName(playerid), text[1]);
  317. IRC_SendMessageToAdmins(2,stringX);
  318. return 0;
  319. }
  320. else if(PlayerInfo[playerid][Level] == 3)
  321. {
  322. format(stringX,sizeof(stringX),""YE"*Manager(%s): "W"%s", GetName(playerid), text[1]);
  323. ASCM(stringX);
  324. format(stringX,sizeof(stringX),"07*Manager(%s): %s", GetName(playerid), text[1]);
  325. IRC_SendMessageToAdmins(2,stringX);
  326. return 0;
  327. }
  328. else if(PlayerInfo[playerid][Level] == 4)
  329. {
  330. format(stringX,sizeof(stringX),""YE"*Mapper(%s): "W"%s", GetName(playerid), text[1]);
  331. ASCM(stringX);
  332. format(stringX,sizeof(stringX),"07*Mapper(%s): %s", GetName(playerid), text[1]);
  333. IRC_SendMessageToAdmins(2,stringX);
  334. return 0;
  335. }
  336. }
  337. if(GetPlayerVirtualWorld(playerid) != 0)
  338. {
  339. new stf[128];
  340. new stringig[128];
  341. format(stf, sizeof(stf), ""YE"[Virtual World %d] "W"[%d] %s: %s", GetPlayerVirtualWorld(playerid), playerid, GetName(playerid), text);
  342. ASCM(stf);
  343. format(stf, sizeof(stf), "[%d] %s: "W"%s", playerid, GetName(playerid), text);
  344. SendVirtualMessage(getPlayerworld, GetPlayerColor(playerid), stf);
  345. format(stringig,sizeof(stringig),"07[Virtual World %d] 02[%d] 07%s: %s",GetPlayerVirtualWorld(playerid), playerid, GetName(playerid),text);
  346. IRC_SendMessageToAdmins(1,stringig);
  347. return 0;
  348. }
  349. new stringig[128];
  350. new stf[128];
  351. format(stf, sizeof(stf), "[%d] %s: "W"%s", playerid, GetName(playerid), text);
  352. SendClientMessageToAll(GetPlayerColor(playerid), stf);
  353. format(stringig,sizeof(stringig),"02[%d] 07%s: %s",playerid, GetName(playerid),text);
  354. IRC_Say(groupID, IRCChannel, stringig);
  355. return 0;
  356. }
  357.  
  358. public OnPlayerConnect(playerid)
  359. {
  360. InitFly(playerid);
  361. new IPx[16], Adminx[20], reason[50];
  362. GetPlayerIp(playerid, IPx, sizeof(IPx));
  363. new querys[128], Cache:results;
  364. format(querys, 128, "SELECT * FROM `banlist` WHERE `ip` = '%s'", IPx);
  365. results = mysql_query(yadmin, querys);
  366. new rowsK;
  367. cache_get_row_count(rowsK);
  368. if(rowsK)
  369. {
  370. cache_get_value_name(0, "Admin", Adminx);
  371. cache_get_value_name(0, "Reason", reason);
  372. new str[150];
  373. for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE,"");
  374. for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE,"");
  375. SendClientMessage(playerid, -1,""YE"You are Still Banned From "SERVNAME"");
  376. format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s", Adminx, reason );
  377. SendClientMessage(playerid, -1, str);
  378. SendClientMessage(playerid, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
  379. SetTimerEx("DelayKick", 1000, false, "i", playerid);
  380. }
  381. cache_delete(results);
  382. new queryS[128];
  383. mysql_format(yadmin, queryS, sizeof(queryS), "SELECT `Password` FROM `accounts` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
  384. mysql_tquery(yadmin, queryS, "onMySQLCheck", "i", playerid);
  385. }
  386.  
  387. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  388. {
  389. switch(dialogid)
  390. {
  391. case Login:
  392. {
  393. static c, hash[129];
  394.  
  395. if(!response) Kick(playerid);
  396.  
  397. WP_Hash(hash, sizeof (hash), inputtext);
  398. if(!strcmp(hash, PlayerInfo[playerid][Password], true))
  399. {
  400. new query[150], Cache:S;
  401. mysql_format(yadmin, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%s' LIMIT 1", GetName(playerid));
  402. S = mysql_query(yadmin, query);
  403.  
  404. new rows;
  405. cache_get_row_count(rows);
  406. if(rows == 1)
  407. {
  408. cache_get_value_name_int(0, "Admin", PlayerInfo[playerid][Level]);
  409. cache_get_value_name_int(0, "VIP", PlayerInfo[playerid][VIP]);
  410. cache_get_value_name(0, "DeathMessage", PlayerInfo[playerid][DMsg], 50);
  411. cache_get_value_name_int(0, "Deaths", PlayerInfo[playerid][Deaths]);
  412. cache_get_value_name_int(0, "Kills", PlayerInfo[playerid][Kills]);
  413. cache_get_value_name_int(0, "Bans", PlayerInfo[playerid][Bans]);
  414. cache_get_value_name_int(0, "Kicks", PlayerInfo[playerid][Kicks]);
  415. cache_get_value_name_int(0, "Hours", PlayerInfo[playerid][Hours]);
  416. cache_get_value_name_int(0, "Minutes", PlayerInfo[playerid][Minutes]);
  417. cache_get_value_name_int(0, "SkinID", PlayerInfo[playerid][Skin]);
  418. }
  419. cache_delete(S);
  420. SendClientMessage(playerid, -1, "You have successfully logged in.");
  421. IsLoggedIn[playerid] = 1;
  422. cache_delete(S);
  423. }
  424. else
  425. {
  426. if(c == 3) return Kick(playerid);
  427. SendClientMessage(playerid, -1, "You have specified an incorrect password!");
  428. ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
  429. c++;
  430. }
  431. }
  432. case Register:
  433. {
  434. if(!response) return Kick(playerid);
  435. if(strlen(inputtext) < 5)
  436. {
  437. SendClientMessage(playerid, -1, "Your password must at least contain more than 4 characters.");
  438. return ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Register", "Welcome !\nYour account has not been registered yet. Please fill in your desired password:", "Register", "Quit");
  439. }
  440. new
  441. query[2024],
  442. playername[MAX_PLAYER_NAME],
  443. playerip[16];
  444.  
  445.  
  446. GetPlayerName(playerid, playername, sizeof(playername));
  447. GetPlayerIp(playerid, playerip, sizeof(playerip));
  448. mysql_format(yadmin, query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `IP`, `Admin`, `VIP`, `Money`, `Deaths`, `Kills`, `Bans`, `Kicks`, `Deathmessage`, `Car`) VALUES ('%s', '%s', '%s', '0', '0', '0', '0', '0', '0', '0', '0', '0')", playername, inputtext, playerip);
  449. mysql_query(yadmin, query);
  450. mysql_format(yadmin, query, sizeof(query), "INSERT INTO `accounts_2` (`Name`, `Hours`, `Minutes`, `SkinID`, `Reaction`) VALUES('%s', '0', '0', '0', '0')", GetName(playerid));
  451. mysql_query(yadmin, query);
  452. }
  453. case DIALOG_FEATURES:
  454. {
  455. if(response)
  456. {
  457. switch(listitem)
  458. {
  459. case 0:
  460. {
  461. ShowPlayerDialog(playerid, DIALOG_FEATURES+1, DIALOG_STYLE_LIST, "Boost Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
  462. }
  463. case 1:
  464. {
  465. ShowPlayerDialog(playerid, DIALOG_FEATURES+500, DIALOG_STYLE_LIST, "Fly Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
  466. }
  467. case 2:
  468. {
  469. ShowPlayerDialog(playerid, DIALOG_FEATURES+301, DIALOG_STYLE_LIST, "Ramping Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
  470. }
  471. case 3:
  472. {
  473. ShowPlayerDialog(playerid, DIALOG_FEATURES+302, DIALOG_STYLE_LIST, "Admin Ramp Feature", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
  474. }
  475. case 4:
  476. {
  477. ShowPlayerDialog(playerid, DIALOG_FEATURES+305, DIALOG_STYLE_LIST, "Animals Cars", "Enable it to all players \nDisable it to all players \nEnable it for one player", "Select", "Cancel");
  478. }
  479. }
  480. return 1;
  481. }
  482. }
  483. case DIALOG_CONSOLE:
  484. {
  485. if(response)
  486. {
  487. switch(listitem)
  488. {
  489. case 0:
  490. {
  491. new str[150];
  492. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) ShutDown The Server from the console", GetName(playerid), playerid);
  493. ASCM(str);
  494. SendClientMessageToAll(COLOR_BLUE, "*Console Applications : Please Save You'r Stats The server will shutdown in 10 sec");
  495. SetTimer("stopserver", 10000, false);
  496. }
  497. case 1:
  498. {
  499. new str[150];
  500. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Restarted The Server from the console", GetName(playerid), playerid);
  501. ASCM(str);
  502. SendClientMessageToAll(COLOR_BLUE, "*Console Applications : Please Save You'r Stats The server will Restart in 10 sec");
  503. SetTimer("restartserver", 10000, false);
  504. }
  505. case 2:
  506. {
  507. ShowPlayerDialog(playerid, DIALOG_HOSTNAME, DIALOG_STYLE_INPUT, "Change The HostName", "Please enter The New Host Name", "Done", "Cancel");
  508. }
  509. case 3:
  510. {
  511. ShowPlayerDialog(playerid, DIALOG_GMTEXT, DIALOG_STYLE_INPUT, "Change The GameMode Text", "Please enter The New GMText", "Done", "Cancel");
  512. }
  513. case 4:
  514. {
  515. for(new car = 1; car <= 2000; car++)
  516. {
  517. SetVehicleToRespawn(car);
  518. }
  519. SendClientMessage(playerid, COLOR_BLUE, "*Console Applications : All cars are respawned !");
  520. }
  521. case 5:
  522. {
  523. ShowPlayerDialog(playerid, DIALOG_FS, DIALOG_STYLE_LIST, "FilterScripts Settings", "Load FS \nUnLoad FS \nRe-Load FS", "Select", "Cancel");
  524. }
  525. }
  526. return 1;
  527. }
  528. }
  529. case DIALOG_FS:
  530. {
  531. if(response)
  532. {
  533. switch(listitem)
  534. {
  535. case 0:
  536. {
  537. ShowPlayerDialog(playerid, DIALOG_FS+10000, DIALOG_STYLE_INPUT, "load FS", "Please enter The FS File Name", "Done", "Cancel");
  538. }
  539. case 1:
  540. {
  541. ShowPlayerDialog(playerid, DIALOG_FS+290, DIALOG_STYLE_INPUT, "unload FS", "Please enter The FS File Name", "Done", "Cancel");
  542. }
  543. case 2:
  544. {
  545. ShowPlayerDialog(playerid, DIALOG_FS+1145, DIALOG_STYLE_INPUT, "reload FS", "Please enter The FS File Name", "Done", "Cancel");
  546. }
  547. }
  548. }
  549. }
  550. case DIALOG_FEATURES+1:
  551. {
  552. switch(listitem)
  553. {
  554. case 0:
  555. {
  556. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/boost` Exception!");
  557. new str[150];
  558. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Boost Exception to All Players", GetName(playerid), playerid);
  559. MSCM(str);
  560. foreach(new i: Player)
  561. {
  562. VehicleBoost[i] = 1;
  563. }
  564. }
  565. case 1:
  566. {
  567. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/boost` Exception From all players !");
  568. new str[150];
  569. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Boost Exception to All Players", GetName(playerid), playerid);
  570. MSCM(str);
  571. foreach(new i: Player)
  572. {
  573. VehicleBoost[i] = 0;
  574. }
  575. }
  576. case 2:
  577. {
  578. ShowPlayerDialog(playerid, DIALOG_FEATURES+50, DIALOG_STYLE_INPUT, "Boost Exception", "Please enter The PlayerID", "Done", "Cancel");
  579. }
  580. }
  581. }
  582. case EDITOBJ_DIALOG:
  583. {
  584. if(response)
  585. {
  586. if(!strlen(inputtext)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter the ID");
  587. myzobject = strval(inputtext);
  588. if(IsValidObject(myzobject)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Object");
  589. ShowPlayerDialog(playerid, EDITOBJ_DIALOG+1, DIALOG_STYLE_INPUT, "Enter Text", "Enter Text\nFor Colour use:\n {FF0000}{ FF0000 } - Red\n{00FF00}{ 00FF00 } - Green\n{FF9933}{ FF9933 } - Orange\n{00FF33}{ 00FF33 } - Lime Green\n{33FFFF}{ 33FFFF } - Cyan\n{FF66CC}{ FF66CC }Pink\n", "Enter", "Cancel");
  590.  
  591. }
  592. }
  593. case EDITOBJ_DIALOG+1:
  594. {
  595. if(response)
  596. {
  597. new Float:X, Float:Y, Float:Z, Float:Ang, str[100];
  598. GetPlayerFacingAngle(playerid, Ang);
  599. GetPlayerPos(playerid, X, Y, Z);
  600. if(!strlen(inputtext)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter the some text");
  601. new myrobject = CreateDynamicObject(myzobject, X+3, Y, Z+1, 0.0, 0.0, Ang); //create the object
  602.  
  603. SetDynamicObjectMaterialText(myrobject, 0, inputtext, OBJECT_MATERIAL_SIZE_256x128, "Arial", 28, 1, COLOR_RED, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  604. format(str, sizeof(str), "The Object is been created with ID %d", myrobject); //-> The number is 42.
  605. SendClientMessage(playerid, COLOR_RED, str);
  606. }
  607. }
  608. case DIALOG_FEATURES+50:
  609. {
  610. if(response)
  611. {
  612. new str[150], id;
  613. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  614. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Boost Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(id), id);
  615. MSCM(str);
  616. SendClientMessage(id,COLOR_BLUE, "*An Management Connected Has Enabled `/boost` Exception To you!");
  617. VehicleBoost[id] = 1;
  618. }
  619. }
  620. case DIALOG_FEATURES+500:
  621. {
  622. switch(listitem)
  623. {
  624. case 0:
  625. {
  626. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/fly` Exception!");
  627. new str[150];
  628. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Fly Exception to All Players", GetName(playerid), playerid);
  629. MSCM(str);
  630. foreach(new i: Player)
  631. {
  632. Enabled[i] = 1;
  633. }
  634. }
  635. case 1:
  636. {
  637. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/fly` Exception From all players !");
  638. new str[150];
  639. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Fly Exception to All Players", GetName(playerid), playerid);
  640. MSCM(str);
  641. foreach(new i: Player)
  642. {
  643. Enabled[i] = 0;
  644. StopFly(i);
  645. }
  646. }
  647. case 2:
  648. {
  649. ShowPlayerDialog(playerid, DIALOG_FEATURES+52, DIALOG_STYLE_INPUT, "Fly Exception", "Please enter The PlayerID", "Done", "Cancel");
  650. }
  651. }
  652. }
  653. case DIALOG_FEATURES+52:
  654. {
  655. if(response)
  656. {
  657. new str[150], id;
  658. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  659. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Fly Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(id), id);
  660. MSCM(str);
  661. SendClientMessage(id,COLOR_BLUE, "*An Management Connected Has Enabled `/fly` Exception To you!");
  662. Enabled[id] = 1;
  663. }
  664. }
  665. case DIALOG_FEATURES+301:
  666. {
  667. switch(listitem)
  668. {
  669. case 0:
  670. {
  671. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `Ramping (Ctrl)` Exception!");
  672. new str[150];
  673. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Ramping Exception to All Players", GetName(playerid), playerid);
  674. MSCM(str);
  675. foreach(new i: Player)
  676. {
  677. REnabled[i] = 1;
  678. }
  679. }
  680. case 1:
  681. {
  682. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `Ramping (Ctrl)` Exception From all players !");
  683. new str[150];
  684. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled Ramping Exception to All Players", GetName(playerid), playerid);
  685. MSCM(str);
  686. foreach(new i: Player)
  687. {
  688. REnabled[i] = 0;
  689. }
  690. }
  691. case 2:
  692. {
  693. ShowPlayerDialog(playerid, DIALOG_FEATURES+300+50, DIALOG_STYLE_INPUT, "Ramping Exception", "Please enter The PlayerID", "Done", "Cancel");
  694. }
  695. }
  696. }
  697. case DIALOG_FEATURES+302:
  698. {
  699. switch(listitem)
  700. {
  701. case 0:
  702. {
  703. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/aramp` Exception!");
  704. new str[150];
  705. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /aramp Exception to All Players", GetName(playerid), playerid);
  706. MSCM(str);
  707. foreach(new i: Player)
  708. {
  709. AREnabled[i] = 1;
  710. }
  711. }
  712. case 1:
  713. {
  714. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/aramp` Exception From all players !");
  715. new str[150];
  716. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled /aramp Exception to All Players", GetName(playerid), playerid);
  717. MSCM(str);
  718. foreach(new i: Player)
  719. {
  720. AREnabled[i] = 0;
  721. }
  722. }
  723. case 2:
  724. {
  725. ShowPlayerDialog(playerid, DIALOG_FEATURES+303, DIALOG_STYLE_INPUT, "Admin Ramp Exception", "Please enter The PlayerID", "Done", "Cancel");
  726. }
  727. }
  728. }
  729. case DIALOG_FEATURES+304:
  730. {
  731. if(response)
  732. {
  733. new str[150];
  734. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  735. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /aramp Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
  736. MSCM(str);
  737. SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `/aramp` Exception To you!");
  738. Enabled[strval(inputtext)] = 1;
  739. }
  740. }
  741. case DIALOG_ANIMALSCARS:
  742. {
  743. if (!response) return 1;
  744.  
  745. switch(listitem)
  746. {
  747. case 0:
  748. {
  749. new int1 = GetPlayerInterior(playerid);
  750. new Float: x, Float: y, Float: z, Float: r, deer;
  751. GetPlayerPos(playerid,x,y,z);
  752. GetPlayerFacingAngle(playerid,r);
  753. deer = CreateVehicle(522,x,y,z,r,000,000,0);
  754. PutPlayerInVehicle(playerid,deer,0);
  755. LinkVehicleToInterior(GetPlayerVehicleID(playerid),int1+1);
  756. objectid2[0] = CreateObject(19315,0,0,0,0,0,0);
  757. vehicleid2[0] = GetPlayerVehicleID(playerid);
  758. AttachObjectToVehicle(objectid2[0], vehicleid2[0], 0.0, 0.0, 0.0, 0.0, 0.0, 90.0);
  759. }
  760. case 1:
  761. {
  762. new int2 = GetPlayerInterior(playerid);
  763. new Float: x, Float: y, Float: z, Float: r, turtle;
  764. GetPlayerPos(playerid,x,y,z);
  765. GetPlayerFacingAngle(playerid,r);
  766. turtle = CreateVehicle(571,x,y,z,r,000,000,0);
  767. PutPlayerInVehicle(playerid,turtle,0);
  768. LinkVehicleToInterior(GetPlayerVehicleID(playerid),int2+1);
  769. objectid2[1] = CreateObject(1609,0,0,0,0,0,0);
  770. vehicleid2[1] = GetPlayerVehicleID(playerid);
  771. AttachObjectToVehicle(objectid2[1], vehicleid2[1], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  772. }
  773. case 2:
  774. {
  775. new int3 = GetPlayerInterior(playerid);
  776. new Float: x, Float: y, Float: z, Float: r, cow;
  777. GetPlayerPos(playerid,x,y,z);
  778. GetPlayerFacingAngle(playerid,r);
  779. cow = CreateVehicle(573,x,y,z,r,000,000,0);
  780. PutPlayerInVehicle(playerid,cow,0);
  781. LinkVehicleToInterior(GetPlayerVehicleID(playerid),int3+1);
  782. objectid2[2] = CreateObject(16442,0,0,0,0,0,0);
  783. vehicleid2[2] = GetPlayerVehicleID(playerid);
  784. AttachObjectToVehicle(objectid2[2], vehicleid2[2], 0.0, 0.0, 0.5, 0.0, 0.0, 90.0);
  785. }
  786. }
  787. return 1;
  788. }
  789. case DIALOG_FEATURES+305:
  790. {
  791. switch(listitem)
  792. {
  793. case 0:
  794. {
  795. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Garanted to all players a `/animalscars` Exception!");
  796. new str[150];
  797. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /animalscars Exception to All Players", GetName(playerid), playerid);
  798. MSCM(str);
  799. foreach(new i: Player)
  800. {
  801. Animal[i] = 1;
  802. }
  803. }
  804. case 1:
  805. {
  806. SendClientMessageToAll(COLOR_BLUE, "*An Management Connected Has Removed `/animalscars` Exception From all players !");
  807. new str[150];
  808. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Disabled /animalscars Exception to All Players", GetName(playerid), playerid);
  809. MSCM(str);
  810. foreach(new i: Player)
  811. {
  812. Animal[i] = 0;
  813. }
  814. }
  815. case 2:
  816. {
  817. ShowPlayerDialog(playerid, DIALOG_FEATURES+306, DIALOG_STYLE_INPUT, "Animal Cars Exception", "Please enter The PlayerID", "Done", "Cancel");
  818. }
  819. }
  820. }
  821. case DIALOG_FEATURES+306:
  822. {
  823. if(response)
  824. {
  825. new str[150];
  826. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  827. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled /animalscars Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
  828. MSCM(str);
  829. SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `/animalscars` Exception To you!");
  830. Animal[strval(inputtext)] = 1;
  831. }
  832. }
  833. case DIALOG_FEATURES+300+50:
  834. {
  835. if(response)
  836. {
  837. new str[150], id;
  838. if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  839. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Enabled Ramping (Ctrl) Exception to `(Id: %d)`", GetName(playerid), playerid, GetName(strval(inputtext)), strval(inputtext));
  840. MSCM(str);
  841. SendClientMessage(strval(inputtext),COLOR_BLUE, "*An Management Connected Has Enabled `Ramping (Ctrl)` Exception To you!");
  842. Enabled[id] = 1;
  843. }
  844. }
  845. case DIALOG_HOSTNAME:
  846. {
  847. if(response)
  848. {
  849. new str[150];
  850. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Changed HostName To `%s`", GetName(playerid), playerid, inputtext);
  851. MSCM(str);
  852. new str2[50];
  853. format(str2, sizeof(str2), "hostname %s", inputtext);
  854. SendRconCommand(str2);
  855. }
  856. }
  857. case DIALOG_GMTEXT:
  858. {
  859. if(response)
  860. {
  861. new str[150];
  862. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Changed The Gamemode Text to `%s`", GetName(playerid), playerid, inputtext);
  863. MSCM(str);
  864. new str2[50];
  865. format(str, sizeof(str2), "gamemodetext %s", inputtext);
  866. SendRconCommand(str2);
  867. }
  868. }
  869. case DIALOG_FS+10000:
  870. {
  871. if(response)
  872. {
  873. new str[150];
  874. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Loaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
  875. MSCM(str);
  876. new str2[50];
  877. format(str, sizeof(str2), "loadfs %s", inputtext);
  878. SendRconCommand(str2);
  879. }
  880. }
  881. case DIALOG_FS+290:
  882. {
  883. if(response)
  884. {
  885. new str[150];
  886. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) UnLoaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
  887. MSCM(str);
  888. new str2[50];
  889. format(str, sizeof(str2), "unloadfs %s", inputtext);
  890. SendRconCommand(str2);
  891. }
  892. }
  893. case DIALOG_FS+1145:
  894. {
  895. if(response)
  896. {
  897. new str[150];
  898. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) ReLoaded a Filterscript `%s.amx`", GetName(playerid), playerid, inputtext);
  899. MSCM(str);
  900. new str2[50];
  901. format(str2, sizeof(str2), "reloadfs %s", inputtext);
  902. SendRconCommand(str2);
  903. }
  904. }
  905. }
  906. return 0;
  907. }
  908.  
  909. static Ztopic = 0;
  910.  
  911. public IRC_OnConnect(botid, ip[], port)
  912. {
  913. printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  914. // Join the channel
  915. IRC_JoinChannel(botid, IRCChannel);
  916. IRC_JoinChannel(botid, IRCChannel2);
  917.  
  918. // Add the bot to the group
  919. IRC_AddToGroup(groupID, botid);
  920. return 1;
  921. }
  922.  
  923. /*
  924. This callback is executed whenever a current connection is closed. The
  925. plugin may automatically attempt to reconnect per user settings. IRC_Quit
  926. may be called at any time to stop the reconnection process.
  927. */
  928.  
  929. public IRC_OnDisconnect(botid, ip[], port, reason[])
  930. {
  931. printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  932. // Remove the bot from the group
  933. IRC_RemoveFromGroup(groupID, botid);
  934. return 1;
  935. }
  936.  
  937. /*
  938. This callback is executed whenever a connection attempt begins. IRC_Quit may
  939. be called at any time to stop the reconnection process.
  940. */
  941.  
  942. public IRC_OnConnectAttempt(botid, ip[], port)
  943. {
  944. printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  945. return 1;
  946. }
  947.  
  948. /*
  949. This callback is executed whenever a connection attempt fails. IRC_Quit may
  950. be called at any time to stop the reconnection process.
  951. */
  952.  
  953. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  954. {
  955. printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  956. return 1;
  957. }
  958.  
  959. /*
  960. This callback is executed whenever a bot joins a channel.
  961. */
  962.  
  963. public IRC_OnJoinChannel(botid, channel[])
  964. {
  965. printf("*** IRC_OnJoinChannel: Bot ID %d joined channel %s", botid, channel);
  966.  
  967. if(Ztopic == 0)
  968. {
  969. Ztopic = 1;
  970. IRC_Say(botIDs[0], channel, "**4Global Gamemode Initialize");
  971. }
  972. return 1;
  973. }
  974.  
  975. /*
  976. This callback is executed whenevever a bot leaves a channel.
  977. */
  978.  
  979. public IRC_OnLeaveChannel(botid, channel[], message[])
  980. {
  981. printf("*** IRC_OnLeaveChannel: Bot ID %d left channel %s (%s)", botid, channel, message);
  982. return 1;
  983. }
  984.  
  985. /*
  986. This callback is executed whenevever a bot is invited to a channel.
  987. */
  988.  
  989. public IRC_OnInvitedToChannel(botid, channel[], invitinguser[], invitinghost[])
  990. {
  991. printf("*** IRC_OnInvitedToChannel: Bot ID %d invited to channel %s by %s (%s)", botid, channel, invitinguser, invitinghost);
  992. IRC_JoinChannel(botid, channel);
  993. IRC_Say(botid, channel, "**4Fuck you nigga, Don't try to hack our Bots !");
  994. IRC_PartChannel(botid, channel, ""SERVNAME" SA-MP IRC Bot !");
  995. return 1;
  996. }
  997.  
  998. /*
  999. This callback is executed whenevever a bot is kicked from a channel. If the
  1000. bot cannot immediately rejoin the channel (in the event, for example, that
  1001. the bot is kicked and then banned), you might want to set up a timer here
  1002. for rejoin attempts.
  1003. */
  1004.  
  1005. public IRC_OnKickedFromChannel(botid, channel[], oppeduser[], oppedhost[], message[])
  1006. {
  1007. printf("*** IRC_OnKickedFromChannel: Bot ID %d kicked by %s (%s) from channel %s (%s)", botid, oppeduser, oppedhost, channel, message);
  1008. IRC_JoinChannel(botid, channel);
  1009. return 1;
  1010. }
  1011.  
  1012. public IRC_OnUserDisconnect(botid, user[], host[], message[])
  1013. {
  1014. printf("*** IRC_OnUserDisconnect (Bot ID %d): User %s (%s) disconnected (%s)", botid, user, host, message);
  1015. return 1;
  1016. }
  1017.  
  1018. public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
  1019. {
  1020. printf("*** IRC_OnUserJoinChannel (Bot ID %d): User %s (%s) joined channel %s", botid, user, host, channel);
  1021. return 1;
  1022. }
  1023.  
  1024. public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
  1025. {
  1026. printf("*** IRC_OnUserLeaveChannel (Bot ID %d): User %s (%s) left channel %s (%s)", botid, user, host, channel, message);
  1027. return 1;
  1028. }
  1029.  
  1030. public IRC_OnUserKickedFromChannel(botid, channel[], kickeduser[], oppeduser[], oppedhost[], message[])
  1031. {
  1032. printf("*** IRC_OnUserKickedFromChannel (Bot ID %d): User %s kicked by %s (%s) from channel %s (%s)", botid, kickeduser, oppeduser, oppedhost, channel, message);
  1033. }
  1034.  
  1035. public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
  1036. {
  1037. printf("*** IRC_OnUserNickChange (Bot ID %d): User %s (%s) changed his/her nick to %s", botid, oldnick, host, newnick);
  1038. return 1;
  1039. }
  1040. public IRC_OnUserSetChannelTopic(botid, channel[], user[], host[], topic[])
  1041. {
  1042. printf("*** IRC_OnUserSetChannelTopic (Bot ID %d): User %s (%s) on %s set topic: %s", botid, user, host, channel, topic);
  1043. return 1;
  1044. }
  1045.  
  1046. public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
  1047. {
  1048. printf("*** IRC_OnUserSay (Bot ID %d): User %s (%s) sent message to %s: %s", botid, user, host, recipient, message);
  1049. if (!strcmp(recipient, IRCChannel) || !strcmp(recipient, IRCChannel2))
  1050. {
  1051. if(!strcmp(message, ".credits"))
  1052. {
  1053. IRC_Say(botIDs[0], IRCChannel, "----- Credits -----");
  1054. IRC_Say(botIDs[0], IRCChannel, "Yassine - Scripter");
  1055. IRC_Say(botIDs[0], IRCChannel, "------------------");
  1056. }
  1057. if(!strcmp(message, ".stats"))
  1058. {
  1059. IRC_Say(botIDs[0], IRCChannel, "Server Running on SAMP 0.3.7 R2-1 using Linux Server");
  1060. }
  1061. if(!strcmp(message, ".ping"))
  1062. {
  1063. IRC_Say(botIDs[0], IRCChannel, "pong");
  1064. }
  1065. if(!strcmp(message, ".Yassine"))
  1066. {
  1067. IRC_Say(botIDs[0], IRCChannel, "Yassine is awesome !");
  1068. }
  1069. if(!strcmp(message, ".cmode") && IRC_IsOwner(botid, IRCChannel, user))
  1070. {
  1071. IRC_SetMode(botIDs[0], IRCChannel, "+m");
  1072. }
  1073. if(!strcmp(message, ".cdemode") && IRC_IsOwner(botid, IRCChannel, user))
  1074. {
  1075. IRC_SetMode(botIDs[0], IRCChannel, "-m");
  1076. }
  1077. if(!strcmp(message, ".cmds"))
  1078. {
  1079. IRC_Say(botIDs[0], IRCChannel, ".Yassine ping .hold .cmode .cdemode .stats .owners");
  1080. }
  1081. }
  1082. return 1;
  1083. }
  1084.  
  1085. public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
  1086. {
  1087. printf("*** IRC_OnUserNotice (Bot ID %d): User %s (%s) sent notice to %s: %s", botid, user, host, recipient, message);
  1088. // Someone sent the bot a notice (probably a network service)
  1089. return 1;
  1090. }
  1091.  
  1092. public IRC_OnUserRequestCTCP(botid, user[], host[], message[])
  1093. {
  1094. printf("*** IRC_OnUserRequestCTCP (Bot ID %d): User %s (%s) sent CTCP request: %s", botid, user, host, message);
  1095. // Someone sent a CTCP VERSION request
  1096. if (!strcmp(message, "VERSION"))
  1097. {
  1098. IRC_ReplyCTCP(botid, user, "VERSION SA-MP IRC Plugin v" #PLUGIN_VERSION "");
  1099. }
  1100. return 1;
  1101. }
  1102.  
  1103. public IRC_OnUserReplyCTCP(botid, user[], host[], message[])
  1104. {
  1105. printf("*** IRC_OnUserReplyCTCP (Bot ID %d): User %s (%s) sent CTCP reply: %s", botid, user, host, message);
  1106. return 1;
  1107. }
  1108.  
  1109. public IRC_OnReceiveRaw(botid, message[])
  1110. {
  1111. new File:file;
  1112. if (!fexist("irc_log.txt"))
  1113. {
  1114. file = fopen("irc_log.txt", io_write);
  1115. }
  1116. else
  1117. {
  1118. file = fopen("irc_log.txt", io_append);
  1119. }
  1120. if (file)
  1121. {
  1122. fwrite(file, message);
  1123. fwrite(file, "\r\n");
  1124. fclose(file);
  1125. }
  1126. return 1;
  1127. }
  1128.  
  1129. CMD:createmapicon(playerid, params[])
  1130. {
  1131. if(PlayerInfo[playerid][Level] == 4)
  1132. {
  1133. new mapiconid;
  1134. if(sscanf(params, "i", mapiconid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /createmapicon [id]" );
  1135. new Float: X, Float:Y, Float:Z;
  1136. GetPlayerPos( playerid, X, Y, Z );
  1137. SetPlayerMapIcon( playerid, 20, X, Y, Z, mapiconid, 0, MAPICON_LOCAL );
  1138. }
  1139. else return 0;
  1140. return 1;
  1141. }
  1142.  
  1143. CMD:createobj(playerid, params[])
  1144. {
  1145. if(PlayerInfo[playerid][Level] == 4)
  1146. {
  1147. new Float:X, Float:Y, Float:Z;
  1148. new myobject;
  1149. new object;
  1150. GetPlayerPos(playerid, X, Y, Z);
  1151. GetXYInFrontOfPlayer(playerid, Float:X,Float:Y, 2.5);
  1152. if(sscanf(params,"d",object)) return SendClientMessage(playerid,COLOR_RED,"۠USAGE:/createobj [object ID]");
  1153. myobject = CreatePlayerObject(playerid, object, X, Y, Z, 0.0, 0.0, 0.0,0);
  1154. EditObject(playerid, myobject);
  1155. SendClientMessage(playerid,COLOR_PURPLE,"Object Created!");
  1156. }
  1157. else return 0;
  1158. return 1;
  1159. }
  1160.  
  1161. CMD:v(playerid, params[])
  1162. {
  1163. new vehid;
  1164. if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, -1, ""R"USAGE: /v [carid]");
  1165. else if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid car id! [ Car ID's range from 400 - 611 ]");
  1166. new Float:x, Float:y, Float:z, Float:Angle;
  1167. GetPlayerPos(playerid, x, y, z);
  1168. GetPlayerFacingAngle(playerid, Angle);
  1169. vCar[playerid] = CreateVehicle(vehid, x, y, z, Angle, -1, -1, 60);
  1170. PutPlayerInVehicle(playerid, vCar[playerid], 0);
  1171. SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
  1172. new str[150];
  1173. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has Just spawned Car Id: %d at her/his location", GetName(playerid), playerid, vehid);
  1174. ASCM(str);
  1175. return 1;
  1176. }
  1177.  
  1178. CMD:acmds(playerid, params[])
  1179. {
  1180. new DIALOG[3500];
  1181. if(PlayerInfo[playerid][Level] == 0)
  1182. {
  1183. strcat(DIALOG, ""YE"Sorry, You are unable to see administrators commands\n\n");
  1184. }
  1185. if(PlayerInfo[playerid][Level] >= 1)
  1186. {
  1187. strcat(DIALOG, ""YE"Moderators Commands\n\n");
  1188. strcat(DIALOG, ""W"/startevent /toggleevent /destroyevent /stp /fetch /slap /kick /jail /unjail \n");
  1189. strcat(DIALOG, ""W"/freeze /botsay /unfreeze /watch /unwatch /mute /unmute\n");
  1190. strcat(DIALOG, ""W"/announce /showmessage /createtext /deletetext /edittext\n");
  1191. strcat(DIALOG, ""W"/fix /clearchat /rpweapons /asay /v /changename\n");
  1192. strcat(DIALOG, ""O"Set Feature : /set[weather/time/armour/health/skin]\n\n");
  1193. }
  1194. if(PlayerInfo[playerid][Level] >= 2)
  1195. {
  1196. strcat(DIALOG, ""YE"Administrators Commands\n\n");
  1197. strcat(DIALOG, ""W"/startevent /toggleevent /destroyevent /stp /fetch /slap /nuke /ban /unban \n");
  1198. strcat(DIALOG, ""W"/freeze /botsay /unfreeze /watch /unwatch/kick /cage /uncage /jail /unjail /giveweapon /giveallweapon \n");
  1199. strcat(DIALOG, ""W"/givegod /takegod /givemoderator /takemoderator /announce /showmessage /mute /unmute\n");
  1200. strcat(DIALOG, ""W"/fix /clearchat /givecash /rpweapons /asay /v /irckick /changename /createtext /deletetext /edittext\n");
  1201. strcat(DIALOG, ""O"Set Feature : "W"/set[weather/time/armour/health/skin]\n\n");
  1202. }
  1203. if(PlayerInfo[playerid][Level] >= 3)
  1204. {
  1205. strcat(DIALOG, ""G"Management Commands\n\n");
  1206. strcat(DIALOG, ""R"- All Admins Commands\n");
  1207. strcat(DIALOG, ""R"/fakechat /removeacc /ocar \n");
  1208. strcat(DIALOG, ""O"Property Feature: "W"/propertyhelp\n");
  1209. strcat(DIALOG, ""O"Server Feature : /server [Console / Features]\n");
  1210. }
  1211. if(PlayerInfo[playerid][Level] == 4)
  1212. {
  1213. strcat(DIALOG, ""G"Mapper Commands\n\n");
  1214. strcat(DIALOG, ""R"- All Admins Commands\n");
  1215. strcat(DIALOG, ""R"- All Managers Commands (/setlevel not include)\n");
  1216. strcat(DIALOG, ""O"Mapping Features: "W"/creatobj /createmapicon\n");
  1217. strcat(DIALOG, ""O"Set Feature : /set[weather/time/armour/health/skin/gravity/maptp]\n");
  1218. strcat(DIALOG, ""O"Server Feature : /server [Console / Features]\n");
  1219. }
  1220. strcat(DIALOG, ""O"Admin Chat : @ [Text]\n");
  1221. ShowPlayerDialog(playerid, 554989, DIALOG_STYLE_MSGBOX, "Admin Commands", DIALOG, "Close", "");
  1222. return 1;
  1223. }
  1224.  
  1225. CMD:mystats(playerid, params[])
  1226. {
  1227. new level[150];
  1228. if(PlayerInfo[playerid][Level] == 0 && PlayerInfo[playerid][VIP] == 0)
  1229. {
  1230. level = "Regular Player";
  1231. }
  1232. else if(PlayerInfo[playerid][Level] == 1)
  1233. {
  1234. level = ""SERVNAME" Moderator";
  1235. }
  1236. else if(PlayerInfo[playerid][Level] == 2)
  1237. {
  1238. level = ""SERVNAME" Administrator";
  1239. }
  1240. else if(PlayerInfo[playerid][Level] == 3)
  1241. {
  1242. level = ""SERVNAME" Management";
  1243. }
  1244. else if(PlayerInfo[playerid][Level] == 4)
  1245. {
  1246. level = ""SERVNAME" Mapper";
  1247. }
  1248. else if(PlayerInfo[playerid][VIP] >= 1)
  1249. {
  1250. level = "Very Important Player";
  1251. }
  1252. new str[2048];
  1253. format(str, sizeof(str), ""W"Name: "YE"%s\n", GetName(playerid));
  1254. format(str, sizeof(str), "%s"W"Hours in game : "YE"%d hours %d Minutes\n",str, PlayerInfo[playerid][Hours], PlayerInfo[playerid][Minutes]);
  1255. format(str, sizeof(str), "%s"W"Level : "YE"%s\n", str, level);
  1256. format(str, sizeof(str), "%s"W"Kills(Count Of Victims) : "YE"%d\n",str, PlayerInfo[playerid][Kills]);
  1257. format(str, sizeof(str), "%s"W"Deaths: "YE"%d\n",str, PlayerInfo[playerid][Deaths]);
  1258. format(str, sizeof(str), "%s"W"Kicks(Count of Kicks): "YE"%d\n",str, PlayerInfo[playerid][Kicks]);
  1259. format(str, sizeof(str), "%s"W"Bans(Count of Bans): "YE"%d\n",str, PlayerInfo[playerid][Bans]);
  1260. format(str, sizeof(str), "%s"W"DeathMessage: "YE"%d\n",str, PlayerInfo[playerid][DMsg]);
  1261. strcat(str, ""YE"You can see Stats of others players too ! How ? use /getstats or click player on TAB Dialog.\n");
  1262. ShowPlayerDialog(playerid, 554985, DIALOG_STYLE_MSGBOX, "Player Stats", str, "Close", "");
  1263. return 1;
  1264. }
  1265.  
  1266. CMD:stp(playerid, params[])
  1267. {
  1268. if(PlayerInfo[playerid][Level] >=1)
  1269. {
  1270. new id;
  1271. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /stp [playerid]");
  1272. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1273. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot teleport to yourslef! ");
  1274. new Float:x, Float:y, Float:z;
  1275. GetPlayerPos(id, x, y, z);
  1276. SetPlayerPos(playerid, x, y+0.3, z);
  1277. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  1278. new str[150];
  1279. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been secretly teleported to %s (Id: %d) in world %d", GetName(playerid), playerid, GetName(id), id, GetPlayerVirtualWorld(id));
  1280. ASCM(str);
  1281. }
  1282. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1283. return 1;
  1284. }
  1285. CMD:vr(playerid, params[])
  1286. {
  1287. if(PlayerInfo[playerid][Level] >=1)
  1288. {
  1289. RepairVehicle(playerid);
  1290. return 1;
  1291. }
  1292. else
  1293. return 0;
  1294. }
  1295. CMD:irckick(playerid, params[])
  1296. {
  1297. if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Error, This Command can be used just by Admins");
  1298. new user[44], reason[50], str4[300];
  1299. if(sscanf(params, "ss[94]", user, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /irckick [user] [reason]");
  1300. {
  1301. IRC_KickUser(botIDs[0],IRCChannel, user, reason);
  1302. format(str4, sizeof(str4), ""YE"*Admin Notice: "W"User"YE"[IRC]%s "W"has been kicked from echo channel by "YE"%s (Id: %d) for : %s", user, GetName(playerid), playerid, reason);
  1303. ASCM(str4);
  1304. }
  1305. return 1;
  1306. }
  1307. CMD:pm(playerid, params[])
  1308. {
  1309. new str[700], str2[256], str3[700], str4[800], id;
  1310. if(sscanf(params, "us", id, str2)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm [playerid] [message]");
  1311. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  1312. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
  1313. if(BlockPm[id] == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: this player disabled pm's atm !");
  1314. {
  1315. format(str, sizeof(str), ""YE"*PM To %s(ID %d): %s", GetName(id), id, str2);
  1316. SendClientMessage(playerid, 0xFF0000FF, str);
  1317. format(str3, sizeof(str3), ""YE"*PM From %s(ID %d): %s", GetName(playerid), playerid, str2);
  1318. SendClientMessage(id, 0xFF0000FF, str3);
  1319. format(str4, sizeof(str4), ""YE"*Admin Notice: "W"Private Message From "YE"%s (Id: %d) "W"To "YE"%s "W"(Id : %d): "G"%s", GetName(playerid), playerid, GetName(id), id, str2);
  1320. ASCM(str4);
  1321. format(str4,sizeof(str4),"*Admin Notice: Private Message From %s (Id: %d) To %s (Id : %d) : %s", GetName(playerid), playerid, GetName(id), id, str2);
  1322. IRC_SendMessageToAdmins(2, str4);
  1323. }
  1324. return 1;
  1325. }
  1326.  
  1327. CMD:fetch(playerid, params[])
  1328. {
  1329. if(PlayerInfo[playerid][Level] >=1)
  1330. {
  1331. new id;
  1332. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /fetch [playerid]");
  1333. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1334. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot fetch yourslef! ");
  1335. new Float:x, Float:y, Float:z;
  1336. GetPlayerPos(playerid, x, y, z);
  1337. SetPlayerPos(id, x, y+0.3, z);
  1338. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  1339. new str[150];
  1340. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been fetched to %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1341. ASCM(str);
  1342. format(str,sizeof(str),"*Admin Notice: %s (Id: %d) Has been fetched to %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1343. IRC_SendMessageToAdmins(2,str);
  1344. }
  1345. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1346. return 1;
  1347. }
  1348.  
  1349. CMD:slap(playerid, params[])
  1350. {
  1351. if(PlayerInfo[playerid][Level] >=1)
  1352. {
  1353. new id;
  1354. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /slap [playerid]");
  1355. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1356. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot slap yourslef! ");
  1357. new Float:x, Float:y, Float:z;
  1358. GetPlayerPos(id, x, y, z);
  1359. SetPlayerPos(id, x, y, z+5);
  1360. new str[150];
  1361. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Slapped by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1362. ASCM(str);
  1363. }
  1364. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1365. return 1;
  1366. }
  1367.  
  1368. CMD:cage(playerid, params[])
  1369. {
  1370. if(PlayerInfo[playerid][Level] >=2)
  1371. {
  1372. new id;
  1373. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /cage [playerid]");
  1374. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1375. SetPlayerWorldBounds(id, 20.0, 0.0, 20.0, 0.0);
  1376. new str[150];
  1377. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Caged by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1378. ASCM(str);
  1379. }
  1380. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1381. return 1;
  1382. }
  1383.  
  1384. CMD:fakechat(playerid, params[])
  1385. {
  1386. if(PlayerInfo[playerid][Level] >= 3)
  1387. {
  1388. new id, text[50];
  1389. if(sscanf(params,"is[50]",id, text)) return SendClientMessage(playerid, -1,""R"USAGE: /fakechat [playerid] [text]");
  1390. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1391. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot troll yourslef! ");
  1392. SendPlayerMessageToAll(id, text);
  1393. new str[200];
  1394. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been trolled by %s (Id: %d) in world %d Using /fakechat", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1395. ASCM(str);
  1396. }
  1397. else return SendClientMessage(playerid, -1, "Error: You are not an Manager!");
  1398. return 1;
  1399. }
  1400.  
  1401. CMD:uncage(playerid, params[])
  1402. {
  1403. if(PlayerInfo[playerid][Level] >=2)
  1404. {
  1405. new id;
  1406. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /cage [playerid]");
  1407. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1408. SetPlayerWorldBounds(id, 20000.0000, -20000.0000, 20000.0000, -20000.0000);
  1409. new str[150];
  1410. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been unCaged by %s (Id: %d) in world %d", GetName(id), id, GetName(playerid), playerid, GetPlayerVirtualWorld(playerid));
  1411. ASCM(str);
  1412. }
  1413. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1414. return 1;
  1415. }
  1416.  
  1417. CMD:boost(playerid, params[])
  1418. {
  1419. if(VehicleBoost[playerid] == 1 || PlayerInfo[playerid][Level] >= 3)
  1420. {
  1421. new id;
  1422. if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /boost [playerid]");
  1423. new Float:x, Float:y, Float:z;
  1424. GetVehicleVelocity(GetPlayerVehicleID(id),x,y,z);
  1425. SetVehicleVelocity(GetPlayerVehicleID(id),x+0.9,y+0.9,z);
  1426. new str[150];
  1427. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Has been Boosted By %s (Id: %s)", GetName(id), id, GetName(playerid), playerid);
  1428. ASCM(str);
  1429. }
  1430. return 1;
  1431. }
  1432.  
  1433. CMD:aramp(playerid, params[])
  1434. {
  1435. if(AREnabled[playerid] == 0) return SendClientMessage(playerid, -1, "Sorry: This Command enabled just for trusted players!");
  1436. if(Type[playerid] == 16357) return SendClientMessage(playerid, -1, ""R"Error: "W"Admin ramp already enabled for you");
  1437. Type[playerid] = 16357;
  1438. SendClientMessage(playerid, -1, ""G"Success: "W"Admin ramp has been enabled for you");
  1439. return 1;
  1440. }
  1441.  
  1442. CMD:fly(playerid, params[])
  1443. {
  1444. if(Enabled[playerid] == 0) return SendClientMessage(playerid, -1, "Sorry: This Command enabled just for trusted players!");
  1445. if(Enabled[playerid] == 1 && IsFlying[playerid] == 1)
  1446. {
  1447. StopFly(playerid);
  1448. IsFlying[playerid] = 0;
  1449. }
  1450. else if(Enabled[playerid] == 1 && IsFlying[playerid] == 0)
  1451. {
  1452. if(OnFly[playerid]) return 0;
  1453. OnFly[playerid] = true;
  1454. new Float:x,Float:y,Float:z;
  1455. GetPlayerPos(playerid,x,y,z);
  1456. SetPlayerPos(playerid,x,y,z+5.0);
  1457. ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
  1458. Fly(playerid);
  1459.  
  1460. new str[150];
  1461. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s(Id: %d) Start Flying", GetName(playerid), playerid);
  1462. ASCM(str);
  1463. IsFlying[playerid] = 1;
  1464. }
  1465. return 1;
  1466. }
  1467.  
  1468. CMD:server(playerid,params[])
  1469. {
  1470. if(PlayerInfo[playerid][Level] >= 3)
  1471. {
  1472. if(!strcmp(params, "console", true))
  1473. {
  1474. return ShowPlayerDialog(playerid, DIALOG_CONSOLE, DIALOG_STYLE_LIST, "Console", "Stop The Server\nRestart The Server\nChange Host Name\nChange GameMode Text\nRespawn all cars\nFilterscripts Settings", "Select", "Cancel");
  1475. }
  1476. if(!strcmp(params, "features", true))
  1477. {
  1478. return ShowPlayerDialog(playerid, DIALOG_FEATURES, DIALOG_STYLE_LIST, "Features", "Boost Feature \nFly Feature \nRamp Feature \nAdmin Ramp Feature \nAnimal Cars Features", "Select", "Cancel");
  1479. }
  1480. else return SendClientMessage(playerid, -1, ""R"/server [console/features]");
  1481. }
  1482. else return SendClientMessage(playerid, -1, ""R"Error: "W" You are not a manager!");
  1483. }
  1484.  
  1485. CMD:setweather(playerid,params[])
  1486. {
  1487. if(PlayerInfo[playerid][Level] >=1)
  1488. {
  1489. new weatherid;
  1490. if(sscanf(params,"i", weatherid)) return SendClientMessage(playerid, -1,""R"USAGE: /setweather [weatherid]");
  1491. new string[150];
  1492. format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Changed Weather to %d ", GetName(playerid), playerid, weatherid);
  1493. ASCM(string);
  1494. SetWeather(weatherid);
  1495. return 1;
  1496. }
  1497. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1498. }
  1499.  
  1500. CMD:setgravity(playerid, params[])
  1501. {
  1502. if(PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, -1,""R"Error: You aren't an Manager");
  1503. new Float:gravityid;
  1504. if(sscanf(params,"f", gravityid)) return SendClientMessage(playerid, -1,""R"USAGE: /setgravity [gravity float] (Default: 0.008)");
  1505. new string[150];
  1506. format(string,sizeof(string),""G"*Manager Notice: "W"%s (Id: %d) Changed Gravity to %s ", GetName(playerid), playerid, gravityid);
  1507. MSCM(string);
  1508. SetGravity(gravityid);
  1509. return 1;
  1510. }
  1511.  
  1512. CMD:settime(playerid, params[])
  1513. {
  1514. if(PlayerInfo[playerid][Level] >=1)
  1515. {
  1516. new time;
  1517. if(sscanf(params,"i", time)) return SendClientMessage(playerid, -1,""R"USAGE: /settime [Time]");
  1518. new string[150];
  1519. format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Changed Time to %d ", GetName(playerid), playerid, time);
  1520. ASCM(string);
  1521. SetWorldTime(time);
  1522. }
  1523. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1524. return 1;
  1525. }
  1526.  
  1527. CMD:setarmour(playerid, params[])
  1528. {
  1529. if(PlayerInfo[playerid][Level] >=1)
  1530. {
  1531. new id, armour;
  1532. if(sscanf(params,"ii", id, armour)) return SendClientMessage(playerid, -1, ""R"/setarmour [playerid] [armour]");
  1533. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1534. new string[150];
  1535. format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Armour to %d ", GetName(playerid), playerid, GetName(id), id, armour);
  1536. ASCM(string);
  1537. SetPlayerArmour(id, armour);
  1538. }
  1539. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1540. return 1;
  1541. }
  1542.  
  1543. CMD:setskin(playerid, params[])
  1544. {
  1545. if(PlayerInfo[playerid][Level] >=1)
  1546. {
  1547. new id, skinid;
  1548. if(sscanf(params,"ii", id, skinid)) return SendClientMessage(playerid, -1, ""R"/setskin [playerid] [skinid]");
  1549. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1550. if(skinid < 0 || skinid > 300) return SendClientMessage(playerid, -1, ""R"Error: Skinid Must be (0 < Skinid < 300)");
  1551. new string[150];
  1552. format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Skin to %d ", GetName(playerid), playerid, GetName(id), id, skinid);
  1553. ASCM(string);
  1554. SetPlayerSkin(id, skinid);
  1555. }
  1556. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1557. return 1;
  1558. }
  1559.  
  1560. CMD:sethealth(playerid, params[])
  1561. {
  1562. if(PlayerInfo[playerid][Level] >=1)
  1563. {
  1564. new id, health;
  1565. if(sscanf(params,"ii", id, health)) return SendClientMessage(playerid, -1, ""R"/sethealth [playerid] [Health]");
  1566. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1567. new string[150];
  1568. format(string,sizeof(string),""YE"*Admin Notice: "W"%s(Id: %d) Changed %s(Id: %d) Health to %d ", GetName(playerid), playerid, GetName(id), id, health);
  1569. ASCM(string);
  1570. SetPlayerHealth(id, health);
  1571. }
  1572. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  1573. return 1;
  1574. }
  1575.  
  1576. CMD:setmaptp(playerid, params[])
  1577. {
  1578. if(PlayerInfo[playerid][Level] >=3)
  1579. {
  1580. new reponse;
  1581. if(sscanf(params,"i", reponse)) return SendClientMessage(playerid, -1, ""R"/setmaptp [1/0] (1 = on | 0 = off)");
  1582.  
  1583. if(reponse == 1)
  1584. {
  1585. new string[150];
  1586. format(string,sizeof(string),""G"*Manager Notice: "W"%s(Id: %d) Enabled Map TP", GetName(playerid), playerid);
  1587. MSCM(string);
  1588. MAPTP[playerid] = 1;
  1589. }
  1590. if(reponse == 0)
  1591. {
  1592. new string[150];
  1593. format(string,sizeof(string),""G"*Manager Notice: "W"%s(Id: %d) Disabled Map TP", GetName(playerid), playerid);
  1594. MSCM(string);
  1595. MAPTP[playerid] = 1;
  1596. }
  1597. }
  1598. else return SendClientMessage(playerid, -1, "Error: You aren't a Manager!");
  1599. return 1;
  1600. }
  1601. CMD:set(playerid, params[])
  1602. {
  1603. if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][Level] < 3) return SendClientMessage(playerid, -1, ""R"/set[weather/time/armour/health/skin/color]");
  1604. if(PlayerInfo[playerid][Level] >= 3) return SendClientMessage(playerid, -1, ""R"/set[weather/time/armour/health/skin/maptp/gravity/level/vip]");
  1605. return 1;
  1606. }
  1607.  
  1608.  
  1609. CMD:playstream(playerid, params[])
  1610. {
  1611. if(isnull(params)) return SendClientMessage(playerid, -1, "USAGE: /playstream [stream url]");
  1612. PlayAudioStreamForPlayer(playerid, params);
  1613. return 1;
  1614. }
  1615.  
  1616. CMD:lock(playerid, params[])
  1617. {
  1618. if(IsPlayerInAnyVehicle(playerid))
  1619. {
  1620. new State=GetPlayerState(playerid);
  1621. if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFF004040,""R"Error: "W"You can only lock the doors as the driver.");
  1622. new i;
  1623. for(i=0;i<MAX_PLAYERS;i++)
  1624. {
  1625. if(i != playerid)
  1626. {
  1627. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
  1628. }
  1629. }
  1630. SendClientMessage(playerid, 0x33AA33AA, ""G"Success: "W"Vehicle locked!");
  1631. new Float:pX, Float:pY, Float:pZ;
  1632. GetPlayerPos(playerid,pX,pY,pZ);
  1633. PlayerPlaySound(playerid,1056,pX,pY,pZ);
  1634. }
  1635. else
  1636. {
  1637. SendClientMessage(playerid, 0xFF004040, ""R"Error: "W"You're not in a vehicle!");
  1638. }
  1639. return 1;
  1640. }
  1641.  
  1642. CMD:unlock(playerid, params[])
  1643. {
  1644. if(IsPlayerInAnyVehicle(playerid))
  1645. {
  1646. new State=GetPlayerState(playerid);
  1647. if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,0xFF004040,""R"Error: "W"You can only unlock the doors as the driver.");
  1648. for(new i=0;i<MAX_PLAYERS;i++)
  1649. {
  1650. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
  1651. }
  1652. SendClientMessage(playerid, 0x33AA33AA, ""G"Success: "W"Vehicle unlocked!");
  1653. new Float:pX, Float:pY, Float:pZ;
  1654. GetPlayerPos(playerid,pX,pY,pZ);
  1655. PlayerPlaySound(playerid,1057,pX,pY,pZ);
  1656. }
  1657. else
  1658. {
  1659. SendClientMessage(playerid, 0xFF004040, ""R"Error: "W"You're not in a vehicle!");
  1660. }
  1661. return 1;
  1662. }
  1663. CMD:deathmessage(playerid, params[])
  1664. {
  1665. new str[150], string[50];
  1666. if(sscanf(params,"s[50]",string)) return SendClientMessage(playerid, -1,""R"USAGE: /deathmessage [message]");
  1667. if(strlen(string) < 4) return SendClientMessage(playerid, -1, "Your deathmessage must at least contain more than 3 characters.");
  1668. PlayerInfo[playerid][DMsg] = string;
  1669. format(str, sizeof(str), ""O"You have changed your DeathMessage to "R"%s.", PlayerInfo[playerid][DMsg]);
  1670. SendClientMessage(playerid, -1, str);
  1671. return 1;
  1672. }
  1673. CMD:vcmds(playerid, params[])
  1674. {
  1675. new DIALOG[1246+200];
  1676.  
  1677. strcat(DIALOG, ""R"Player Commands:\n\n");
  1678. strcat(DIALOG, ""W" /changepassword /report /stats /getstats /v\n");
  1679. strcat(DIALOG, ""W" /pm /requestskin\n/dm /admins /deathmessage /aastunt /lock /unlock \n");
  1680. strcat(DIALOG, ""W" /requestfeature \n\n");
  1681.  
  1682. strcat(DIALOG, ""R"V.I.P Commands:\n\n");
  1683. strcat(DIALOG, ""O" Silver VIP Commands:\n\n");
  1684. strcat(DIALOG, ""W" /inf /nrg /mycolor /mypm /myskin /vsay /ircpm \n\n");
  1685. strcat(DIALOG, ""O" Golden VIP Commands:\n\n");
  1686. strcat(DIALOG, ""W" /tp /vweather /vjetpack /vgod /getstats\n\n");
  1687. strcat(DIALOG, ""W"V.IP's can use VIPChat using '% [Text]' !");
  1688. strcat(DIALOG, ""W"Admin Commands at /acmds");
  1689. ShowPlayerDialog(playerid, DIALOG_HELP, DIALOG_STYLE_MSGBOX, "Y-Player Commands", DIALOG, "Close", "");
  1690. return 1;
  1691. }
  1692.  
  1693. CMD:ircpm(playerid, params[])
  1694. {
  1695. if(PlayerInfo[playerid][VIP] < 1) return SendClientMessage(playerid, -1, ""R"[YAdmin]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1696. new str[700], str2[256], str3[700], str4[800], user[44];
  1697. if(sscanf(params, "ss[300]", user, str2)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /ircpm [user] [message]");
  1698. {
  1699. format(str, sizeof(str), ""YE"*PM To [IRC]%s: %s", user, str2);
  1700. SendClientMessage(playerid, 0xFF0000FF, str);
  1701.  
  1702. format(str3, sizeof(str3), "4*PM From %s(ID %d): %s", GetName(playerid), playerid, str2);
  1703. IRC_Say(botIDs[0], user, str3);
  1704.  
  1705. format(str4, sizeof(str4), ""YE"*Admin Notice: "W"Private Message From "YE"%s (Id: %d) "W"To "YE"[IRC]%s "W": "G"%s", GetName(playerid), playerid, user, str2);
  1706. ASCM(str4);
  1707. }
  1708. return 1;
  1709. }
  1710.  
  1711. CMD:getstats(playerid, params[])
  1712. {
  1713. if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
  1714. new id;
  1715. if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1,""R"USAGE: /getstats [playerid]");
  1716. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1717. new level[150];
  1718. if(PlayerInfo[id][Level] == 0 && PlayerInfo[id][VIP] == 0)
  1719. {
  1720. level = "Regular Player";
  1721. }
  1722. else if(PlayerInfo[id][Level] == 1)
  1723. {
  1724. level = "San Andreas Playground Moderator";
  1725. }
  1726. else if(PlayerInfo[id][Level] == 2)
  1727. {
  1728. level = "San Andreas Playground Administrator";
  1729. }
  1730. else if(PlayerInfo[id][Level] == 3)
  1731. {
  1732. level = "San Andreas Playground Management";
  1733. }
  1734. else if(PlayerInfo[id][VIP] >= 1)
  1735. {
  1736. level = "Very Important Player";
  1737. }
  1738. new str[2048];
  1739. format(str, sizeof(str), ""W"Name: "YE"%s\n", GetName(id));
  1740. format(str, sizeof(str), "%s"W"Hours in game : "YE"%d hours %d Minutes\n",str, PlayerInfo[id][Hours], PlayerInfo[id][Minutes]);
  1741. format(str, sizeof(str), "%s"W"Level : "YE"%s\n", str, level);
  1742. format(str, sizeof(str), "%s"W"Kills(Count Of Victims) : "YE"%d\n",str, PlayerInfo[id][Kills]);
  1743. format(str, sizeof(str), "%s"W"Deaths: "YE"%d\n",str, PlayerInfo[id][Deaths]);
  1744. format(str, sizeof(str), "%s"W"Kicks(Count of Kicks): "YE"%d\n",str, PlayerInfo[id][Kicks]);
  1745. format(str, sizeof(str), "%s"W"Bans(Count of Bans): "YE"%d\n",str, PlayerInfo[id][Bans]);
  1746. format(str, sizeof(str), "%s"W"DeathMessage: "YE"%d\n",str, PlayerInfo[id][DMsg]);
  1747. strcat(str, ""YE"You can see Stats of others players too ! How ? use /getstats or click player on TAB Dialog.\n");
  1748. ShowPlayerDialog(playerid, 554985, DIALOG_STYLE_MSGBOX, "Player Stats", str, "Close", "");
  1749. return 1;
  1750. }
  1751.  
  1752. CMD:inf(playerid, params[])
  1753. {
  1754. if(PlayerInfo[playerid][VIP] >= 2)
  1755. {
  1756. new Float:x, Float:y, Float:z, Float:Angle;
  1757. GetPlayerPos(playerid, x, y, z);
  1758. GetPlayerFacingAngle(playerid, Angle);
  1759. vCar[playerid] = CreateVehicle(411, x, y, z, Angle, -1, -1, 60);
  1760. PutPlayerInVehicle(playerid, vCar[playerid], 0);
  1761. SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
  1762. }
  1763. else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1764. return 1;
  1765. }
  1766.  
  1767. CMD:nrg(playerid, params[])
  1768. {
  1769. if(PlayerInfo[playerid][VIP] >= 1)
  1770. {
  1771. new Float:x, Float:y, Float:z, Float:Angle;
  1772. GetPlayerPos(playerid, x, y, z);
  1773. GetPlayerFacingAngle(playerid, Angle);
  1774. vCar[playerid] = CreateVehicle(522, x, y, z, Angle, -1, -1, 60);
  1775. PutPlayerInVehicle(playerid, vCar[playerid], 0);
  1776. SendClientMessage(playerid, -1, ""G"Car spawned at your location!");
  1777. }
  1778. else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1779. return 1;
  1780. }
  1781.  
  1782. CMD:mypm(playerid, params[])
  1783. {
  1784. if(PlayerInfo[playerid][VIP] >= 1)
  1785. {
  1786. new id;
  1787. if(sscanf(params,"u",id)) return SendClientMessage(playerid, -1,""R"USAGE: /mypm [1/0] (on /off)");
  1788. BlockPm[playerid] = id;
  1789. SendClientMessage(playerid, -1, ""G"Success!");
  1790. }
  1791. else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1792. return 1;
  1793. }
  1794.  
  1795. CMD:myskin(playerid, params[])
  1796. {
  1797. if(PlayerInfo[playerid][VIP] >= 1)
  1798. {
  1799. new id;
  1800. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /mypm [skinID]");
  1801. if(!IsValidSkin(id)) return SendClientMessage(playerid,0xF8F8F8FFF,""R"[SAP]: "GRI"Invalid skinID");
  1802. SetPlayerSkin(playerid, id);
  1803. SendClientMessage(playerid, -1, ""G"Success!");
  1804. }
  1805. else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1806. return 1;
  1807. }
  1808.  
  1809. CMD:vsay(playerid, params[])
  1810. {
  1811. if(PlayerInfo[playerid][VIP] >= 1)
  1812. {
  1813. if(sscanf(params,"s[50]",params)) return SendClientMessage(playerid, -1,""R"USAGE: /asay [text]");
  1814. new string[200];
  1815. format(string,sizeof(string),""O"**VIP(%s): %s", GetName(playerid), params);
  1816. SendClientMessageToAll(-1, string);
  1817. }
  1818. else return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1819. return 1;
  1820. }
  1821.  
  1822. CMD:mycolor(playerid, params[])
  1823. {
  1824. if(PlayerInfo[playerid][VIP] == 0) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Silver Donator's");
  1825. new color[32];
  1826. if(sscanf(params, "s[32]", color))
  1827. {
  1828. SendClientMessage(playerid, COLOR_RED,"USAGE: /setcolor <0 - 10>");
  1829. }
  1830. else return SendClientMessage(playerid, COLOR_RED, "Invalid Color ID, Valid Color ID "YE"<0 - 10> ");
  1831. if(!strcmp(params, "0", true))
  1832. {
  1833. SetPlayerColor(playerid, COLOR_BLACK);
  1834. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Black");
  1835. return 1;
  1836. }
  1837. else if(!strcmp(params, "1", true))
  1838. {
  1839. SetPlayerColor(playerid, COLOR_WHITE);
  1840. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"White");
  1841. return 1;
  1842. }
  1843. else if(!strcmp(params, "2", true))
  1844. {
  1845. SetPlayerColor(playerid, COLOR_GREY);
  1846. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "GRI"Grey");
  1847. return 1;
  1848. }
  1849. else if(!strcmp(params, "3", true))
  1850. {
  1851. SetPlayerColor(playerid, COLOR_ORANGE);
  1852. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "O"Orange");
  1853. return 1;
  1854. }
  1855. else if(!strcmp(params, "4", true))
  1856. {
  1857. SetPlayerColor(playerid, COLOR_YELLOW);
  1858. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "YE"Yellow");
  1859. return 1;
  1860. }
  1861. else if(!strcmp(params, "5", true))
  1862. {
  1863. SetPlayerColor(playerid, COLOR_RED);
  1864. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "R"Red");
  1865. return 1;
  1866. }
  1867. else if(!strcmp(params, "6", true))
  1868. {
  1869. SetPlayerColor(playerid, COLOR_GREEN);
  1870. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "G"Green");
  1871. return 1;
  1872. }
  1873. else if(!strcmp(params, "7", true))
  1874. {
  1875. SetPlayerColor(playerid, COLOR_BLUE);
  1876. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to Blue");
  1877. return 1;
  1878. }
  1879. else if(!strcmp(params, "8", true))
  1880. {
  1881. SetPlayerColor(playerid, COLOR_PURPLE);
  1882. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Purple");
  1883. return 1;
  1884. }
  1885. else if(!strcmp(params, "9", true))
  1886. {
  1887. SetPlayerColor(playerid, COLOR_PINK);
  1888. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Pink");
  1889. return 1;
  1890. }
  1891. else if(!strcmp(params, "10", true))
  1892. {
  1893. SetPlayerColor(playerid, COLOR_VIOLET);
  1894. SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "W"Violet");
  1895. return 1;
  1896. }
  1897. return 1;
  1898. }
  1899.  
  1900. CMD:tp(playerid, params[])
  1901. {
  1902. if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
  1903. new id;
  1904. if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /tp [playerid]");
  1905. new Float:x, Float:y, Float:z, str[100];
  1906. GetPlayerPos(id, x, y, z);
  1907. SetPlayerPos(playerid, x, y, z+1);
  1908. format(str, sizeof(str), "You have teleported to %s(ID:%d)", GetName(id), id);
  1909. SendClientMessage(playerid, 0x00bbbb00 , str);
  1910. return 1;
  1911. }
  1912.  
  1913. CMD:vgod(playerid, params[])
  1914. {
  1915. if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
  1916. if(GodMode[playerid] == 1)
  1917. {
  1918. GodMode[playerid] = 0;
  1919. SetPlayerHealth(playerid, 99.0);
  1920. }
  1921. if(GodMode[playerid] == 0)
  1922. {
  1923. GodMode[playerid] = 1;
  1924. SetPlayerHealth(playerid, 99999999999);
  1925. }
  1926. return 1;
  1927. }
  1928.  
  1929. CMD:vjetpack(playerid, params[])
  1930. {
  1931. if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
  1932. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  1933. return 1;
  1934. }
  1935.  
  1936. CMD:vweather(playerid, params[])
  1937. {
  1938. if(PlayerInfo[playerid][VIP] < 2) return SendClientMessage(playerid, -1, ""R"[SAP]: "GRI"Sorry, This Command can be used just by +Golden Donator's");
  1939. new id;
  1940. if(sscanf(params,"i", id)) return SendClientMessage(playerid, -1,""R"USAGE: /vweather [WeatherID]");
  1941. SetPlayerWeather(playerid, strval(params));
  1942. return 1;
  1943. }
  1944.  
  1945. CMD:requestfeature(playerid, params[])
  1946. {
  1947. new str[50], strk[250];
  1948. if(isnull(params))
  1949. {
  1950. SendClientMessage(playerid, -1, ""R"Error: "W"/requestfeatures [featureid]");
  1951. SendClientMessage(playerid, -1, ""R"Features IDs: AnimalsCars(0) AdminRamp(1) Ramping(2) Fly(3) Boost(4)");
  1952. }
  1953. if(strval(params) == 0) str = "AnimalsCars";
  1954. if(strval(params) == 1) str = "AdminRamp";
  1955. if(strval(params) == 2) str = "Ramping";
  1956. if(strval(params) == 3) str = "Fly";
  1957. if(strval(params) == 4) str = "Boost";
  1958. format(strk, sizeof(strk), ""G"*Manager Notice: "W"Player %s (Id: %d) Send a Feeature request `%s`", GetName(playerid), playerid, str);
  1959. MSCM(strk);
  1960. return 1;
  1961. }
  1962. CMD:requestskin(playerid, params[])
  1963. {
  1964. new str[250];
  1965. if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"/requestskin [skinid]");
  1966. format(str, sizeof(str), ""YE"*Admin Notice: "W"Player %s (Id: %d) Send a Skin Change request Skin id = `%d`", GetName(playerid), playerid, strval(params));
  1967. ASCM(str);
  1968. return 1;
  1969. }
  1970.  
  1971. CMD:setlevel(playerid, params[])
  1972. {
  1973. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Error: You Need Manager Rights for use this cmd");
  1974. new id, level;
  1975. if(sscanf(params,"ii", id, level)) return SendClientMessage(playerid, -1,""R"USAGE: /setlevel [playerid] [Level]");
  1976. if(PlayerInfo[id][Level] == level) return SendClientMessage(playerid, -1, ""R"Error: This Player Already have this level !");
  1977. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  1978. if(level > 4 || level < 0 || level == 1) return SendClientMessage(playerid, -1, ""R"Error: There just 3 perm Levels! (Moderator Not include !)");
  1979. PlayerInfo[id][Level] = level;
  1980. if(PlayerInfo[id][Level] == 4)
  1981. {
  1982. new str[150];
  1983. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Mapper By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  1984. MSCM(str);
  1985. }
  1986. if(PlayerInfo[id][Level] == 3)
  1987. {
  1988. new str[150];
  1989. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Manager By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  1990. MSCM(str);
  1991. }
  1992. if(PlayerInfo[id][Level] == 0)
  1993. {
  1994. new str[150];
  1995. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  1996. MSCM(str);
  1997. }
  1998. if(PlayerInfo[id][Level] == 2)
  1999. {
  2000. new str[150];
  2001. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Administrator By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  2002. MSCM(str);
  2003. }
  2004. return 1;
  2005. }
  2006.  
  2007. CMD:setvip(playerid, params[])
  2008. {
  2009. if(!IsPlayerAdmin(playerid) && PlayerInfo[playerid][Level] <= 2) return SendClientMessage(playerid, -1, "Error: You Need Manager Rights for use this cmd");
  2010. new id, level;
  2011. if(sscanf(params,"ii", id, level)) return SendClientMessage(playerid, -1,""R"USAGE: /setvip [playerid] [Level]");
  2012. if(PlayerInfo[id][VIP] == level) return SendClientMessage(playerid, -1, ""R"Error: This Player Already have this level !");
  2013. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2014. if(level > 2 || level < 0) return SendClientMessage(playerid, -1, ""R"Error: There just 2 Levels! <0-2>");
  2015. PlayerInfo[id][VIP] = level;
  2016. if(PlayerInfo[id][VIP] == 1)
  2017. {
  2018. new str[150];
  2019. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Silver Donator By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  2020. MSCM(str);
  2021. }
  2022. if(PlayerInfo[id][VIP] == 2)
  2023. {
  2024. new str[150];
  2025. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promonted to an Golden Donator! By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  2026. MSCM(str);
  2027. }
  2028. if(PlayerInfo[id][VIP] == 0)
  2029. {
  2030. new str[150];
  2031. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s (Id: %d)", GetName(id), id, GetName(playerid), playerid);
  2032. MSCM(str);
  2033. }
  2034. return 1;
  2035. }
  2036.  
  2037. CMD:mute(playerid, params[])
  2038. {
  2039. new
  2040. cmdid,
  2041. reason[80],
  2042. minutes,
  2043. time,
  2044. string[128]
  2045. ;
  2046.  
  2047. if(PlayerInfo[playerid][Level] < 1) SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2048. if(sscanf(params, "uis[80]", cmdid, minutes, reason)) return SendClientMessage(playerid,-1,""YE"USAGE: /mute [id/name] [time] [reason]");
  2049. if(!IsPlayerConnected(cmdid) || cmdid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player not found!");
  2050. if(muted[cmdid] == 1) return SendClientMessage(playerid,COLOR_RED,"Error: This Player Already Muted!");
  2051. if(time == 0)
  2052. {
  2053. new str[150];
  2054. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been P-Muted By %s (Id: %d) Reason : %s", GetName(cmdid), cmdid, GetName(playerid), playerid, reason);
  2055. ASCM(str);
  2056. SendClientMessage(cmdid, COLOR_RED, "You got muted By an administrator");
  2057. muted[cmdid] = 1;
  2058. }
  2059. else
  2060. {
  2061. new str[150];
  2062. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been Muted By %s (Id: %d) For: %d Minutes | Reason : %s", GetName(cmdid), cmdid, GetName(playerid), playerid, minutes, reason);
  2063. ASCM(str);
  2064. format(string, sizeof(string), "You got muted By an administrator for %d minutes", minutes);
  2065. muted[cmdid] = 1;
  2066. Mute = SetTimerEx("unmuteTimer", 60*1000*minutes, false, "i", cmdid);
  2067. }
  2068. SendClientMessage(cmdid, -1, string);
  2069. return 1;
  2070. }
  2071. CMD:unmute(playerid, params[])
  2072. {
  2073. new cmdid;
  2074. if(PlayerInfo[playerid][Level] < 1) SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2075. if(sscanf(params, "u", cmdid)) return SendClientMessage(playerid,-1,""YE"USAGE: /unmute [id/name]");
  2076. if(!IsPlayerConnected(cmdid) || cmdid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player not found!");
  2077. if(muted[cmdid] == 0) return SendClientMessage(playerid,COLOR_RED,"Error: This Player Already UnMuted!");
  2078. new str[150];
  2079. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) Has been unMuted By %s (Id: %d)", GetName(cmdid), cmdid, GetName(playerid), playerid);
  2080. ASCM(str);
  2081. muted[cmdid] = 0;
  2082. KillTimer(Mute);
  2083. SendClientMessage(cmdid, -1, "You got unmuted By an administrator");
  2084. return 1;
  2085. }
  2086. CMD:givemoderator(playerid, params[])
  2087. {
  2088. new id;
  2089. if(PlayerInfo[playerid][Level] >=2)
  2090. {
  2091. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1, ""YE"USAGE: /givemoderator [playerid]");
  2092. PlayerInfo[id][Level] = 1;
  2093. SendClientMessage(id, -1, ""YE"An administrator has granted you moderator rights!");
  2094. new str[150];
  2095. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has granted moderator rights to %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
  2096. ASCM(str);
  2097. SetPlayerColor(id, 0xFFFF00AA);
  2098. }
  2099. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2100. return 1;
  2101. }
  2102.  
  2103. CMD:admincolor(playerid, params[])
  2104. {
  2105. if(PlayerInfo[playerid][Level] == 0) return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2106. SetPlayerColor(playerid, 0xFFFF00AA);
  2107. return 1;
  2108. }
  2109.  
  2110. CMD:givegod(playerid,params[])
  2111. {
  2112. if(PlayerInfo[playerid][Level] >= 2)
  2113. {
  2114. new target;
  2115. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"/givegod [ID/Partofname]");
  2116. if(godmode[target] == 0)
  2117. {
  2118. SetPlayerHealth(target,99999);
  2119. SetPlayerArmour(target,99999);
  2120. SendClientMessage(target,-1,""G"Godemode ON.");
  2121. SendClientMessage(target,-1,""G"Player Godmode activated.");
  2122. new str[150];
  2123. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has enabled god mode to %s (Id: %d)", GetName(playerid), playerid, GetName(target), target);
  2124. ASCM(str);
  2125. godmode[target] = 1;
  2126. }
  2127. else return SendClientMessage(playerid,-1,"Player's Godmode is already on.");
  2128. }
  2129. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2130. return 1;
  2131. }
  2132.  
  2133. CMD:takegod(playerid,params[])
  2134. {
  2135. if(PlayerInfo[playerid][Level] >= 2)
  2136. {
  2137. new target;
  2138. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"/takegod [ID/Partofname]");
  2139. if(godmode[target] == 1)
  2140. {
  2141. SetPlayerHealth(target, 100);
  2142. SetPlayerArmour(target, 0);
  2143. SendClientMessage(target,-1,""R"Godemode OFF.");
  2144. SendClientMessage(target,-1,""R"Player Godmode Disabled.");
  2145. new str[150];
  2146. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has disabled god mode to %s (Id: %d)", GetName(playerid), playerid, GetName(target), target);
  2147. ASCM(str);
  2148. }
  2149. else return SendClientMessage(playerid,-1,"Player Godmode is already off.");
  2150. }
  2151. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2152. return 1;
  2153. }
  2154.  
  2155. CMD:takemoderator(playerid, params[])
  2156. {
  2157. if(PlayerInfo[playerid][Level] >=2)
  2158. {
  2159. new id;
  2160. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1, ""YE"USAGE: /takemoderator [playerid]");
  2161. if(PlayerInfo[id][Level] == 1)
  2162. {
  2163. new str[150];
  2164. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s (Id: %d) has taked moderator rights from %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
  2165. ASCM(str);
  2166. PlayerInfo[id][Level] = 0;
  2167. SendClientMessage(id, -1, ""YE"You are no longer an moderator");
  2168. }
  2169. else return SendClientMessage(playerid, -1, "Error: you can just take admin from moderators");
  2170. }
  2171. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2172. return 1;
  2173. }
  2174.  
  2175. CMD:ban(playerid,params[])
  2176. {
  2177. if(PlayerInfo[playerid][Level] >=2)
  2178. {
  2179. new IPx[16];
  2180. new id,reason[50],string[300], str[300];
  2181. if(sscanf(params,"us[200]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /ban [playerid] [reason]");
  2182. GetPlayerIp(id, IPx, sizeof(IPx));
  2183. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was banned by %s For: %s", GetName(id), id, GetName(playerid), reason);
  2184. ASCM(string);
  2185. for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
  2186. TogglePlayerControllable(id, 0);
  2187. SendClientMessage(id, -1,""R"You are Currently Banned From San Andreas Playground");
  2188. format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s",GetName(playerid), reason );
  2189. SendClientMessage(id, -1, str);
  2190. SendClientMessage(id, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
  2191. new querylist[512];
  2192. format(querylist, sizeof(querylist), "INSERT INTO `banlist`(`name`, `ip`, `Admin`, `Reason`) VALUES('%s', '%s', '%s', '%s')", GetName(id), IPx, GetName(playerid), reason);
  2193. mysql_query(yadmin, querylist);
  2194. SetTimerEx("DelayBan", 1000, false, "i", id);
  2195. }
  2196. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2197. return 1;
  2198. }
  2199.  
  2200. CMD:kick(playerid,params[])
  2201. {
  2202. if(PlayerInfo[playerid][Level] >=1)
  2203. {
  2204. new id,reason[50],string[300], str[300];
  2205. if(sscanf(params,"us[178]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /kick [playerid] [reason]");
  2206. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Kicked by %s For: %s", GetName(id), id, GetName(playerid), reason);
  2207. ASCM(string);
  2208. for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
  2209. TogglePlayerControllable(id, 0);
  2210. SendClientMessage(id, -1,""R"You have been kicked from San Andreas Playground");
  2211. format(str, sizeof(str), "You were kicked by: "R"%s "W"with given a reason : "R"%s",GetName(playerid), reason);
  2212. SendClientMessage(id, -1, str);
  2213. SendClientMessage(id, -1, "if You Think You are Kick by unfair ! Feel Free to create a report in our forum ");
  2214. SetTimerEx("DelayKick", 1000, false, "i", id);
  2215. }
  2216. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2217. return 1;
  2218. }
  2219.  
  2220. CMD:report(playerid,params[])
  2221. {
  2222. new id,reason[50],string[300];
  2223. if(sscanf(params,"us[178]",id, reason)) return SendClientMessage(playerid, -1,""R"USAGE: /report [playerid] [reason]");
  2224. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
  2225. ASCM(string);
  2226. format(string,sizeof(string),"*Admin Notice: Player %s (Id: %d) reported By %s(Id: %d) For: %s", GetName(id), id, GetName(playerid), playerid, reason);
  2227. IRC_SendMessageToAdmins(2,string);
  2228. return 1;
  2229. }
  2230.  
  2231. CMD:changename(playerid, params[])
  2232. {
  2233. new nick[50], str[150], string[128];
  2234. if(sscanf(params,"s[50]",nick)) return SendClientMessage(playerid, -1,""R"USAGE: /changename [New nick]");
  2235. format(str, sizeof(str), "UPDATE `accounts` SET `name`= '%s' WHERE `name` = '%s'", nick, GetName(playerid));
  2236. format(str, sizeof(str), "UPDATE `accounts_2` SET `name`= '%s' WHERE `name` = '%s'", nick, GetName(playerid));
  2237. SendClientMessage(playerid, -1,""YE"All Your Stats has been Moved To the new nick :D");
  2238. mysql_query(yadmin, str);
  2239. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Changed Her/His Name to %s", GetName(playerid), playerid, nick);
  2240. ASCM(string);
  2241. SetPlayerName(playerid, nick);
  2242. return 1;
  2243. }
  2244.  
  2245. CMD:changepassword(playerid, params[])
  2246. {
  2247. new pass[50], str[150], string[128];
  2248. if(sscanf(params,"s[50]",pass)) return SendClientMessage(playerid, -1,""R"USAGE: /changepassword [New password]");
  2249. format(str, sizeof(str), "UPDATE `accounts` SET `Password`= '%s' WHERE `name` = '%s'",pass, GetName(playerid));
  2250. SendClientMessage(playerid, -1,""YE"Your Password Changed !");
  2251. mysql_query(yadmin, str);
  2252. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Changed Her/His Password", GetName(playerid), playerid);
  2253. ASCM(string);
  2254. return 1;
  2255. }
  2256.  
  2257. CMD:clearchat(playerid,params[])
  2258. {
  2259. if(PlayerInfo[playerid][Level] >=1)
  2260. {
  2261. new string[128];
  2262. format(string,sizeof(string),""YE"*Admin Notice: "W"%s Clear The chat ", GetName(playerid));
  2263. ASCM(string);
  2264. for(new i = 0; i < MAX_PLAYERS; i++)
  2265. {
  2266. for(new ik = 0; ik < 50; ik++)
  2267. {
  2268. SendClientMessage(playerid, COLOR_WHITE,"");
  2269. }
  2270. SendClientMessage(i, -1,""YE"Chat Cleared By An Administrator");
  2271. }
  2272. }
  2273. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2274. return 1;
  2275. }
  2276.  
  2277. CMD:sannounce(playerid,params[])
  2278. {
  2279. if(PlayerInfo[playerid][Level] >=1)
  2280. {
  2281. if(!isnull(params))
  2282. {
  2283. new string[150], str[100];
  2284. format(string,sizeof(string),""YE"*Admin Notice: "W"%s Announced to all players in chat `%s` ", GetName(playerid),params);
  2285. ASCM(string);
  2286. format(str,sizeof(str),""YE"%s", params);
  2287. SendClientMessageToAll(COLOR_RED, "----------------------------------");
  2288. SendClientMessageToAll(-1, str);
  2289. SendClientMessageToAll(COLOR_RED, "----------------------------------");
  2290. }
  2291. else return SendClientMessage(playerid, -1, ""R"/sannounce [Text]");
  2292. }
  2293. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2294. return 1;
  2295. }
  2296. CMD:showmessage(playerid, params[])
  2297. {
  2298. if(PlayerInfo[playerid][Level] >=1)
  2299. {
  2300. if(!isnull(params))
  2301. {
  2302. new string[150], str[100];
  2303. format(string,sizeof(string),""YE"*Admin Notice: "W"%s Announced to all players in chat `%s` ", GetName(playerid),params);
  2304. ASCM(string);
  2305. format(str,sizeof(str),"~y~%s", params);
  2306. GameTextForAll(str, 5000, 3);
  2307. return 1;
  2308. }
  2309. else return SendClientMessage(playerid, -1, ""R"/ShowMessage [Text]");
  2310. }
  2311. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2312. }
  2313. CMD:createtext(playerid, params[])
  2314. {
  2315. if(PlayerInfo[playerid][Level] == 0)
  2316. return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
  2317. ShowPlayerDialog(playerid, EDITOBJ_DIALOG, DIALOG_STYLE_INPUT, "Texture", "Enter Object ID\nDon't know Object id?\nUse Following\n19353", "Enter", "Cancel");
  2318. return 1;
  2319. }
  2320. CMD:edittext(playerid, params[])
  2321. {
  2322. new str[100];
  2323. if(PlayerInfo[playerid][Level] == 0)
  2324. return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
  2325.  
  2326. if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"Invalid Object");
  2327. new obje = strval(params);
  2328. EditDynamicObject(playerid, obje);
  2329.  
  2330. format(str,sizeof(str), ""G"Success "W": You now edit the object with ID %d", obje); //-> The number is 42.
  2331. SendClientMessage(playerid, COLOR_RED, str);
  2332. return 1;
  2333. }
  2334. CMD:deletetext(playerid, params[])
  2335. {
  2336. new str[100];
  2337. if(PlayerInfo[playerid][Level] == 0)
  2338. return SendClientMessage(playerid, -1, ""R"Error: "W"You are not authorized to use this command!");
  2339.  
  2340. if(isnull(params)) return SendClientMessage(playerid, -1, ""R"Error: "W"You must enter an object id!");
  2341. new obj = strval(params);
  2342. DestroyDynamicObject(obj);
  2343.  
  2344. format(str,sizeof(str), ""R"[SAP]: "GRI"You deleted object the with ID %d", obj); //-> The number is 42.
  2345. SendClientMessage(playerid, COLOR_RED, str);
  2346. return 1;
  2347. }
  2348.  
  2349. CMD:unban(playerid, params[])
  2350. {
  2351. if(PlayerInfo[playerid][Level] >=2)
  2352. {
  2353. if(!isnull(params))
  2354. {
  2355. new Cache:result,query2[128];
  2356. format(query2, 128, "SELECT * FROM `banlist` WHERE `name` = '%s'", params);
  2357. result = mysql_query(yadmin, query2);
  2358. new rows;
  2359. cache_get_row_count(rows);
  2360. if(!rows) return SendClientMessage(playerid, -1, ""R"Error: this account Not Banned!");
  2361.  
  2362. new querys[128], string[150];
  2363. format(querys, 128, "DELETE FROM `banlist` WHERE name = '%s'", params);
  2364. mysql_query(yadmin, querys);
  2365. format(string,sizeof(string),""YE"*Admin Notice: "W"Player : %s Has Been UnBanned By %s", params, GetName(playerid));
  2366. ASCM(string);
  2367. cache_delete(result);
  2368. }
  2369. else return SendClientMessage(playerid, -1,""R"USAGE: /unban [NickName]");
  2370. }
  2371. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2372. return 1;
  2373. }
  2374.  
  2375. CMD:removeacc(playerid, params[])
  2376. {
  2377. if(PlayerInfo[playerid][Level] >= 3)
  2378. {
  2379. if(!isnull(params))
  2380. {
  2381. new Cache:result,query2[128];
  2382. format(query2, 128, "SELECT * FROM `accounts` WHERE `name` = '%s'", params);
  2383. result = mysql_query(yadmin, query2);
  2384. new rows;
  2385. cache_get_row_count(rows);
  2386. cache_delete(result);
  2387. if(!rows) return SendClientMessage(playerid, -1, ""R"Error: this account Not exists!");
  2388.  
  2389. new querys[128], string[150];
  2390. format(querys, 128, "DELETE FROM `accounts` WHERE name = '%s'", params);
  2391. format(string,sizeof(string),""G"*Manager Notice: "W"Player : %s Account Has Been Deleted By %s", params, GetName(playerid));
  2392. MSCM(string);
  2393. }
  2394. else return SendClientMessage(playerid, -1,""R"USAGE: /removeacc [NickName]");
  2395. }
  2396. else return SendClientMessage(playerid, -1, "Error: You are not an Manager!");
  2397. return 1;
  2398. }
  2399.  
  2400. CMD:jail(playerid, params[])
  2401. {
  2402. if(PlayerInfo[playerid][Level] >=1)
  2403. {
  2404. new id,reason[50],duration,string[128];
  2405. if(sscanf(params,"u[128]i,i",id,duration)) return SendClientMessage(playerid, -1,""R"USAGE: /jail [playerid] [duration in mins] ");
  2406. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2407. if(IsJailed[id] == 1) return SendClientMessage(playerid, -1,""R"Error: This Player already in jail!");
  2408. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Jailed by %s For: %d mins", GetName(id), id, GetName(playerid), duration, reason);
  2409. ASCM(string);
  2410. SendClientMessage(id, -1, ""R"An Administrator Jailed You ! for more informations use @ [Text]");
  2411. SetPlayerVirtualWorld(id, 588);
  2412. SetPlayerPos(id, 8991.62, -9793.03, 1.5);
  2413. SetPlayerFacingAngle(id, 255.0);
  2414. SetPlayerWeather(id, 18);
  2415. SetPlayerInterior(id, 0);
  2416. ResetPlayerWeapons(id);
  2417. IsJailed[id] = 1;
  2418. Jail = SetTimerEx("unjail", duration*60000, false, "i", id);
  2419. }
  2420. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2421. return 1;
  2422. }
  2423.  
  2424. CMD:unjail(playerid, params[])
  2425. {
  2426. if(PlayerInfo[playerid][Level] >=1)
  2427. {
  2428. new id;
  2429. if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /unjail [playerid]");
  2430. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2431. new string[100];
  2432. if(IsJailed[id] == 0) return SendClientMessage(playerid, -1,""R"Error: This Player not in jail");
  2433. SpawnPlayer(id);
  2434. IsJailed[id] = 0;
  2435. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was UnJailed by %s ", GetName(id), id, GetName(playerid));
  2436. ASCM(string);
  2437. SendClientMessage(id, -1, ""R"You Got unjailed by an administrator!");
  2438. KillTimer(Jail);
  2439. }
  2440. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2441. return 1;
  2442. }
  2443. CMD:nuke(playerid, params[])
  2444. {
  2445. if(PlayerInfo[playerid][Level] >=1)
  2446. {
  2447. new id;
  2448. if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /nuke [playerid]");
  2449. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2450. new Float:X, Float:Y, Float:Z, string[120];
  2451. GetPlayerPos(id, X, Y, Z);
  2452. CreateExplosion(X, Y, Z + 3, 1, 10);
  2453. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got Nuked By : %s ", GetName(id), id, GetName(playerid));
  2454. ASCM(string);
  2455. }
  2456. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2457. return 1;
  2458. }
  2459.  
  2460. CMD:givecash(playerid,params[])
  2461. {
  2462. if(PlayerInfo[playerid][Level] >=2)
  2463. {
  2464. new id, string[128];
  2465. new cash;
  2466. if(sscanf(params,"ui",id, cash)) return SendClientMessage(playerid,-1,"USAGE: /givecash [playerid] [Amount]");
  2467. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"ERROR: That player isn't online!");
  2468. GivePlayerMoney(id, cash);
  2469. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Get $ %d From Admin : %s (Id: %d) ", GetName(id), id, cash, GetName(playerid), playerid);
  2470. ASCM(string);
  2471. }
  2472. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2473. return 1;
  2474. }
  2475. CMD:giveweapon(playerid,params[])
  2476. {
  2477. if(PlayerInfo[playerid][Level] >=2)
  2478. {
  2479. new id, string[128];
  2480. new wid;
  2481. if(sscanf(params,"ui",id, wid)) return SendClientMessage(playerid,-1,"USAGE: /giveweapon [playerid] [weaponid]");
  2482. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"ERROR: That player isn't online!");
  2483. Given[id] = 1;
  2484. GivePlayerWeapon(id, wid, 1500);
  2485. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Give Weapon (Id: %d) to %s(Id: %d) ", GetName(playerid), playerid, wid, GetName(id), id);
  2486. ASCM(string);
  2487. }
  2488. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2489. return 1;
  2490. }
  2491. CMD:giveallweapon(playerid,params[])
  2492. {
  2493. if(PlayerInfo[playerid][Level] >=2)
  2494. {
  2495. new string[128];
  2496. new wid;
  2497. if(sscanf(params,"i", wid)) return SendClientMessage(playerid,-1,"USAGE: /giveallweapon [weaponid]");
  2498. foreach(new i : Player)
  2499. {
  2500. Given[i] = 1;
  2501. GivePlayerWeapon(i, wid, 1500);
  2502. }
  2503. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Give Weapon (Id: %d) to All Players ", GetName(playerid), playerid, wid);
  2504. ASCM(string);
  2505. }
  2506. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2507. return 1;
  2508. }
  2509. CMD:fix(playerid, params[])
  2510. {
  2511. if(PlayerInfo[playerid][Level] >=1)
  2512. {
  2513. new id;
  2514. if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"USAGE: /fix [playerid]");
  2515. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2516. new Float:X, Float:Y, Float:Z, string[120];
  2517. GetPlayerPos(id, X, Y, Z);
  2518. SpawnPlayer(id);
  2519. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Has Been Spawned By : %s ", GetName(id), id, GetName(playerid));
  2520. ASCM(string);
  2521. }
  2522. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2523. return 1;
  2524. }
  2525.  
  2526. CMD:freeze(playerid, params[])
  2527. {
  2528. if(PlayerInfo[playerid][Level] >=1)
  2529. {
  2530. new id;
  2531. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /freeze [playerid]");
  2532. if(IsFreezed[id] == 1) return SendClientMessage(playerid, -1, ""R"Error: This Player Already Freezed !");
  2533. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2534. new string[200];
  2535. TogglePlayerControllable(id, 0);
  2536. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got Freezed By : %s ", GetName(id), id, GetName(playerid));
  2537. ASCM(string);
  2538. IsFreezed[id] = 1;
  2539. }
  2540. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2541. return 1;
  2542. }
  2543.  
  2544. CMD:unfreeze(playerid, params[])
  2545. {
  2546. if(PlayerInfo[playerid][Level] >=1)
  2547. {
  2548. new id;
  2549. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /unfreeze [playerid]");
  2550. if(IsFreezed[id] == 0) return SendClientMessage(playerid, -1, ""R"Error: This Player Already UnFreezed !");
  2551. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2552. new string[200];
  2553. TogglePlayerControllable(id, 1);
  2554. IsFreezed[id] = 0;
  2555. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Got UnFreezed By : %s ", GetName(id), id, GetName(playerid));
  2556. ASCM(string);
  2557. }
  2558. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2559. return 1;
  2560. }
  2561.  
  2562. CMD:watch(playerid, params[])
  2563. {
  2564. if(PlayerInfo[playerid][Level] >=1)
  2565. {
  2566. new id;
  2567. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /watch [playerid]");
  2568. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2569. if(Spec[playerid] == 1) return SendClientMessage(playerid, -1, ""R"Error: You already Watching a player :/");
  2570. new string[200];
  2571. format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Currently Watching Player : %s (Id: %d)", GetName(playerid), playerid, GetName(id), id);
  2572. ASCM(string);
  2573. TogglePlayerSpectating(playerid, 1);
  2574. PlayerSpectatePlayer(playerid, id);
  2575. Spec[playerid] = 1;
  2576. }
  2577. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2578. return 1;
  2579. }
  2580.  
  2581. CMD:stopwatch(playerid, params[])
  2582. {
  2583. if(PlayerInfo[playerid][Level] >=1)
  2584. {
  2585. if(Spec[playerid] == 0) return SendClientMessage(playerid, -1, ""R"Error: You are Not watching anyone");
  2586. new string[200];
  2587. format(string,sizeof(string),""YE"*Admin Notice: "W"%s (Id: %d) Stop Watching and Back to Duty Mode", GetName(playerid), playerid);
  2588. TogglePlayerSpectating(playerid, 0);
  2589. ASCM(string);
  2590. Spec[playerid] = 0;
  2591. }
  2592. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2593. return 1;
  2594. }
  2595.  
  2596. CMD:rpweapons(playerid, params[])
  2597. {
  2598. if(PlayerInfo[playerid][Level] >=1)
  2599. {
  2600. new id;
  2601. if(sscanf(params,"i",id)) return SendClientMessage(playerid, -1,""R"USAGE: /rpweapons [playerid]");
  2602. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, ""R"Error: This Player Logged off !");
  2603. new string[200];
  2604. ResetPlayerWeapons(id);
  2605. IsFreezed[id] = 0;
  2606. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) Weapons Has Been Removed By : %s ", GetName(id), id, GetName(playerid));
  2607. ASCM(string);
  2608. }
  2609. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2610. return 1;
  2611. }
  2612.  
  2613. CMD:admins(playerid, params[])
  2614. {
  2615. new admins, string[128];
  2616. SendClientMessage(playerid, -1, "");
  2617. SendClientMessage(playerid, -1, ""YE" Online administrators.");
  2618.  
  2619. foreach(new i : Player)
  2620. {
  2621. if(IsPlayerConnected(i))
  2622. {
  2623. if(PlayerInfo[i][Level] == 1)
  2624. {
  2625. admins++;
  2626. format(string, sizeof(string), "%s - "O"Moderator", GetName(i));
  2627. SendClientMessage(playerid, -1, string);
  2628. }
  2629. if(PlayerInfo[i][Level] == 2)
  2630. {
  2631. admins++;
  2632. format(string, sizeof(string), "%s - "YE"Administrator", GetName(i));
  2633. SendClientMessage(playerid, -1, string);
  2634. }
  2635. if(PlayerInfo[i][Level] == 3 )
  2636. {
  2637. admins++;
  2638. format(string, sizeof(string), "%s - "G"Manager", GetName(i));
  2639. SendClientMessage(playerid, -1, string);
  2640. }
  2641. if(PlayerInfo[i][Level] >= 4 )
  2642. {
  2643. admins++;
  2644. format(string, sizeof(string), "%s - "R"Mapper", GetName(i));
  2645. SendClientMessage(playerid, -1, string);
  2646. }
  2647. }
  2648. }
  2649. SendClientMessage(playerid, -1, "");
  2650. if (admins == 0)
  2651. {
  2652. SendClientMessage(playerid, -1, "There No Admins Connected");
  2653. }
  2654. return 1;
  2655. }
  2656.  
  2657. CMD:asay(playerid, params[])
  2658. {
  2659. if(PlayerInfo[playerid][Level] >=1)
  2660. {
  2661. if(sscanf(params,"s[50]",params)) return SendClientMessage(playerid, -1,""R"USAGE: /asay [text]");
  2662. new string[200];
  2663. format(string,sizeof(string),"*Admin(%s): %s", GetName(playerid), params);
  2664. SendClientMessageToAll(COLOR_BLUE, string);
  2665. }
  2666. else return SendClientMessage(playerid, -1, "Error: You are not an Administrator!");
  2667. return 1;
  2668. }
  2669.  
  2670. IRCCMD:say(botid, channel[], user[], host[], params[])
  2671. {
  2672. if (IRC_IsOwner(botid, channel, user))
  2673. {
  2674. // Check if the user entered any text
  2675. if (!isnull(params))
  2676. {
  2677. new msg[128];
  2678. // Echo the formatted message
  2679. format(msg, sizeof(msg), "02Owner(%s) on IRC: %s", user, params);
  2680. IRC_GroupSay(groupID, channel, msg);
  2681. format(msg, sizeof(msg), "**Owner(%s): %s", user, params);
  2682. SendClientMessageToAll(COLOR_BLUE, msg);
  2683. }
  2684. return 1;
  2685. }
  2686. if (IRC_IsAdmin(botid, channel, user))
  2687. {
  2688. // Check if the user entered any text
  2689. if (!isnull(params))
  2690. {
  2691. new msg[128];
  2692. // Echo the formatted message
  2693. format(msg, sizeof(msg), "02Manager(%s) on IRC: %s", user, params);
  2694. IRC_GroupSay(groupID, channel, msg);
  2695. format(msg, sizeof(msg), "**Manager(%s): %s", user, params);
  2696. SendClientMessageToAll(COLOR_BLUE, msg);
  2697. }
  2698. return 1;
  2699. }
  2700. if (IRC_IsOp(botid, channel, user))
  2701. {
  2702. // Check if the user entered any text
  2703. if (!isnull(params))
  2704. {
  2705. new msg[128];
  2706. // Echo the formatted message
  2707. format(msg, sizeof(msg), "02Admin(%s) on IRC: %s", user, params);
  2708. IRC_GroupSay(groupID, channel, msg);
  2709. format(msg, sizeof(msg), "*Admin(%s): %s", user, params);
  2710. SendClientMessageToAll(COLOR_BLUE, msg);
  2711. }
  2712. return 1;
  2713. }
  2714. if (IRC_IsHalfop(botid, channel, user))
  2715. {
  2716. // Check if the user entered any text
  2717. if (!isnull(params))
  2718. {
  2719. new msg[128];
  2720. // Echo the formatted message
  2721. format(msg, sizeof(msg), "02Moderator(%s) on IRC: %s", user, params);
  2722. IRC_GroupSay(groupID, channel, msg);
  2723. format(msg, sizeof(msg), "*Moderator(%s): %s", user, params);
  2724. SendClientMessageToAll(COLOR_BLUE, msg);
  2725. }
  2726. return 1;
  2727. }
  2728. // Check if the user has at least voice in the channel
  2729. if (IRC_IsVoice(botid, channel, user))
  2730. {
  2731. // Check if the user entered any text
  2732. if (!isnull(params))
  2733. {
  2734. new msg[128];
  2735. // Echo the formatted message
  2736. format(msg, sizeof(msg), "02*VIP(%s) on IRC: %s", user, params);
  2737. IRC_GroupSay(groupID, channel, msg);
  2738. format(msg, sizeof(msg), "VIP(%s): %s", user, params);
  2739. SendClientMessageToAll(COLOR_ORANGE, msg);
  2740. }
  2741. return 1;
  2742. }
  2743. else
  2744. {
  2745. if (!isnull(params))
  2746. {
  2747. new msg[128];
  2748. // Echo the formatted message
  2749. format(msg, sizeof(msg), "02[-] 07%s: %s", user, params);
  2750. IRC_GroupSay(groupID, channel, msg);
  2751. format(msg, sizeof(msg), "[-] %s: %s", user, params);
  2752. SendClientMessageToAll(-1, msg);
  2753. }
  2754. return 1;
  2755. }
  2756. }
  2757.  
  2758.  
  2759. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  2760. {
  2761. // Check if the user is at least a halfop in the channel
  2762. if (IRC_IsHalfop(botid, channel, user))
  2763. {
  2764. new playerid, reason[64];
  2765. // Check if the user at least entered a player ID
  2766. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  2767. {
  2768. return 1;
  2769. }
  2770. // Check if the player is connected
  2771. if (IsPlayerConnected(playerid))
  2772. {
  2773. // Echo the formatted message
  2774. new msg[128], name[MAX_PLAYER_NAME];
  2775. GetPlayerName(playerid, name, sizeof(name));
  2776. format(msg, sizeof(msg), "02*** %s has been freezed by %s on IRC. (%s)", name, user, reason);
  2777. IRC_GroupSay(groupID, channel, msg);
  2778. format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been freezed by %s on IRC. (%s)", name, user, reason);
  2779. ASCM(msg);
  2780. // freeze the player
  2781. TogglePlayerControllable(playerid, 0);
  2782. }
  2783. }
  2784. return 1;
  2785. }
  2786.  
  2787. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  2788. {
  2789. // Check if the user is at least a halfop in the channel
  2790. if (IRC_IsHalfop(botid, channel, user))
  2791. {
  2792. new playerid, reason[64];
  2793. // Check if the user at least entered a player ID
  2794. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  2795. {
  2796. return 1;
  2797. }
  2798. // Check if the player is connected
  2799. if (IsPlayerConnected(playerid))
  2800. {
  2801. // Echo the formatted message
  2802. new msg[128], name[MAX_PLAYER_NAME];
  2803. GetPlayerName(playerid, name, sizeof(name));
  2804. format(msg, sizeof(msg), "02*** %s has been unfreezed by %s on IRC. (%s)", name, user, reason);
  2805. IRC_GroupSay(groupID, channel, msg);
  2806. format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been unfreezed by %s on IRC. (%s)", name, user, reason);
  2807. ASCM(msg);
  2808. // freeze the player
  2809. TogglePlayerControllable(playerid, 1);
  2810. }
  2811. }
  2812. return 1;
  2813. }
  2814.  
  2815. IRCCMD:kill(botid, channel[], user[], host[], params[])
  2816. {
  2817. // Check if the user is at least a halfop in the channel
  2818. if (IRC_IsHalfop(botid, channel, user))
  2819. {
  2820. new playerid, reason[64];
  2821. // Check if the user at least entered a player ID
  2822. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  2823. {
  2824. return 1;
  2825. }
  2826. // Check if the player is connected
  2827. if (IsPlayerConnected(playerid))
  2828. {
  2829. // Echo the formatted message
  2830. new msg[128], name[MAX_PLAYER_NAME];
  2831. GetPlayerName(playerid, name, sizeof(name));
  2832. format(msg, sizeof(msg), "02*** %s has been killed by %s on IRC. (%s)", name, user, reason);
  2833. IRC_GroupSay(groupID, channel, msg);
  2834. format(msg, sizeof(msg), ""YE"*Admin Notice: "W"%s has been killed by %s on IRC. (%s)", name, user, reason);
  2835. ASCM(msg);
  2836. // Kill the player
  2837. SetPlayerHealth(playerid, 0);
  2838. }
  2839. }
  2840. return 1;
  2841. }
  2842.  
  2843. IRCCMD:kick(botid, channel[], user[], host[], params[])
  2844. {
  2845. // Check if the user is at least a halfop in the channel
  2846. if (IRC_IsHalfop(botid, channel, user))
  2847. {
  2848. new id,reason[50],string[300], str[300];
  2849. if(sscanf(params,"us[178]",id, reason)) return IRC_Say(groupID, channel, "7Usage: 1!kick [ID] [reason]");
  2850. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was Kicked by %s For: %s", GetName(id), id, user, reason);
  2851. ASCM(string);
  2852. for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
  2853. TogglePlayerControllable(id, 0);
  2854. SendClientMessage(id, -1,""R"You have been kicked from San Andreas Playground");
  2855. format(str, sizeof(str), "You were kicked by: "R"%s "W"with given a reason : "R"%s",user, reason);
  2856. SendClientMessage(id, -1, str);
  2857. SendClientMessage(id, -1, "if You Think You are Kick by unfair ! Feel Free to create a report in our forum ");
  2858. SetTimerEx("DelayKick", 1000, false, "i", id);
  2859. }
  2860. return 1;
  2861. }
  2862.  
  2863. IRCCMD:ban(botid, channel[], user[], host[], params[])
  2864. {
  2865. // Check if the user is at least an op in the channel
  2866. if (IRC_IsOp(botid, channel, user))
  2867. {
  2868. new IPx[16];
  2869. new id,reason[50],string[300], str[300];
  2870. if(sscanf(params,"us[200]",id, reason)) return IRC_Say(groupID, channel, "7Usage: 1!ban [ID] [reason]");
  2871. GetPlayerIp(id, IPx, sizeof(IPx));
  2872. format(string,sizeof(string),""YE"*Admin Notice: "W"Player %s (Id: %d) was banned by %s For: %s", GetName(id), id, user, reason);
  2873. ASCM(string);
  2874. for(new i = 0; i < 50; i++) SendClientMessage(id, -1,"");
  2875. TogglePlayerControllable(id, 0);
  2876. SendClientMessage(id, -1,""R"You are Currently Banned From San Andreas Playground");
  2877. format(str, sizeof(str), "You are Banned by Administrator : "R"%s "W"with given a reason : "R"%s", user, reason);
  2878. SendClientMessage(id, -1, str);
  2879. SendClientMessage(id, -1, "if You Think This Ban was unfair ! Feel Free to create a ban appeal in our forum ");
  2880. new querylist[512];
  2881. format(querylist, sizeof(querylist), "INSERT INTO `banlist`(`name`, `ip`, `Admin`, `Reason`) VALUES('%s', '%s', '%s', '%s')", GetName(id), IPx, user, reason);
  2882. mysql_query(yadmin, querylist);
  2883. SetTimerEx("DelayBan", 1000, false, "i", id);
  2884. }
  2885. return 1;
  2886. }
  2887.  
  2888. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  2889. {
  2890. // Check if the user is at least an op in the channel
  2891. if (IRC_IsOwner(botid, channel, user))
  2892. {
  2893. // Check if the user entered any text
  2894. if (!isnull(params))
  2895. {
  2896. // Check if the user did not enter any invalid commands
  2897. if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
  2898. {
  2899. // Echo the formatted message
  2900. new msg[128];
  2901. format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  2902. IRC_GroupSay(groupID, channel, msg);
  2903. // Send the command
  2904. SendRconCommand(params);
  2905. }
  2906. }
  2907. }
  2908. return 1;
  2909. }
  2910. IRCCMD:pm(botid, channel[], user[], host[], params[])
  2911. {
  2912. new string[128], str1[128], ppid, pname[MAX_PLAYER_NAME];
  2913. if(sscanf(params, "us[100]", ppid, str1))
  2914. {
  2915. IRC_Say(groupID, channel, "Usage: !pm [ID] [message]");
  2916. return 1;
  2917. }
  2918. if(!IsPlayerConnected(ppid)) return IRC_Say(groupID, channel, "Invalid Player ID.");
  2919. {
  2920. GetPlayerName(ppid, pname, sizeof(pname));
  2921. format(string, sizeof(string), "4PM To: %s(ID %d): %s", pname, ppid, str1);
  2922. IRC_Say(groupID, user, string);
  2923. format(str1, sizeof(str1), "*PM From [IRC]%s : %s", user, str1);
  2924. SendClientMessage(ppid, COLOR_ORANGE, str1);
  2925. }
  2926. return 1;
  2927. }
  2928. IRCCMD:slap(botid, channel[], user[], host[], params[])
  2929. {
  2930. new sid, str[128], str2[128], pname[MAX_PLAYER_NAME], Float:slapx, Float:slapy, Float:slapz;
  2931. if(!IRC_IsHalfop(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level");
  2932. {
  2933. if(sscanf(params, "us[128]", sid, str))
  2934. {
  2935. IRC_Say(groupID, channel, "7Usage: 1!slap [ID] [reason]");
  2936. }
  2937. if(!IsPlayerConnected(sid)) return IRC_Say(groupID, channel, "7Error: 1Player Logged off");
  2938. GetPlayerName(sid, pname, sizeof(pname));
  2939. format(str2, sizeof(str2), " 1*%s Has Been Slapped By 3,9IRC Administrator1 %s - 4Reason:1 %s", pname, user, str);
  2940. IRC_Say(groupID, channel, str2);
  2941. GetPlayerPos(sid, slapx, slapy, slapz);
  2942. SetPlayerPos(sid, slapx, slapy, slapz+10);
  2943. }
  2944. return 1;
  2945. }
  2946. IRCCMD:givecash(botid, channel[], user[], host[], params[])
  2947. {
  2948. new gcid, amount, pname[MAX_PLAYER_NAME];
  2949. if(!IRC_IsOp(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level");
  2950. if(sscanf(params,"ui", gcid, amount)) return IRC_Say(groupID, channel, "7Usage: 1!givecash [ID] [Amount]");
  2951. if(!IsPlayerConnected(gcid)) return IRC_Say(groupID, channel, "Invalid Player ID.");
  2952. GetPlayerName(gcid, pname, sizeof(pname));
  2953. GivePlayerMoney(gcid, amount);
  2954. return 1;
  2955. }
  2956.  
  2957. IRCCMD:cmds(botid, channel[], user[], host[], params[])
  2958. {
  2959. if(!strcmp(channel, channel, true))
  2960. {
  2961. IRC_Say(botid, user, "04 [IRC Commands] ");
  2962. IRC_Say(groupID, user, "| User: !pm !players !say ");
  2963. {
  2964. if(IRC_IsHalfop(botid, channel, user))
  2965. {
  2966. IRC_Say(groupID, user, "| Moderators: !slap !kick !clearchat !warn !getip");
  2967. }
  2968. if(IRC_IsOp(botid, channel, user))
  2969. {
  2970. IRC_Say(groupID, user, "| Administrators: !explode !ban !givecash !freeze !unfreeze !setwanted !loc !givemoderator");
  2971. }
  2972. if(IRC_IsAdmin(botid, channel, user))
  2973. {
  2974. IRC_Say(groupID, user, "| Managements: !cprotect !crestore ");
  2975. }
  2976. if(IRC_IsOwner(botid, channel, user))
  2977. {
  2978. IRC_Say(groupID, user, "| Owner: !restart !rcon !setlevel ");
  2979. }
  2980. }
  2981. }
  2982. return 1;
  2983. }
  2984. IRCCMD:restart(botid, channel[], user[], host[], params[])
  2985. {
  2986. if(!IRC_IsOwner(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
  2987. SendRconCommand("gmx");
  2988. return 1;
  2989. }
  2990. IRCCMD:cprotect(botid, channel[], user[], host[], params[])
  2991. {
  2992. if(!IRC_IsAdmin(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
  2993. new pmode[50];
  2994. format(pmode, sizeof(pmode), "mode %s +miRCp", channel);
  2995. IRC_SendRaw(botid, pmode);
  2996. return 1;
  2997. }
  2998. IRCCMD:crestore(botid, channel[], user[], host[], params[])
  2999. {
  3000. if(!IRC_IsAdmin(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
  3001. new pmode[50];
  3002. format(pmode, sizeof(pmode), "mode %s -miRCp", channel);
  3003. IRC_SendRaw(botid, pmode);
  3004. return 1;
  3005. }
  3006. IRCCMD:explode(botid, channel[], user[], host[], params[])
  3007. {
  3008. if(!IRC_IsOp(botid, channel, user)) return IRC_Say(groupID, channel, "Invalid Level.");
  3009. new exid, reason[80]; new pname[MAX_PLAYER_NAME];
  3010. if(sscanf(params, "uS(No Reason)[80]", exid, reason))
  3011. {
  3012. IRC_GroupSay(groupID, user, "04USAGE: !explode [ID] [Reason]");
  3013. return 1;
  3014. }
  3015. if(!IsPlayerConnected(exid))
  3016. {
  3017. IRC_GroupSay(groupID, user, "04ERROR: Invalid Player ID");
  3018. return 1;
  3019. }
  3020. new Float:ircx, Float:ircy, Float:ircz, string[100], str2[100];
  3021. GetPlayerPos(exid, ircx, ircy, ircz);
  3022. CreateExplosion(ircx, ircy, ircz, 6, 10);
  3023. CreateExplosion(ircx, ircy, ircz, 6, 10);
  3024. GetPlayerName(exid, pname, sizeof(pname));
  3025. format(string, sizeof(string), ""YE"*Admin Notice: "W"IRC Administrator %s Has Exploded %s(%d) - Reason: %s", user, pname, exid, reason);
  3026. ASCM(string);
  3027. format(str2, sizeof(str2), "4(EXPLOSION):1 IRC Admin %s Exploded %s(%d) - Reason: %s", user, pname, exid, reason);
  3028. IRC_Say(groupID, IRCChannel, str2);
  3029. return 1;
  3030. }
  3031. IRCCMD:getip(botid, channel[], user[], host[], params[])//ReV
  3032. {
  3033. if(!IRC_IsHalfop(botid, channel, user)) return false;
  3034. new giveplayerid, ip[16], str[128];
  3035. new dfgiveplayer[MAX_PLAYER_NAME];
  3036. if(sscanf(params, "i", giveplayerid))
  3037. {
  3038. IRC_GroupSay(groupID, IRCChannel, "Usage: !getip [playerid]");
  3039. return false;
  3040. }
  3041. GetPlayerName(giveplayerid, dfgiveplayer, sizeof(dfgiveplayer));
  3042. GetPlayerIp(giveplayerid, ip, sizeof(ip));
  3043.  
  3044. if(!IsPlayerConnected(giveplayerid))
  3045. {
  3046. IRC_GroupSay(groupID, channel, "4Error:3 Invalid Player ID!");
  3047. return 1;
  3048. }
  3049.  
  3050. format(str, 128, "2Player:1 %s(%i) 4IP:1 Is %s", dfgiveplayer, giveplayerid, ip);
  3051. IRC_GroupSay(groupID, channel, str);
  3052.  
  3053. #pragma unused botid, user
  3054. return true;
  3055. }
  3056. IRCCMD:players(conn, channel[], user[], params[]) //made by Grove, taken from CYS Echo Bot 1.2
  3057. {
  3058. new count, PlayerNames[512], string[256];
  3059. for(new i=0; i<=MAX_PLAYERS; i++)
  3060. {
  3061. if(IsPlayerConnected(i))
  3062. {
  3063. if(count == 0)
  3064. {
  3065. new PlayerName1[MAX_PLAYER_NAME];
  3066. GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  3067. format(PlayerNames, sizeof(PlayerNames),"2%s1", PlayerName1);
  3068. count++;
  3069. }
  3070. else
  3071. {
  3072. new PlayerName1[MAX_PLAYER_NAME];
  3073. GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  3074. format(PlayerNames, sizeof(PlayerNames),"%s, 2%s1", PlayerNames, PlayerName1);
  3075. count++;
  3076. }
  3077. }
  3078. else { if(count == 0) format(PlayerNames, sizeof(PlayerNames), "1No Players Online!"); }
  3079. }
  3080.  
  3081. new counter = 0;
  3082. for(new i=0; i<=MAX_PLAYERS; i++)
  3083. {
  3084. if(IsPlayerConnected(i)) counter++;
  3085. }
  3086.  
  3087. format(string, 256, "5Connected Players[%d]:1 %s", counter, PlayerNames);
  3088. IRC_Say(conn, channel, string);
  3089. #pragma unused params,user
  3090. return true;
  3091. }
  3092. IRCCMD:clearchat(conn, channel[], user[], message[])
  3093. {
  3094. if(IRC_IsHalfop(conn, channel, user) == 0) return IRC_Say(conn, channel, "Invalid Level");
  3095. {
  3096. for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_WHITE, "");
  3097. }
  3098. new string[256];
  3099. format(string, sizeof(string), "An IRC Administrator %s has cleared the chat", user);
  3100.  
  3101. SendClientMessageToAll(COLOR_WHITE, string);
  3102. IRC_Say(conn, channel, string);
  3103.  
  3104. #pragma unused message
  3105. return 1;
  3106. }
  3107.  
  3108. IRCCMD:setlevel(botid, channel[], user[], host[], params[])
  3109. {
  3110. if(IRC_IsOwner(botid, channel, user) == 0) return IRC_Say(groupID, channel, "Invalid Level");
  3111. new id, level;
  3112. if(sscanf(params,"ii", id, level)) return IRC_Say(groupID, channel, "7Usage: 1!setlevel [playerid] [Level]");
  3113. if(PlayerInfo[id][Level] == level) return IRC_Say(groupID, channel, "7Error: 1This Player Already have this level !");
  3114. if(!IsPlayerConnected(id)) return IRC_Say(groupID, channel, "4Error: This Player Logged off !");
  3115. if(level > 3 || level < 0 || level == 1) return IRC_Say(groupID, channel, "4Error: There just 2 perm Levels! (Moderator Not include !)");
  3116. PlayerInfo[id][Level] = level;
  3117. if(PlayerInfo[id][Level] == 3)
  3118. {
  3119. new str[150];
  3120. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Manager By %s on IRC", GetName(id), id, user);
  3121. MSCM(str);
  3122. IRC_Say(groupID, channel, "7Success: 1this player is an manager now!");
  3123. }
  3124. if(PlayerInfo[id][Level] == 0)
  3125. {
  3126. new str[150];
  3127. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Demonted to an Player By %s on IRC", GetName(id), id, user);
  3128. MSCM(str);
  3129. IRC_Say(groupID, channel, "7Success: 1this staff member is an player now!");
  3130. }
  3131. if(PlayerInfo[id][Level] == 2)
  3132. {
  3133. new str[150];
  3134. format(str, sizeof(str), ""G"*Manager Notice: "W"%s (Id: %d) Has been Promoted to an Administrator By %s (on IRC", GetName(id), id, user);
  3135. MSCM(str);
  3136. IRC_Say(groupID, channel, "7Success: 1this player is an administrator now!");
  3137. }
  3138. return 1;
  3139. }
  3140.  
  3141. IRCCMD:givemoderator(botid, channel[], user[], host[], params[])
  3142. {
  3143. new id;
  3144. if(IRC_IsOp(botid, channel, user))
  3145. {
  3146. if(sscanf(params,"i",id)) return IRC_Say(groupID, channel, "7Usage: 1!givemoderator [playerid]");
  3147. PlayerInfo[id][Level] = 1;
  3148. SendClientMessage(id, -1, ""YE"An administrator has granted you moderator rights!");
  3149. new str[150];
  3150. format(str, sizeof(str), ""YE"*Admin Notice: "W"%s has granted moderator rights to %s (Id: %d)", user, GetName(id), id);
  3151. ASCM(str);
  3152. IRC_Say(groupID, channel, "7Success: 1this player is an moderator now!");
  3153. SetPlayerColor(id, 0xFFFF00AA);
  3154. }
  3155. else return IRC_Say(groupID, channel, "Invalid Level");
  3156. return 1;
  3157. }
  3158.  
  3159. IRCCMD:admin(botid, channel[], user[], host[], params[])
  3160. {
  3161. new msg[100], str[100];
  3162. if(IRC_IsAdmin(botid, channel, user))
  3163. {
  3164. if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
  3165. format(str, sizeof(str), ""YE"*Manager(%s)on IRC: %s", user, params);
  3166. ASCM(str);
  3167. return 1;
  3168. }
  3169. if(IRC_IsOp(botid, channel, user))
  3170. {
  3171. if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
  3172. format(str, sizeof(str), ""YE"*Admin(%s)on IRC: %s", user, params);
  3173. ASCM(str);
  3174. return 1;
  3175. }
  3176. if(IRC_IsHalfop(botid, channel, user))
  3177. {
  3178. if(sscanf(params,"s[100]",msg)) return IRC_Say(groupID, channel, "7Usage: 1!admin [message]");
  3179. format(str, sizeof(str), ""YE"*Moderator(%s)on IRC: %s", user, params);
  3180. ASCM(str);
  3181. return 1;
  3182. }
  3183. else return IRC_Say(groupID, channel, "Error: Invalid Level");
  3184. }
  3185.  
  3186.  
  3187. public onMySQLCheck(playerid)
  3188. {
  3189. new
  3190. rows, str[200];
  3191.  
  3192. cache_get_row_count(rows);
  3193. if(rows == 1)
  3194. {
  3195. cache_get_value_name(0, "Password", PlayerInfo[playerid][Password], 129);
  3196. ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Login", "Welcome !\nthis account already registred. Please fill in your password:", "Login", "Quit");
  3197.  
  3198. SendClientMessage(playerid, COLOR_BLUE, "-------------------------------------------------------------------------------------------------------------");
  3199. format(str, sizeof(str), "* Welcome back %s, to "SERVNAME" ...", GetName(playerid));
  3200. SendClientMessage(playerid, COLOR_GREEN, str);
  3201. SendClientMessage(playerid, COLOR_GREEN, "* Your account is already registered on the server, type your password into the dialog box displayed below.");
  3202. SendClientMessage(playerid, COLOR_GREEN, "* Visit our website/forums at "SERVWEB"");
  3203. SendClientMessage(playerid, COLOR_GREEN, "* Have Fun !");
  3204. SendClientMessage(playerid, COLOR_BLUE, "-------------------------------------------------------------------------------------------------------------");
  3205. return 1;
  3206. }
  3207. else
  3208. {
  3209. SendClientMessage(playerid, COLOR_BLUE, " ---------------------------------------------------------------------------------------------------------------");
  3210. format(str, sizeof(str), "* Welcome %s, to the "SERVNAME".", GetName(playerid));
  3211. SendClientMessage(playerid, COLOR_GREEN, str);
  3212. format(str, sizeof(str), "* Your name (%s) is not registered...", GetName(playerid));
  3213. SendClientMessage(playerid, COLOR_GREEN, str);
  3214. SendClientMessage(playerid, COLOR_GREEN, "* Please register your account with entring a password on the box below");
  3215. SendClientMessage(playerid, COLOR_GREEN, "* If you register then you will get money from your Propertys and access to more features!");
  3216. SendClientMessage(playerid, COLOR_GREEN, "* We have many commands here at "SERVNAME"..type /commands or /cmds to learn more.");
  3217. SendClientMessage(playerid, COLOR_GREEN, "* Use your money wisely and go buy a Propertys and make some more money");
  3218. SendClientMessage(playerid, COLOR_GREEN, "* Stick with the server rules and enjoy gaming here!");
  3219. SendClientMessage(playerid, COLOR_GREEN, "* Visit our website/forums at "SERVWEB"");
  3220. SendClientMessage(playerid, COLOR_GREEN, "* Have Fun !");
  3221. SendClientMessage(playerid, COLOR_BLUE, "-----------------------------------------------------------------------------------------------------------------");
  3222.  
  3223. new RegisterDS[1024];
  3224. format(RegisterDS, sizeof(RegisterDS),""W"Welcome to "SERVNAME""YE"%s\n\n", GetName(playerid));
  3225. strcat(RegisterDS,""W"You are not registered yet on this server,\n");
  3226. strcat(RegisterDS,""W"Enter your password below to register\n");
  3227. strcat(RegisterDS,""W"By registering all your statistics will be saved in server database!\n\n");
  3228. strcat(RegisterDS,""R"Info"W":\n");
  3229. strcat(RegisterDS,""R"- "W"Your password must contain at least 4 characters\n");
  3230. strcat(RegisterDS,""R"- "W"Remember your password, you will need it for your next login\n");
  3231. ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, ""R" "W"SAP Register Account", RegisterDS, "Register","" );
  3232. }
  3233. return 1;
  3234. }
  3235.  
  3236.  
  3237. public TimeOnServer()
  3238. {
  3239. for(new i=0; i<MAX_PLAYERS; i++)
  3240. {
  3241. if(IsPlayerConnected(i))
  3242. {
  3243. PlayerInfo[i][Minutes] ++;
  3244. if(PlayerInfo[i][Minutes] == 60)
  3245. {
  3246. PlayerInfo[i][Minutes] =0;
  3247. PlayerInfo[i][Hours] ++;
  3248. GivePlayerMoney(i, 10000);
  3249. SendClientMessage(i, -1, ""R"[SERVER]: "GRI"You earned $ 10000 after staying 1 hour in server whitout leaving !");
  3250. }
  3251. }
  3252. }
  3253. return 1;
  3254. }
  3255.  
  3256. public destroy(playerid)
  3257. {
  3258. if(CRamp[playerid]==true)
  3259. {
  3260. DestroyObject(Ramp[playerid]), CRamp[playerid] = false;
  3261. return 1;
  3262. }
  3263. else
  3264. return 0;
  3265. }
  3266.  
  3267. public DelayBan(playerid)
  3268. {
  3269. PlayerInfo[playerid][Bans]++;
  3270. Kick(playerid);
  3271. return 1;
  3272. }
  3273.  
  3274. public DelayKick(playerid)
  3275. {
  3276. PlayerInfo[playerid][Kicks]++;
  3277. Kick(playerid);
  3278. return 1;
  3279. }
  3280.  
  3281. public unmuteTimer(playerid)
  3282. {
  3283. muted[playerid] = 0;
  3284. return SendClientMessage(playerid,0x00FF0000,"You're no longer muted!");
  3285. }
  3286.  
  3287. public unjail(playerid, reason)
  3288. {
  3289. SpawnPlayer(playerid);
  3290. IsJailed[playerid] = 0;
  3291. return 1;
  3292. }
  3293.  
  3294. stock GetName(playerid)
  3295. {
  3296. new szName[MAX_PLAYER_NAME];
  3297. GetPlayerName(playerid, szName, sizeof(szName));
  3298. return szName;
  3299. }
  3300.  
  3301. stock ASCM(string[])
  3302. {
  3303. foreach(new i : Player)
  3304. {
  3305. if(PlayerInfo[i][Level] >= 1 || IsPlayerAdmin(i))
  3306. {
  3307. SendClientMessage(i, -1, string);
  3308. }
  3309. }
  3310. return 1;
  3311. }
  3312.  
  3313. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) // credits to kc
  3314. {
  3315. new Float:a;
  3316. GetPlayerPos(playerid, x, y, a);
  3317. GetPlayerFacingAngle(playerid, a);
  3318. if (GetPlayerVehicleID(playerid))
  3319. {
  3320. GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  3321. }
  3322. x += (distance * floatsin(-a, degrees));
  3323. y += (distance * floatcos(-a, degrees));
  3324. }
  3325.  
  3326.  
  3327. IRC_SendMessageToAdmins(level,const string[]) // Credits to iLearner
  3328. {
  3329. new levelbeen[5];
  3330. new levelstring[80];
  3331. if (level < 1 || level > 5) printf("*** IRC_SendMessageToAdmins: Invalid level. level: %d Message: %s", level, string);
  3332. switch(level)
  3333. {
  3334. case 1:{levelbeen="+";}
  3335. case 2:{levelbeen="%";}
  3336. case 3:{levelbeen="@";}
  3337. case 4:{levelbeen="&";}
  3338. case 5:{levelbeen="~";}
  3339. }
  3340. format(levelstring,sizeof(levelstring),"%s%s",levelbeen, IRCChannel);
  3341. IRC_GroupSay(groupID,levelstring,string);
  3342. return 1;
  3343. }
  3344. stock SendVirtualMessage(virtualworld, color, string[])
  3345. {
  3346. for(new i =0; i<GetMaxPlayers();i++)
  3347. {
  3348. if(IsPlayerConnected(i))
  3349. {
  3350. // You can do this, if u want:
  3351. //if(IsLoggedIn[i] == 1) or what ever.
  3352. if(GetPlayerVirtualWorld(i) == virtualworld)
  3353. {
  3354. SendClientMessage(i, color, string);
  3355. }
  3356. }
  3357. }
  3358. return 1;
  3359. }
  3360.  
  3361. stock MSCM(string[])
  3362. {
  3363. foreach(new i : Player)
  3364. {
  3365. if(PlayerInfo[i][Level] == 3 || IsPlayerAdmin(i))
  3366. {
  3367. SendClientMessage(i, -1, string);
  3368. }
  3369. }
  3370. return 1;
  3371. }
  3372. stock VSCM(string[])
  3373. {
  3374. foreach(new i : Player)
  3375. {
  3376. if(PlayerInfo[i][VIP] > 0 || PlayerInfo[i][Level] > 0)
  3377. {
  3378. SendClientMessage(i, -1, string);
  3379. }
  3380. }
  3381. return 1;
  3382. }
  3383.  
  3384. /*** Fly Include By Norck ***/
  3385.  
  3386.  
  3387.  
  3388. InitFly(playerid)
  3389. {
  3390. OnFly[playerid] = false;
  3391. return;
  3392. }
  3393. /*
  3394. bool:StartFly(playerid)
  3395. {
  3396. if(OnFly[playerid])
  3397. return false;
  3398. OnFly[playerid] = true;
  3399. new Float:x,Float:y,Float:z;
  3400. GetPlayerPos(playerid,x,y,z);
  3401. SetPlayerPos(playerid,x,y,z+5.0);
  3402. ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
  3403. Fly(playerid);
  3404. GameTextForPlayer(playerid,"~y~Fly mode~n~~r~~k~~PED_FIREWEAPON~ ~w~- increase height~n~~r~RMB ~w~- reduce height~n~\
  3405. ~r~~k~~PED_SPRINT~ ~w~- increase speed~n~\
  3406. ~r~~k~~SNEAK_ABOUT~ ~w~- reduce speed",10000,3);
  3407. return true;
  3408. }
  3409. */
  3410. public Fly(playerid)
  3411. {
  3412. if(!IsPlayerConnected(playerid))
  3413. return 1;
  3414. new k, ud,lr;
  3415. GetPlayerKeys(playerid,k,ud,lr);
  3416. new Float:v_x,Float:v_y,Float:v_z,
  3417. Float:x,Float:y,Float:z;
  3418. if(ud < 0) // forward
  3419. {
  3420. GetPlayerCameraFrontVector(playerid,x,y,z);
  3421. v_x = x+0.1;
  3422. v_y = y+0.1;
  3423. }
  3424. if(k & 128) // down
  3425. v_z = -0.2;
  3426. else if(k & KEY_FIRE) // up
  3427. v_z = 0.2;
  3428. if(k & KEY_WALK) // slow
  3429. {
  3430. v_x /=5.0;
  3431. v_y /=5.0;
  3432. v_z /=5.0;
  3433. }
  3434. if(k & KEY_SPRINT) // fast
  3435. {
  3436. v_x *=4.0;
  3437. v_y *=4.0;
  3438. v_z *=4.0;
  3439. }
  3440. if(v_z == 0.0)
  3441. v_z = 0.025;
  3442. SetPlayerVelocity(playerid,v_x,v_y,v_z);
  3443. if(v_x == 0 && v_y == 0)
  3444. {
  3445. if(GetPlayerAnimationIndex(playerid) == 959)
  3446. ApplyAnimation(playerid,"PARACHUTE","PARA_steerR",6.1,1,1,1,1,0,1);
  3447. }
  3448. else
  3449. {
  3450. GetPlayerCameraFrontVector(playerid,v_x,v_y,v_z);
  3451. GetPlayerCameraPos(playerid,x,y,z);
  3452. SetPlayerLookAt(playerid,v_x*500.0+x,v_y*500.0+y);
  3453. if(GetPlayerAnimationIndex(playerid) != 959)
  3454. ApplyAnimation(playerid,"PARACHUTE","FALL_SkyDive_Accel",6.1,1,1,1,1,0,1);
  3455. }
  3456. if(OnFly[playerid])
  3457. SetTimerEx("Fly",100,false,"i",playerid);
  3458. return 1;
  3459. }
  3460.  
  3461. bool:StopFly(playerid)
  3462. {
  3463. if(!OnFly[playerid])
  3464. return false;
  3465. new Float:x,Float:y,Float:z;
  3466. GetPlayerPos(playerid,x,y,z);
  3467. SetPlayerPos(playerid,x,y,z);
  3468. OnFly[playerid] = false;
  3469. return true;
  3470. }
  3471. stock IsValidSkin(SkinID)
  3472. {
  3473. if((SkinID >= 0 && SkinID <= 2)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
  3474. else return false;
  3475. }
  3476.  
  3477. static SetPlayerLookAt(playerid,Float:x,Float:y)
  3478. {
  3479. new Float:Px, Float:Py, Float: Pa;
  3480. GetPlayerPos(playerid, Px, Py, Pa);
  3481. Pa = floatabs(atan((y-Py)/(x-Px)));
  3482. if (x <= Px && y >= Py) Pa = floatsub(180.0, Pa);
  3483. else if (x < Px && y < Py) Pa = floatadd(Pa, 180.0);
  3484. else if (x >= Px && y <= Py) Pa = floatsub(360.0, Pa);
  3485. Pa = floatsub(Pa, 90.0);
  3486. if (Pa >= 360.0)
  3487. Pa = floatsub(Pa, 360.0);
  3488. SetPlayerFacingAngle(playerid, Pa);
  3489. return;
  3490. }
Advertisement
Add Comment
Please, Sign In to add comment