Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 113.29 KB | None | 0 0
  1. // Asassins creed Roleplay..
  2.  
  3.  
  4. //-----[Main includes]-----
  5. #include <a_samp>
  6. #include <YSI\y_ini>
  7. #include <streamer>
  8. #include <zcmd>
  9. #include <sscanf2>
  10. #include <irc>
  11. #include <foreach>
  12. #pragma tabsize 0
  13.  
  14. //-----[IRC Settings]-----
  15. #define IRC_SERVER "irc.crystalirc.net"
  16. #define IRC_PORT (6667)
  17. #define IRC_CHANNEL "#Warehouse"
  18.  
  19. #define BOT_1_NICKNAME "SA-MP Bot[1]"
  20. #define BOT_1_REALNAME "SA-MP Bot[1]"
  21. #define BOT_1_USERNAME "SA-MP Bot[1]"
  22.  
  23. #define MAX_BOTS (1)
  24.  
  25. new gBotID[MAX_BOTS], gGroupID;
  26. new QuizAnswers[MAX_PLAYERS];
  27. new String[128], Float:SpecX[MAX_PLAYERS], Float:SpecY[MAX_PLAYERS], Float:SpecZ[MAX_PLAYERS], vWorld[MAX_PLAYERS], Inter[MAX_PLAYERS];
  28. new IsSpecing[MAX_PLAYERS], Name[MAX_PLAYER_NAME], IsBeingSpeced[MAX_PLAYERS],spectatorid[MAX_PLAYERS];
  29.  
  30. new OldSkin;
  31.  
  32. //-----[INI includes]-----
  33. #define DIALOG_REGISTER 1
  34. #define DIALOG_LOGIN 2
  35. #define DIALOG_RULES 1113
  36. #define PATH "/Users/%s.ini"
  37.  
  38. //-----[Color defines]-----
  39. #define COLOR_WHITE 0xFFFFFFFF
  40. #define COLOR_GREEN 0x33AA33AA
  41. #define COLOR_RED 0xA10000AA
  42. #define COLOR_YELLOW 0xFFFF00AA
  43. #define COLOR_GREY 0xAFAFAFAA
  44. #define COLOR_SYNTAX 0x33CCFFAA
  45. #define COLOR_ERROR 0xFF3300AA
  46. #define LIME 0x88AA62FF
  47. #define WHITE 0xFFFFFFAA
  48. #define RULE 0xFBDF89AA
  49. #define ORANGE 0xDB881AAA
  50. #define COLOR_YELLOW3 0xFFFF00FF
  51. #define GetPlayerCash(%0) GetPVarInt(%0, "Cash")
  52. #define GREY 0xAFAFAFAA
  53. #define GREEN 0x9FFF00FF
  54. #define RED 0xA10000AA
  55. #define YELLOW 0xFFFF00AA
  56. #define WHITE 0xFFFFFFAA
  57. #define COLOR_ME 0xC2A2DAAA
  58. #define Grey 0xC0C0C0FF
  59.  
  60.  
  61. //-----[0.3c Color defines]-----
  62. #define COL_EASY "{FFF1AF}"
  63. #define COL_DGREEN "{0E8C00}"
  64. #define COL_LOGIN "{98E090}"
  65. #define COL_WHITE "{FFFFFF}"
  66. #define COL_BLACK "{0E0101}"
  67. #define COL_GREY "{C3C3C3}"
  68. #define COL_GREEN "{6EF83C}"
  69. #define COL_RED "{F81414}"
  70. #define COL_YELLOW "{F3FF02}"
  71. #define COL_ORANGE "{F9B857}"
  72. #define COL_LIME "{B7FF00}"
  73. #define COL_CYAN "{00FFEE}"
  74. #define COL_LBLUE "{298ACF}"
  75. #define COL_BLUE "{0049FF}"
  76. #define COL_MAGENTA "{F300FF}"
  77. #define COL_VIOLET "{B700FF}"
  78. #define COL_PINK "{FF00EA}"
  79. #define COL_MARONE "{A90202}"
  80. #define COL_CMD "{B8FF02}"
  81. #define COL_PARAM "{3FCD02}"
  82. #define COL_SERVER "{AFE7FF}"
  83. #define COL_VALUE "{A3E4FF}"
  84. #define COL_RULE "{F9E8B7}"
  85. #define COL_RULE2 "{FBDF89}"
  86. #define COL_RWHITE "{FFFFFF}"
  87. #define COL_LGREEN "{9FE4AA}"
  88. #define COL_LRED "{DA7272}"
  89. #define COL_LRED2 "{C77D87}"
  90. #define COL_DYELLOW "{FAFA52}"
  91. #define COL_BROWN "{8C703F}"
  92. #define COL_SBLACK "{474747}"
  93. #define COL_SGREY "{ADADAD}"
  94. #define COL_DGREY "{616161}"
  95. #define COL_SBLUE "{3660D1}"
  96. //Colors for Local Chat
  97. #define COLOR_FADE1 0xFFFFFFFF
  98. #define COLOR_FADE2 0xC8C8C8C8
  99. #define COLOR_FADE3 0xAAAAAAAA
  100. #define COLOR_FADE4 0x8C8C8C8C
  101. #define COLOR_FADE5 0x6E6E6E6E
  102. #define COLOR_LIGHTGREEN 0x9ACD32AA
  103. #define COLOR_WHITE 0xFFFFFFFF
  104. // Dialog IDs
  105. #define DIALOG_QUIZ 5550
  106. #define DIALOG_QUIZ1 5551
  107. #define DIALOG_QUIZ2 5552
  108. #define DIALOG_QUIZ3 5553
  109. #define DIALOG_QUIZ4 5554
  110. #define DIALOG_STATS 32622
  111. new bool:
  112. ooc;
  113.  
  114. //----------------------------------Forwards----------------------------
  115. forward ABroadCast(color,const string[],level);
  116. forward HBroadCast(color,const string[],level);
  117. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  118. forward ProxDetectorS(Float:radi, playerid, targetid);
  119. forward Timer();
  120.  
  121.  
  122. new Text3D:Admin[ MAX_PLAYERS ], AdminDuty[ MAX_PLAYERS ],
  123. checkinv = 0;
  124. new HelperDuty[MAX_PLAYERS];
  125. new PlayerNeedsHelp[MAX_PLAYERS];
  126. new gTeam[MAX_PLAYERS];
  127.  
  128. new
  129. Float:g_EventPosition[4],
  130. g_EventWeapon = -1,
  131. g_EventReward = 0,
  132. g_EventPlayers = 0,
  133. pInEvent[MAX_PLAYERS] = 0,
  134. g_EventOpen = 0;
  135. //-----[Enum Playerinfo]-----
  136. enum pInfo
  137. {
  138. Password,
  139. Cash,
  140. Level,
  141. Kills,
  142. Faction,
  143. Rank,
  144. Mute,
  145. wolf,
  146. Helperlevel,
  147. Deaths,
  148. Adminlevel,
  149. };
  150.  
  151. new pData[MAX_PLAYERS][pInfo]; //We create a variable that stores our enumerator info for each player.
  152. new PlayerInfo[MAX_PLAYERS][pInfo];
  153.  
  154. main() { }
  155.  
  156. public OnGameModeInit()
  157. {
  158. SetTimer("Timer", 3600000, 1); // Each 10 minutes the Timer will go off.
  159. SetGameModeText("AC:RP");
  160. DisableInteriorEnterExits();
  161. ShowPlayerMarkers(0);
  162. // Humans
  163. AddPlayerClass(29,-2666.0889,1451.5093,55.8099,113.8499,0,0,0,0,0,0); // 104=Skin , 1979.1917 =X ect....
  164. LoadStaticVehiclesFromFile("vehicles.ini");
  165. return 1;
  166. }
  167.  
  168. public OnGameModeExit()
  169. {
  170. IRC_Quit(gBotID[0], "SA-MP bot exiting");
  171. IRC_DestroyGroup(gGroupID);
  172.  
  173. return 1;
  174. }
  175.  
  176. public OnPlayerRequestClass(playerid, classid)
  177. {
  178. SetPlayerPos(playerid, 1743.1090,-1863.6298,13.5748);
  179. SetPlayerCameraPos(playerid, -1026.0826, 549.2408, 149.5275);
  180. SetPlayerCameraLookAt(playerid, -1026.7415, 549.9918, 149.4122);
  181. //SetPlayerTeamFromClass(playerid, classid);
  182. return 1;
  183. }
  184.  
  185. public OnPlayerConnect(playerid)
  186. {
  187. SetPlayerColor(playerid,WHITE);
  188. if(fexist(UserPath(playerid)))
  189. {
  190. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  191. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"AC"#COL_DGREEN"Roleplay "#COL_EASY"(V1)\n\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  192. SpawnPlayer(playerid);
  193. }
  194. else
  195. {
  196. SendClientMessage(playerid, -1,"You will have to pass through a quiz");
  197. ShowPlayerDialog(playerid,DIALOG_QUIZ,DIALOG_STYLE_LIST,"What's MG ?"," Mixing IC into OOC \n OOC into IC \n My grandpa!","Select","Leave Game");
  198. QuizAnswers[playerid] = 0;
  199. }
  200. new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  201. GetPlayerName(playerid, pname, sizeof(pname));
  202. format(string, sizeof(string), "[JOIN] %s has joined the server", pname);
  203. SendClientMessageToAll(COLOR_GREY, string);
  204.  
  205. for(new chat = 0; chat <= 100; chat++)
  206. {
  207. SendClientMessage(playerid,COLOR_WHITE," ");
  208. }
  209.  
  210. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  211. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" » Welcome to Asassins Creed Roleplay. ");
  212. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN" » All good if you see this text. ");
  213. SendClientMessage(playerid,COLOR_WHITE,""#COL_LOGIN"==========================================================================================================");
  214.  
  215. new joinMsg[128], name[MAX_PLAYER_NAME];
  216. GetPlayerName(playerid, name, sizeof(name));
  217. format(joinMsg, sizeof(joinMsg), "02[%d] 03*** %s has joined the server!", playerid, name);
  218. IRC_GroupSay(gGroupID, IRC_CHANNEL, joinMsg);
  219. return 1;
  220. }
  221.  
  222. public OnPlayerDisconnect(playerid, reason)
  223. {
  224. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, disconnects, then turn off the spec mode for the spectator.
  225. {
  226. foreach(Player,i)
  227. {
  228. if(spectatorid[i] == playerid)
  229. {
  230. TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
  231. }
  232. }
  233. }
  234. new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  235. GetPlayerName(playerid, pname, sizeof(pname));
  236. switch(reason)
  237. {
  238. case 0: format(string, sizeof(string), "[LEFT] %s has left the server. (Timeout)", pname);
  239. case 1: format(string, sizeof(string), "[LEFT] %s has left the server. (Leaving)", pname);
  240. case 2: format(string, sizeof(string), "[LEFT] %s has left the server. (Kicked/Banned)", pname);
  241. }
  242. SendClientMessageToAll(COLOR_GREY, string);
  243.  
  244. new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
  245. switch(reason)
  246. {
  247. case 0: reasonMsg = "Timeout";
  248. case 1: reasonMsg = "Leaving";
  249. case 2: reasonMsg = "Kicked";
  250. }
  251. GetPlayerName(playerid, name, sizeof(name));
  252. format(leaveMsg, sizeof(leaveMsg), "02[%d] 03*** %s has left the server! (%s)", playerid, name, reasonMsg);
  253. IRC_GroupSay(gGroupID, IRC_CHANNEL, leaveMsg);
  254.  
  255. new INI:File = INI_Open(UserPath(playerid));
  256. INI_SetTag(File,"data");
  257. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  258. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  259. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  260. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  261. INI_WriteInt(File,"Helperlevel",PlayerInfo[playerid][Helperlevel]);
  262. INI_WriteInt(File,"Level",PlayerInfo[playerid][Level]);
  263. INI_WriteInt(File,"Team",gTeam[playerid]);
  264. INI_WriteInt(File,"Factionid", pData[playerid][Faction]); //Saving using y_ini
  265. INI_WriteInt(File,"Race",pData[playerid][wolf]);
  266. INI_WriteInt(File,"Rank", pData[playerid][Rank]); //Saving using y_ini
  267. INI_Close(File);
  268. return 1;
  269. }
  270. public OnPlayerSpawn(playerid)
  271. {
  272. if(IsSpecing[playerid] == 1)
  273. {
  274. SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
  275. SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
  276. SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
  277. IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
  278. IsBeingSpeced[spectatorid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
  279. }
  280.  
  281. SetPlayerScore(playerid, 1);
  282. return 1;
  283. }
  284.  
  285. public OnPlayerDeath(playerid, killerid, reason)
  286. {
  287. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, dies, then turn off the spec mode for the spectator.
  288. {
  289. foreach(Player,i)
  290. {
  291. if(spectatorid[i] == playerid)
  292. {
  293. TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
  294. }
  295. }
  296. }
  297. new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
  298. GetPlayerName(killerid, killerName, sizeof(killerName));
  299. GetPlayerName(playerid, playerName, sizeof(playerName));
  300. if (killerid != INVALID_PLAYER_ID)
  301. {
  302. switch (reason)
  303. {
  304. case 0: reasonMsg = "Unarmed";
  305. case 1: reasonMsg = "Brass Knuckles";
  306. case 2: reasonMsg = "Golf Club";
  307. case 3: reasonMsg = "Night Stick";
  308. case 4: reasonMsg = "Knife";
  309. case 5: reasonMsg = "Baseball Bat";
  310. case 6: reasonMsg = "Shovel";
  311. case 7: reasonMsg = "Pool Cue";
  312. case 8: reasonMsg = "Katana";
  313. case 9: reasonMsg = "Chainsaw";
  314. case 10: reasonMsg = "Dildo";
  315. case 11: reasonMsg = "Dildo";
  316. case 12: reasonMsg = "Vibrator";
  317. case 13: reasonMsg = "Vibrator";
  318. case 14: reasonMsg = "Flowers";
  319. case 15: reasonMsg = "Cane";
  320. case 22: reasonMsg = "Pistol";
  321. case 23: reasonMsg = "Silenced Pistol";
  322. case 24: reasonMsg = "Desert Eagle";
  323. case 25: reasonMsg = "Shotgun";
  324. case 26: reasonMsg = "Sawn-off Shotgun";
  325. case 27: reasonMsg = "Combat Shotgun";
  326. case 28: reasonMsg = "MAC-10";
  327. case 29: reasonMsg = "MP5";
  328. case 30: reasonMsg = "AK-47";
  329. case 31: reasonMsg = "M4";
  330. case 32: reasonMsg = "TEC-9";
  331. case 33: reasonMsg = "Country Rifle";
  332. case 34: reasonMsg = "Sniper Rifle";
  333. case 37: reasonMsg = "Fire";
  334. case 38: reasonMsg = "Minigun";
  335. case 41: reasonMsg = "Spray Can";
  336. case 42: reasonMsg = "Fire Extinguisher";
  337. case 49: reasonMsg = "Vehicle Collision";
  338. case 50: reasonMsg = "Vehicle Collision";
  339. case 51: reasonMsg = "Explosion";
  340. default: reasonMsg = "Unknown";
  341. }
  342. format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  343. }
  344. else
  345. {
  346. switch (reason)
  347. {
  348. case 53: format(msg, sizeof(msg), "04*** %s died! (Drowned)", playerName);
  349. case 54: format(msg, sizeof(msg), "04*** %s died! (Collision)", playerName);
  350. default: format(msg, sizeof(msg), "04*** %s died!", playerName);
  351. }
  352. }
  353. IRC_GroupSay(gGroupID, IRC_CHANNEL, msg);
  354.  
  355. PlayerInfo[killerid][Kills]++;
  356. PlayerInfo[playerid][Deaths]++;
  357.  
  358. if(pInEvent[playerid] == 1) {
  359. g_EventPlayers--;
  360. pInEvent[playerid] = 0;
  361. if(g_EventPlayers == 1) {
  362. foreach(Player, i) {
  363. if(pInEvent[i] == 1) {
  364. new string[128], player_Name[MAX_PLAYER_NAME];
  365. GetPlayerRame(i, player_Name, sizeof(player_Name));
  366. format(string, sizeof(string), ""#COL_BROWN"[EVENT]"#COL_EASY" %s has won the LMS event and has collected $%d!", player_Name, g_EventReward);
  367. SendClientMessageToAll(-1, string);
  368. GivePlayerMoney(i, g_EventReward);
  369. pInEvent[i] = 0;
  370. g_EventOpen = 0, g_EventPlayers = 0, g_EventReward = 0, g_EventWeapon = 0;
  371. SpawnPlayer(i);
  372. }
  373. }
  374. }
  375. }
  376. return 1;
  377. }
  378.  
  379. public OnVehicleSpawn(vehicleid)
  380. {
  381. return 1;
  382. }
  383.  
  384. public OnVehicleDeath(vehicleid, killerid)
  385. {
  386. return 1;
  387. }
  388.  
  389. public OnPlayerText(playerid, text[])
  390. {
  391. new pname[MAX_PLAYER_NAME], str[128];
  392. GetPlayerName(playerid, pname, sizeof(pname));
  393. strreplace(pname, '_', ' ');
  394. format(str, sizeof(str), "%s says: %s", pname, text);
  395. ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  396. return 0;
  397. }
  398.  
  399. public OnPlayerCommandText(playerid, cmdtext[])
  400. {
  401. if (strcmp("/ignore", cmdtext, true, 10) == 0)
  402. {
  403. // Do something here
  404. return 1;
  405. }
  406. return 0;
  407. }
  408.  
  409. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  410. {
  411. if(!ispassenger)
  412. {
  413. for(new i=0; i<MAX_PLAYERS; i++)
  414. {
  415. if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
  416. {
  417. new Float:cx, Float:cy, Float:cz;
  418. GetPlayerPos(playerid, cx, cy, cz);
  419. SetPlayerPos(playerid, cx, cy, cz);
  420. SendClientMessage(playerid,COLOR_GREY," Someone is driving this vehicle, You must take it Properly !");
  421. }
  422. }
  423. }
  424. return 1;
  425. }
  426.  
  427. public OnPlayerExitVehicle(playerid, vehicleid)
  428. {
  429. return 1;
  430. }
  431.  
  432. public OnPlayerStateChange(playerid, newstate, oldstate)
  433. {
  434. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)// If the player's state changes to a vehicle state we'll have to spec the vehicle.
  435. {
  436. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, enters a vehicle, then let the spectator spectate the vehicle.
  437. {
  438. foreach(Player,i)
  439. {
  440. if(spectatorid[i] == playerid)
  441. {
  442. PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));// Letting the spectator, spectate the vehicle of the player being spectated (I hope you understand this xD)
  443. }
  444. }
  445. }
  446. }
  447. if(newstate == PLAYER_STATE_ONFOOT)
  448. {
  449. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, exists a vehicle, then let the spectator spectate the player.
  450. {
  451. foreach(Player,i)
  452. {
  453. if(spectatorid[i] == playerid)
  454. {
  455. PlayerSpectatePlayer(i, playerid);// Letting the spectator, spectate the player who exited the vehicle.
  456. }
  457. }
  458. }
  459. }
  460. return 1;
  461. }
  462.  
  463. public OnPlayerEnterCheckpoint(playerid)
  464. {
  465. return 1;
  466. }
  467.  
  468. public OnPlayerLeaveCheckpoint(playerid)
  469. {
  470. return 1;
  471. }
  472.  
  473. public OnPlayerEnterRaceCheckpoint(playerid)
  474. {
  475. return 1;
  476. }
  477.  
  478. public OnPlayerLeaveRaceCheckpoint(playerid)
  479. {
  480. return 1;
  481. }
  482.  
  483. public OnRconCommand(cmd[])
  484. {
  485. return 1;
  486. }
  487.  
  488. public OnPlayerRequestSpawn(playerid)
  489. {
  490. return 1;
  491. }
  492.  
  493. public OnObjectMoved(objectid)
  494. {
  495. return 1;
  496. }
  497.  
  498. public OnPlayerObjectMoved(playerid, objectid)
  499. {
  500. return 1;
  501. }
  502.  
  503. public OnPlayerPickUpPickup(playerid, pickupid)
  504. {
  505. return 1;
  506. }
  507.  
  508. public OnVehicleMod(playerid, vehicleid, componentid)
  509. {
  510. return 1;
  511. }
  512.  
  513. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  514. {
  515. return 1;
  516. }
  517.  
  518. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  519. {
  520. return 1;
  521. }
  522.  
  523. public OnPlayerSelectedMenuRow(playerid, row)
  524. {
  525. return 1;
  526. }
  527.  
  528. public OnPlayerExitedMenu(playerid)
  529. {
  530. return 1;
  531. }
  532.  
  533. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  534. {
  535. if(IsBeingSpeced[playerid] == 1)//If the player being spectated, changes an interior, then update the interior and virtualword for the spectator.
  536. {
  537. foreach(Player,i)
  538. {
  539. if(spectatorid[i] == playerid)
  540. {
  541. SetPlayerInterior(i,GetPlayerInterior(playerid));
  542. SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
  543. }
  544. }
  545. }
  546. return 1;
  547. }
  548.  
  549. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  550. {
  551. return 1;
  552. }
  553.  
  554. public OnRconLoginAttempt(ip[], password[], success)
  555. {
  556. return 1;
  557. }
  558. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  559. {
  560. if(!success) SendClientMessage(playerid, COLOR_WHITE, "SERVER: Unknown command. Please use /help to list all available commands.");
  561. return 1;
  562. }
  563.  
  564. public OnPlayerUpdate(playerid)
  565. {
  566. new name[MAX_PLAYER_NAME];
  567. new string[256];
  568. if(!IsPlayerConnected(playerid)) return 0;
  569. new weapon = GetPlayerWeapon(playerid);
  570. if(weapon == 43 || weapon == 45 || weapon == 38 || weapon == 44)
  571. {
  572. SendClientMessage(playerid,0x00FF00AA,"You have been banned for cheating!");
  573. SendClientMessage(playerid,0x00FF00AA,"You can make an unban application at our website.");
  574. SendClientMessage(playerid,0x00FF00AA,"That's it.");
  575. GetPlayerName(playerid, name, sizeof(name));
  576. format(string, sizeof(string), "SERVER: %s has been Owned by God (Reason: Weapon Hacking)", name);
  577. SendClientMessageToAll(0xFF004040, string);
  578. BanEx(playerid,"Weapon Hacking");
  579. printf("ANTI-CHEAT: %s has been cought with a forbidden weapon and was banned", name);// prints to the serverlog
  580. return 0;}
  581. return 1;
  582. }
  583.  
  584. public OnPlayerStreamIn(playerid, forplayerid)
  585. {
  586. return 1;
  587. }
  588.  
  589. public OnPlayerStreamOut(playerid, forplayerid)
  590. {
  591. return 1;
  592. }
  593.  
  594. public OnVehicleStreamIn(vehicleid, forplayerid)
  595. {
  596. return 1;
  597. }
  598.  
  599. public OnVehicleStreamOut(vehicleid, forplayerid)
  600. {
  601. return 1;
  602. }
  603.  
  604. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  605. {
  606.  
  607. if(dialogid == DIALOG_QUIZ) // If first dialog shows up
  608. {
  609. if(!response) return Kick(playerid); // If he click "Leave Game" he will be kicked.
  610. if(response) // If he click first button
  611. {
  612. if(listitem == 0) // If he choose first answer, wich is: Real Pussy
  613. {
  614. SendClientMessage(playerid, -1,"Wrong answer! Better quit and read some RP guides."); // He will get a message that he answered wrong
  615. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  616. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"What's PG ?"," IDK \n Doing Unrealistic Actions \n Coming back to kill him.","Select","Leave Game");
  617. // Second question will show up
  618. }
  619. if(listitem == 1) // If he choose 2nd answers, which is: Role Play (correct one)
  620. {
  621. SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
  622. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"What's PG ?"," IDK \n Doing Unrealistic Actions \n Coming back to kill him.","Select","Leave Game");
  623. // Second question will show up
  624. }
  625. if(listitem == 2)
  626. {
  627. SendClientMessage(playerid, -1,"Wrong answer! As I said, Go read some guides."); // He will get a message that he answered wrong
  628. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  629. ShowPlayerDialog(playerid,DIALOG_QUIZ1,DIALOG_STYLE_LIST,"What's PG"," IDK \n Doing Unrealistic actions \n Power of Grandpa","Select","Leave Game");
  630. // Second question will show up
  631. }
  632. }
  633. }
  634. if(dialogid == DIALOG_QUIZ1) // If second dialog shows up
  635. {
  636. if(!response) return Kick(playerid); // If he press second button he get kicked
  637. if(response) // If he press first button
  638. {
  639. if(listitem == 0) // If he choose first answer wich is: Yes
  640. {
  641. SendClientMessage(playerid, -1,"Wrong answer! GO now."); // He will get a message that he answered wrong
  642. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  643. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"Which is the proper usage of /me"," /me digs through his pockets. \n /me is lol man \n /me wtf xd","Select","Leave Game");
  644. // Next dialog will show up
  645. }
  646. if(listitem == 1) // If he choose first answer wich is: No, it's a NON-RP word (correct one)
  647. {
  648. SendClientMessage(playerid, -1,"That's the correct answer"); // He will get a message that he answered correct
  649. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"What's the proper usage of /me"," /me digs through his pockets. \n /me is lol man \n /me wtf xd","Select","Leave Game");
  650. // Next dialog will show up
  651. }
  652. if(listitem == 2)
  653. {
  654. SendClientMessage(playerid, -1,"Wrong answer! God damn, noob."); // He will get a message that he answered wrong
  655. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  656. ShowPlayerDialog(playerid, DIALOG_QUIZ2, DIALOG_STYLE_LIST,"What's the proper usage of /me"," /me digs through his pockets. \n /me is lol man \n /me wtf xd","Select","Leave Game");
  657. // Next dialog will show up
  658. }
  659. }
  660. }
  661. if(dialogid == DIALOG_QUIZ2) // If 3rd dialog shows up
  662. {
  663. if(!response) return Kick(playerid); // If he click second button he get kicked
  664. if(response) // If he click first button
  665. {
  666. if(listitem == 0) // If he choose first answer wich is: /me laugs (correct one)
  667. {
  668. SendClientMessage(playerid, -1,"That's the correct answer");
  669. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  670. // Next dialog will show up
  671. }
  672. if(listitem == 1)
  673. {
  674. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  675. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  676. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  677. // Next dialog will show up
  678. }
  679. if(listitem == 2)
  680. {
  681. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  682. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  683. ShowPlayerDialog(playerid, DIALOG_QUIZ3, DIALOG_STYLE_LIST,"What IC stands for?"," Information Centre \n In Character \n I'm Cool","Select","Leave Game");
  684. // Next dialog will show up
  685. }
  686. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers
  687. {
  688. SendClientMessage(playerid, -1,"Sorry mate, you Failed the RP quiz, go read some guides maybe.");
  689. Kick(playerid); // He will be kicked
  690. }
  691. }
  692. }
  693. if(dialogid == DIALOG_QUIZ3) // If 4rd dialog shows up
  694. {
  695. if(!response) return Kick(playerid); // If he click second button he get kicked
  696. if(response) // If he click first button
  697. {
  698. if(listitem == 0) // If he choose first answer wich is: Information Centre
  699. {
  700. SendClientMessage(playerid, -1,"Wrong answer! hah lol."); // He will get a message that he answered wrong
  701. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  702. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  703. // Next dialog will show up
  704. }
  705. if(listitem == 1) // If he choose first answer wich is: In Character (correct one)
  706. {
  707. SendClientMessage(playerid, -1,"That's the correct answer!");
  708. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  709. // Next dialog will show up
  710. }
  711. if(listitem == 2) // If he choose first answer wich is: I'm Cool
  712. {
  713. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  714. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  715. ShowPlayerDialog(playerid, DIALOG_QUIZ4, DIALOG_STYLE_LIST,"What OOC stands for?"," Out of Chat \n Out of Character \n Ow ow cool","Select","Leave Game");
  716. // Next dialog will show up
  717. }
  718. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
  719. {
  720. SendClientMessage(playerid, -1,"Sorry mate, Better go read some guides, you failed.");
  721. Kick(playerid); // He will be kicked
  722. }
  723. }
  724. }
  725. if(dialogid == DIALOG_QUIZ4)
  726. {
  727. if(!response) return Kick(playerid); // If he click second button he get kicked
  728. if(response) // If he click first button
  729. {
  730. if(listitem == 0) // If he choose first answers wich is: Out of Chat
  731. {
  732. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  733. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  734. }
  735. if(listitem == 1) // If he choose second answers wich is: Out of Character (correct one)
  736. {
  737. SendClientMessage(playerid, -1,"That's the correct answer");
  738. }
  739. if(listitem == 2) // If he choose 3rd answer wich is: Ow ow cool
  740. {
  741. SendClientMessage(playerid, -1,"Wrong answer!"); // He will get a message that he answered wrong
  742. QuizAnswers[playerid] += 1; // His quiz answers will be increased with 1 point.
  743. }
  744. if(QuizAnswers[playerid] >= 3) // If he reached 3 wrong answers or more
  745. {
  746. SendClientMessage(playerid, -1,"Sorry mate, You failed go read some guides.");
  747. Kick(playerid); // He will be kicked
  748. }
  749. else // If he didn't have at least 3 wrong answers
  750. {
  751. SendClientMessage(playerid, -1,"Congratulations, You hopefully passed it, Now register on the server.");
  752. }
  753. if(fexist(UserPath(playerid)))
  754. {
  755. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  756. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"AC "#COL_DGREEN"Roleplay "#COL_EASY"(V1)\n\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  757. }
  758. else
  759. {
  760. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"AC "#COL_DGREEN"Roleplay "#COL_EASY"(V1)\n\n"#COL_WHITE"Congrats! Please register now.!, \nPlease enter a password below to register your account!", "Register", "Exit");
  761. SpawnPlayer(playerid);
  762. }
  763.  
  764. }
  765. }
  766. switch( dialogid )
  767. {
  768. case DIALOG_REGISTER:
  769. {
  770. if (!response) return Kick(playerid);
  771. if(response)
  772. {
  773. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#COL_ORANGE":: "#COL_WHITE"Register" , "\t\t"#COL_EASY"AC"#COL_DGREEN"Roleplay "#COL_EASY"(V0.1)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"You are not registered, \nPlease enter a password below to register your account!", "Register", "Exit");
  774. new INI:File = INI_Open(UserPath(playerid));
  775. INI_SetTag(File,"data");
  776. INI_WriteInt(File,"Password",udb_hash(inputtext));
  777. INI_WriteInt(File,"Cash",0);
  778. INI_WriteInt(File,"Kills",0);
  779. INI_WriteInt(File,"Deaths",0);
  780. INI_WriteInt(File,"Adminlevel",0);
  781. INI_WriteInt(File,"Helperlevel",0);
  782. INI_WriteInt(File,"Level",1);
  783. INI_WriteInt(File,"Team",gTeam[playerid]);
  784. INI_WriteInt(File,"Race",pData[playerid][wolf] = 0);
  785. INI_Close(File);
  786. }
  787. }
  788.  
  789. case DIALOG_LOGIN:
  790. {
  791. if ( !response ) return Kick ( playerid );
  792. if( response )
  793. {
  794. if(udb_hash(inputtext) == PlayerInfo[playerid][Password])
  795. {
  796. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  797. GivePlayerMoney(playerid, PlayerInfo[playerid][Cash]);
  798. SetSpawnInfo(playerid, 28,0,1743.1090,-1863.6298,13.5748,18.0448,0,0,0,0,0,0);
  799. }
  800. else
  801. {
  802. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""#COL_ORANGE":: "#COL_WHITE"Login", "\t\t"#COL_EASY"Blank Gamemode "#COL_DGREEN"Y_INI "#COL_EASY"(V3)\n\n"#COL_RED"You have entered a invalid password\n"#COL_WHITE"Welcome back, \nPlease enter your password below to start the game!", "Login", "Exit");
  803. }
  804. return 1;
  805. }
  806. }
  807. }
  808. return 1;
  809. }
  810.  
  811. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  812. {
  813. return 1;
  814. }
  815.  
  816. //-----[LoadUser Data]-----
  817. forward LoadUser_data(playerid,name[],value[]);
  818. public LoadUser_data(playerid,name[],value[])
  819. {
  820. INI_Int("Password",PlayerInfo[playerid][Password]);
  821. INI_Int("Cash",PlayerInfo[playerid][Cash]);
  822. INI_Int("Kills",PlayerInfo[playerid][Kills]);
  823. INI_Int("Deaths",PlayerInfo[playerid][Deaths]);
  824. INI_Int("Adminlevel",PlayerInfo[playerid][Adminlevel]);
  825. INI_Int("Helperlevel",PlayerInfo[playerid][Adminlevel]);
  826. INI_Int("Level",PlayerInfo[playerid][Level]);
  827. INI_Int("Factionid",pData[playerid][Faction]);
  828. INI_Int("Rank",pData[playerid][Rank]);
  829. INI_Int("Race",pData[playerid][wolf]);
  830. return 1;
  831. }
  832.  
  833. //-----[Userpatch]-----
  834. stock UserPath(playerid)
  835. {
  836. new string[128],playername[MAX_PLAYER_NAME];
  837. GetPlayerName(playerid,playername,sizeof(playername));
  838. format(string,sizeof(string),PATH,playername);
  839. return string;
  840. }
  841. //---------[SERVER SIDE CASH]----
  842. stock GiveCash(playerid,amount)
  843. {
  844. ResetPlayerMoney(playerid);//this is just for display purposes
  845. SetPVarInt(playerid,"cash",GetPVarInt(playerid,"cash") + amount);//add to the variables
  846. if(GetPVarInt(playerid,"cash") > GetPVarInt(playerid,"maxcash")) SetPVarInt(playerid,"maxcash",GetPVarInt(playerid,"cash"));//if they have a new maximum cash then set it.
  847. GivePlayerMoney(playerid,GetPVarInt(playerid,"cash"));//again, for display purposes.
  848. }
  849. //-----[ANTI-WEAPON HACKING]----------
  850. stock GiveWeapon(playerid,weapon,ammo)
  851. {
  852. new str[10];
  853. format(str,sizeof(str),"weap%d",weapon); //format to set the variable
  854. SetPVarInt(playerid,str,1); //the script now know that the player has had this weapon
  855. format(str,sizeof(str),"wslot%d",GetWeaponSlot(weapon)); //what weapon is in which slot
  856. SetPVarInt(playerid,str,weapon);
  857. GivePlayerWeapon(playerid,weapon,ammo);
  858. }
  859. //-----[Hash function. Thanxx to Dracoblue]-----
  860. stock udb_hash(buf[]) {
  861. new length=strlen(buf);
  862. new s1 = 1;
  863. new s2 = 0;
  864. new n;
  865. for (n=0; n<length; n++)
  866. {
  867. s1 = (s1 + buf[n]) % 65521;
  868. s2 = (s2 + s1) % 65521;
  869. }
  870. return (s2 << 16) + s1;
  871. }
  872.  
  873. //-----[INV Explosion]-----
  874. forward Explosion(playerid, adminid);
  875. public Explosion(playerid, adminid) {
  876. if(checkinv == 1)
  877. {
  878. new Float:health;
  879. GetPlayerHealth(playerid,health);
  880. if(health == 100)
  881. {
  882. SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [POSITIVE]");
  883. checkinv = 0;
  884. }
  885. else if(health != 100)
  886. {
  887. SendClientMessage(adminid,COLOR_YELLOW,"Invulnerability check result : [NEGATIVE]");
  888. checkinv = 0;
  889. }
  890. }
  891. return 1;
  892. }
  893.  
  894. //-----[Removing underscore]-----
  895. stock GetPlayerRame( giveplayer, name[ ], len )
  896. {
  897. GetPlayerRame( giveplayer, name, len );
  898. for(new i = 0; i < len; i++ )
  899. {
  900. if ( name[ i ] == '_' )
  901. name[ i ] = ' ';
  902. }
  903. }
  904.  
  905. //-----[Callbacks]-----
  906. public IRC_OnConnect(botid, ip[], port)
  907. {
  908. printf("*** IRC_OnConnect: Bot ID %d connected to %s:%d", botid, ip, port);
  909. IRC_JoinChannel(botid, IRC_CHANNEL);
  910. IRC_AddToGroup(gGroupID, botid);
  911. return 1;
  912. }
  913.  
  914. public IRC_OnDisconnect(botid, ip[], port, reason[])
  915. {
  916. printf("*** IRC_OnDisconnect: Bot ID %d disconnected from %s:%d (%s)", botid, ip, port, reason);
  917. IRC_RemoveFromGroup(gGroupID, botid);
  918. return 1;
  919. }
  920.  
  921. public IRC_OnConnectAttempt(botid, ip[], port)
  922. {
  923. printf("*** IRC_OnConnectAttempt: Bot ID %d attempting to connect to %s:%d...", botid, ip, port);
  924. return 1;
  925. }
  926.  
  927. public IRC_OnConnectAttemptFail(botid, ip[], port, reason[])
  928. {
  929. printf("*** IRC_OnConnectAttemptFail: Bot ID %d failed to connect to %s:%d (%s)", botid, ip, port, reason);
  930. return 1;
  931. }
  932.  
  933. public IRC_OnReceiveRaw(botid, message[])
  934. {
  935. new File:file;
  936. if (!fexist("irc_log.txt"))
  937. {
  938. file = fopen("irc_log.txt", io_write);
  939. }
  940. else
  941. {
  942. file = fopen("irc_log.txt", io_append);
  943. }
  944. if (file)
  945. {
  946. fwrite(file, message);
  947. fwrite(file, "\r\n");
  948. fclose(file);
  949. }
  950. return 1;
  951. }
  952.  
  953. //-----[Unfreeze LMS]-----
  954. //-----[Unfreezeplayer]-----
  955. forward UnfreezeLMS(playerid);
  956. public UnfreezeLMS(playerid)
  957. {
  958. foreach(Player, i)
  959. {
  960. if(pInEvent[i] == 1)
  961. {
  962. if(g_EventOpen == 1)
  963. {
  964. TogglePlayerControllable(i, 1);
  965. GameTextForPlayer(i, "~r~Be the Last Man Standing!", 2000, 3);
  966. }
  967. }
  968. }
  969. return 1;
  970. }
  971. CMD:wolfform(playerid, params[])
  972. {
  973. if(PlayerInfo[playerid][wolf] == 0)return SendClientMessage(playerid,-1,"You are not a wolf!");
  974. if(GetPlayerSkin(playerid) == 0)return SendClientMessage(playerid,-1,"ERROR: You are still a wolf!");
  975. GetPlayerSkin(playerid,OldSkin);
  976. SetPlayerSkin(playerid, 0);
  977. SendClientMessage(playerid, -1, "You shifted into wolf form!");
  978. return 1;
  979. }
  980. CMD:setracewolf(playerid, params[])
  981. {
  982. if(PlayerInfo[playerid][wolf] == 3)
  983. {
  984. new targetid, level;
  985. if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /setracewolf [Part of Name/Player ID] [0-3]");
  986.  
  987. if(level < 0 || level > 3) return 1;
  988.  
  989. PlayerInfo[targetid][wolf] = 1;
  990. new metin[512];
  991. new name[MAX_PLAYER_NAME];
  992. GetPlayerName(playerid, name, sizeof(name));
  993. new target[MAX_PLAYER_NAME];
  994. GetPlayerName(targetid, target, sizeof(target));
  995. format(metin, sizeof(metin), "INFO: You have made %s a wolf!",target);
  996. SendClientMessage(playerid, 0xE01B1B, metin);
  997. SendClientMessage(targetid, 0xE01B1B, "WARNING: You have been made a wolf!");
  998. }
  999. return 1;
  1000. }
  1001. CMD:setracehuman(playerid, params[])
  1002. {
  1003. if(IsPlayerAdmin(playerid))
  1004. {
  1005. new targetid;
  1006. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "[USAGE]: /setracehuman [Part of Name/Player ID]");
  1007. PlayerInfo[targetid][wolf] = 0;
  1008. new metin[512];
  1009. new name[MAX_PLAYER_NAME];
  1010. GetPlayerName(playerid, name, sizeof(name));
  1011. new target[MAX_PLAYER_NAME];
  1012. GetPlayerName(targetid, target, sizeof(target));
  1013. format(metin, sizeof(metin), "INFO: You have made %s a human!",target);
  1014. SendClientMessage(playerid, 0xE01B1B, metin);
  1015. SendClientMessage(targetid, 0xE01B1B, "WARNING: You have been made a human!");
  1016. }
  1017. return 1;
  1018. }
  1019. CMD:humanform(playerid, params[])
  1020. {
  1021. if(GetPlayerSkin(playerid) > 1)return SendClientMessage(playerid,-1,"You are not in a wolf form!");
  1022. SetPlayerSkin(playerid, OldSkin);
  1023. SendClientMessage(playerid, -1, "You have restored to your human form");
  1024. return 1;
  1025. }
  1026. CMD:wolfjump(playerid, params[])
  1027. {
  1028. if(PlayerInfo[playerid][wolf] == 0)return SendClientMessage(playerid,-1,"You are not a wolf!");
  1029. if(GetPlayerSkin(playerid) > 1)return SendClientMessage(playerid,-1,"You are not in a wolf form atm!");
  1030. new Float:x,Float:y,Float:z;
  1031. GetPlayerPos(playerid,x,y,z);
  1032. SetPlayerPos(playerid,x,y,z+5);
  1033. SendClientMessage(playerid,-1,"You jumped in the air!");
  1034. TogglePlayerControllable(playerid,1);
  1035. return 1;
  1036. }
  1037.  
  1038. CMD:wolfbite(playerid, params[])
  1039. {
  1040. if(PlayerInfo[playerid][wolf] == 0)return SendClientMessage(playerid,-1,"You are not a wolf!");
  1041. {
  1042. if(GetPlayerSkin(playerid) > 1)return SendClientMessage(playerid,-1,"You are not in a wolf form atm!");
  1043. {
  1044. new Float:x,Float:y,Float:z;
  1045. new targetid;
  1046. GetPlayerPos(playerid,x,y,z);
  1047. if(IsPlayerInRangeOfPoint(targetid,10.0,x,y,z))
  1048. {
  1049. SetPlayerHealth(playerid,80);
  1050. new metin[512];
  1051. new name[MAX_PLAYER_NAME];
  1052. GetPlayerName(playerid, name, sizeof(name));
  1053. new target[MAX_PLAYER_NAME];
  1054. GetPlayerName(targetid, target, sizeof(target));
  1055. format(metin, sizeof(metin), "INFO: You have bitten %s!",target);
  1056. SendClientMessage(playerid, 0xE01B1B, metin);
  1057. SendClientMessage(targetid, 0xE01B1B, "WARNING: You have been bitten by a wolf!");
  1058. }
  1059. else
  1060. SendClientMessage(playerid,-1,"The player is not in range");
  1061. }
  1062. return 1;
  1063. }
  1064. }
  1065. CMD:help(playerid, params[])
  1066. {
  1067. ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, ".:: Commands ::.", "/pm \n /o(oc) \n /do \n /low \n /w(hisper) \n /report \n /helpme \n /rules \n /pay \n /admins \n /gamemasters \n /stats", "Close", "");
  1068. return 1;
  1069. }
  1070.  
  1071. //-----[Rules]-----
  1072. CMD:rules(playerid, params[])
  1073. {
  1074. ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Notice", "These are the Following server rules :\n Do not use hacks. \n Do not ask for Admin rank /n Don't Bunnyhop /n More going to be added.", "Close", "");
  1075. return 1;
  1076. }
  1077. // stats
  1078. COMMAND:stats(playerid,params[])
  1079. {
  1080. new string2[2000];
  1081. new name[MAX_PLAYER_NAME];
  1082. GetPlayerName(playerid, name, sizeof(name));
  1083. format(string2,sizeof(string2),"Name: %s \nScore: %d \nCash: %d",name,PlayerInfo[playerid][Level],PlayerInfo[playerid][Cash]);
  1084. ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",string2,"Close","");
  1085. return 1;
  1086. }
  1087. //-----[PM]-----
  1088. COMMAND:pm(playerid, params[])
  1089. {
  1090. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  1091. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /pm [PlayerID/PartOfName] [Message]");
  1092. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Player not connected!");
  1093. else
  1094. {
  1095. GetPlayerName(id, str, 24);
  1096. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  1097. GetPlayerName(id, str, 24);
  1098. format(str, sizeof(str), "PM To %s(%d): %s", str, id, Message);
  1099. SendClientMessage(playerid, COLOR_YELLOW, str);
  1100. GetPlayerName(playerid, pname, sizeof(pname));
  1101. format(str, sizeof(str), "PM From %s(%d): %s", pname, playerid, Message);
  1102. SendClientMessage(id, COLOR_YELLOW, str);
  1103. }
  1104. return 1;
  1105. }
  1106.  
  1107. //-----[Adminhelp]-----
  1108. CMD:ah(playerid, params[])
  1109. {
  1110. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1111. SendClientMessage(playerid,COLOR_WHITE, "===============[ Administrator Commands ]===============");
  1112. SendClientMessage(playerid,COLOR_WHITE, "Administrator (1): /slap - /unfreeze - /apm - /adminduty - /a(chat), - /sendtols, - /setskin");
  1113. SendClientMessage(playerid,COLOR_WHITE, "Administrator (2): /goto - /gethere - /freeze - /freezeall - /unfreezeall - /kick - /spec - /specoff - /enableooc - /disableooc - /vrespawn - /announce");
  1114. SendClientMessage(playerid,COLOR_WHITE, "Administrator (3): /explode - /cc - /sethp - /healall - /veh - /setarmour - /jetpack - /removejet");
  1115. SendClientMessage(playerid,COLOR_WHITE, "Administrator (4): /givegun - /givemoney - /addveh - /changename");
  1116. SendClientMessage(playerid,COLOR_WHITE, "Administrator (5): /gmx - /setleader - /makeadmin [ Needs RCON login]");
  1117. SendClientMessage(playerid,COLOR_WHITE, "========================================================");
  1118. return 1;
  1119. }
  1120. //------[Announce]-----
  1121. COMMAND:announce(playerid, params[])
  1122. {
  1123. new text[64], time, style;
  1124. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1125. else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid,COLOR_SYNTAX,"Usage: /announce <style[0-6]> <time in ms> <text>");
  1126. else if (strlen(text) > 64) return SendClientMessage(playerid,COLOR_SYNTAX,"Message too long, please make it with less than 64 letters!");
  1127. else if (style == 2) return SendClientMessage(playerid,COLOR_SYNTAX,"Bug with style 2! Do not use it!");
  1128. else if (style < 0 || style > 6) return SendClientMessage(playerid,0x854900FF,"Invalid style");
  1129. else if (time > 20*1000) return SendClientMessage(playerid, COLOR_SYNTAX,"No longer than 20 seconds");
  1130. else {
  1131. GameTextForAll(text, time, style);
  1132. }
  1133. return 1;
  1134. }
  1135. //-----[Slap]-----
  1136. CMD:slap(playerid, params[])
  1137. {
  1138. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1139. new targetid;
  1140. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /slap [PlayerID/PartOfName]");
  1141. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1142. else
  1143. {
  1144. new Float:SLX, Float:SLY, Float:SLZ;
  1145. GetPlayerPos(targetid, SLX, SLY, SLZ);
  1146. SetPlayerPos(targetid, SLX, SLY, SLZ+5);
  1147. PlayerPlaySound(targetid, 1130, SLX, SLY, SLZ+5);
  1148. new string[128];
  1149. new pName[24], pTame[24];
  1150. GetPlayerName(playerid,pName,24);
  1151. GetPlayerName(targetid,pTame,24);
  1152. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been slapped by Administrator %s.",pTame,pName);
  1153. SendClientMessageToAll(COLOR_RED, string);
  1154. }
  1155. return 1;
  1156. }
  1157. //-----[SPEC]-----
  1158. COMMAND:spec(playerid, params[])
  1159. {
  1160. new id;// This will hold the ID of the player you are going to be spectating.
  1161. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1162. if(sscanf(params,"u", id))return SendClientMessage(playerid, Grey, "Usage: /spec [id]");// Now this is where we use sscanf to check if the params were filled, if not we'll ask you to fill them
  1163. if(id == playerid)return SendClientMessage(playerid,Grey,"You cannot spec yourself.");// Just making sure.
  1164. if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, Grey, "Player not found!");// This is to ensure that you don't fill the param with an invalid player id.
  1165. if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,Grey,"You are already specing someone.");// This will make you not automatically spec someone else by mistake.
  1166. GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// This is getting and saving the player's position in a variable so they'll respawn at the same place they typed '/spec'
  1167. Inter[playerid] = GetPlayerInterior(playerid);// Getting and saving the interior.
  1168. vWorld[playerid] = GetPlayerVirtualWorld(playerid);//Getting and saving the virtual world.
  1169. TogglePlayerSpectating(playerid, true);// Now before we use any of the 3 functions listed above, we need to use this one. It turns the spectating mode on.
  1170. if(IsPlayerInAnyVehicle(id))//Checking if the player is in a vehicle.
  1171. {
  1172. if(GetPlayerInterior(id) > 0)//If the player's interior is more than 0 (the default) then.....
  1173. {
  1174. SetPlayerInterior(playerid,GetPlayerInterior(id));//.....set the spectator's interior to that of the player being spectated.
  1175. }
  1176. if(GetPlayerVirtualWorld(id) > 0)//If the player's virtual world is more than 0 (the default) then.....
  1177. {
  1178. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));//.....set the spectator's virtual world to that of the player being spectated.
  1179. }
  1180. PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));// Now remember we checked if the player is in a vehicle, well if they're in a vehicle then we'll spec the vehicle.
  1181. }
  1182. else// If they're not in a vehicle, then we'll spec the player.
  1183. {
  1184. if(GetPlayerInterior(id) > 0)
  1185. {
  1186. SetPlayerInterior(playerid,GetPlayerInterior(id));
  1187. }
  1188. if(GetPlayerVirtualWorld(id) > 0)
  1189. {
  1190. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  1191. }
  1192. PlayerSpectatePlayer(playerid,id);// Letting the spectator spec the person and not a vehicle.
  1193. }
  1194. GetPlayerName(id, Name, sizeof(Name));//Getting the name of the player being spectated.
  1195. format(String, sizeof(String),"You have started to spectate %s.",Name);// Formatting a string to send to the spectator.
  1196. SendClientMessage(playerid,0x0080C0FF,String);//Sending the formatted message to the spectator.
  1197. IsSpecing[playerid] = 1;// Just saying that the spectator has begun to spectate someone.
  1198. IsBeingSpeced[id] = 1;// Just saying that a player is being spectated (You'll see where this comes in)
  1199. spectatorid[playerid] = id;// Saving the spectator's id into this variable.
  1200. return 1;// Returning 1 - saying that the command has been sent.
  1201. }
  1202. //-----[SPEC OFF]------
  1203. COMMAND:specoff(playerid, params[])
  1204. {
  1205. if(!IsPlayerAdmin(playerid))return 0;// This checks if the player is logged into RCON, if not it will return 0; (Showing "SERVER: Unknown Command")
  1206. if(IsSpecing[playerid] == 0)return SendClientMessage(playerid,Grey,"You are not spectating anyone.");
  1207. TogglePlayerSpectating(playerid, 0);//Toggling spectate mode, off. Note: Once this is called, the player will be spawned, there we'll need to reset their positions, virtual world and interior to where they typed '/spec'
  1208. return 1;
  1209. }
  1210. //-----[Adminhelp]-----
  1211. CMD:kick(playerid, params[])
  1212. {
  1213. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1214. new targetid, reason[64], string[128];
  1215. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /kick [PlayerID/PartOfName] [Reason]");
  1216. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1217. {
  1218. new pTargetName[24], pName[24];
  1219. GetPlayerName(playerid,pName,24);
  1220. GetPlayerName(targetid,pTargetName,24);
  1221. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has kicked %s: Reason: %s", pName, pTargetName, reason);
  1222. SendClientMessageToAll(COLOR_RED,string);
  1223. Kick(targetid);
  1224. }
  1225. return 1;
  1226. }
  1227.  
  1228. //-----[Server GMX]-----
  1229. CMD:gmx(playerid, params[])
  1230. {
  1231. if(PlayerInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1232. {
  1233. new string[256];
  1234. new pName[24];
  1235. GetPlayerName(playerid,pName,24);
  1236. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has commenced a server restart.",pName);
  1237.  
  1238. new INI:File = INI_Open(UserPath(playerid));
  1239. INI_SetTag(File,"data");
  1240. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  1241. INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
  1242. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
  1243. INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
  1244. INI_WriteInt(File,"Level",PlayerInfo[playerid][Level]);
  1245. INI_Close(File);
  1246.  
  1247. SendClientMessageToAll(COLOR_RED, string);
  1248. GameTextForAll("Server is Restarting",3000,0);
  1249. SetTimer("Gmx",3000,false);
  1250. SendRconCommand("gmx");
  1251. }
  1252. return 1;
  1253. }
  1254. // ----[Faction make/set leader]
  1255. CMD:setleader(playerid, params[])
  1256. {
  1257. new targetid, factionid, string[128], targetname[24], playername[24];
  1258. if(sscanf(params, "ui", targetid, factionid)) return SendClientMessage(playerid, -1, "Usage: /makeleader [playerid][factionid]"); //Checks if they typed in anything for the playerid and factionid parameters, and if they don't, return a client message.
  1259. if(PlayerInfo[playerid][Adminlevel] < 5) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1260. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player is not connected
  1261. if(0 < factionid < 3) //Checks if the factionid is between 0 and 3, and if so, continue. You can also type this like so: if(factionid >= 1 && factionid <= 2) or if(factionid == 1 || factionid == 2)
  1262. {
  1263. GetPlayerName(playerid, playername, sizeof(playername)); //Gets the players name and saves it to the variable playername
  1264. GetPlayerName(targetid, targetname, sizeof(targetname)); //Gets the targets name and saves it to the variable targetname
  1265. format(string, sizeof(string), "You made %s leader of faction id %i!", targetname, factionid); //Formats the string that you will receive
  1266. SendClientMessage(playerid, -1, string); //Sends a message to the person who changes the other persons faction in a random color
  1267. format(string, sizeof(string), "You were made leader of faction id %i by %s", factionid, playername);//Formats the string that the player will receive
  1268. SendClientMessage(playerid, -1, string); //Sends a message to the person who is made the faction leader
  1269. pData[playerid][Faction] = factionid;
  1270. pData[playerid][Rank] = 6; //Leader, use a switch case or if/else if statement if you want to make it so certain factions have seperate highest ranks
  1271. }
  1272. else return SendClientMessage(playerid, -1, "Invalid factionid. Factionid's: 1-2"); //Sends a message if the faction is NOT between 0 and 3
  1273. return 1;// Returns 1 to end the command, as we NEED to return a value.
  1274. }
  1275. CMD:invite(playerid, params[])
  1276. {
  1277. if(pData[playerid][Rank] == 6)
  1278. {
  1279. new targetid, factionid, string[128], targetname[24], playername[24];
  1280. if(sscanf(params, "ui", targetid, factionid)) return SendClientMessage(playerid, -1, "Usage: /invite [playerid][factionid]"); //Checks if they typed in anything for the playerid and factionid parameters, and if they don't, return a client message.
  1281. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player is not connected
  1282. if(0 < factionid < 3) //Checks if the factionid is between 0 and 3, and if so, continue. You can also type this like so: if(factionid >= 1 && factionid <= 2) or if(factionid == 1 || factionid == 2)
  1283. {
  1284. GetPlayerName(playerid, playername, sizeof(playername)); //Gets the players name and saves it to the variable playername
  1285. GetPlayerName(targetid, targetname, sizeof(targetname)); //Gets the targets name and saves it to the variable targetname
  1286. format(string, sizeof(string), "You made %s part of the faction(member)", targetname, factionid); //Formats the string that you will receive
  1287. SendClientMessage(playerid, -1, string); //Sends a message to the person who changes the other persons faction in a random color
  1288. format(string, sizeof(string), "You were made the faction member by ", playername);//Formats the string that the player will receive
  1289. SendClientMessage(targetid, -1, string); //Sends a message to the person who is made the faction leader
  1290. pData[playerid][Faction] = factionid;
  1291. pData[playerid][Rank] = 1; //Leader, use a switch case or if/else if statement if you want to make it so certain factions have seperate highest ranks
  1292. }
  1293. else return SendClientMessage(playerid, -1, "Invalid factionid. Factionid's: 1-2"); //Sends a message if the faction is NOT between 0 and 3
  1294. return 1;// Returns 1 to end the command, as we NEED to return a value.
  1295. }
  1296. else
  1297. SendClientMessage(playerid,-1,"ERROR:You are not the faction leader.");
  1298. return 1;
  1299. }
  1300. CMD:uninvite(playerid, params[])
  1301. {
  1302. if(pData[playerid][Rank] == 6)
  1303. {
  1304. new targetid, factionid, string[128], targetname[24], playername[24];
  1305. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uninvite [playerid]"); //Checks if they typed in anything for the playerid and factionid parameters, and if they don't, return a client message.
  1306. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player is not connected
  1307. if(0 < factionid < 3) //Checks if the factionid is between 0 and 3, and if so, continue. You can also type this like so: if(factionid >= 1 && factionid <= 2) or if(factionid == 1 || factionid == 2)
  1308. {
  1309. GetPlayerName(playerid, playername, sizeof(playername)); //Gets the players name and saves it to the variable playername
  1310. GetPlayerName(targetid, targetname, sizeof(targetname)); //Gets the targets name and saves it to the variable targetname
  1311. format(string, sizeof(string), "You have kicked %s from the faction.", targetname); //Formats the string that you will receive
  1312. SendClientMessage(playerid, -1, string); //Sends a message to the person who changes the other persons faction in a random color
  1313. format(string, sizeof(string), "You have been kicked from the faction by %s", playername);//Formats the string that the player will receive
  1314. SendClientMessage(targetid, -1, string); //Sends a message to the person who is made the faction leader
  1315. pData[playerid][Faction] = 0;
  1316. pData[playerid][Rank] = 0; //Leader, use a switch case or if/else if statement if you want to make it so certain factions have seperate highest ranks
  1317. }
  1318. else return SendClientMessage(playerid, -1, "Invalid factionid. Factionid's: 1-2"); //Sends a message if the faction is NOT between 0 and 3
  1319. return 1;// Returns 1 to end the command, as we NEED to return a value.
  1320. }
  1321. else
  1322. SendClientMessage(playerid,-1,"ERROR:You are not the faction leader.");
  1323. return 1;
  1324. }
  1325. //---------[Remove faction]------------
  1326. CMD:removefromfaction(playerid, params[]) //Format to create a command
  1327. { //Open bracket
  1328. new targetid, targetname[24], playername[24], string[128]; //Create the variables
  1329. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /removefromfaction [playerid/partofname]"); //Sends message if they do not type something in for the targetid/name
  1330. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid playerid!"); //Sends a message if the player isn't connected
  1331. if(!IsPlayerAdmin(playerid) && pData[playerid][Rank] != 6) return SendClientMessage(playerid, -1, "You are not a high enough admin or you aren't the leader!"); //Sends a message if they aren't the leader of the faction and if they aren't admin
  1332. GetPlayerName(targetid, targetname, sizeof(targetname)); //Stores the targetid's name in the targetname variable
  1333. GetPlayerName(playerid, playername, sizeof(playername)); //Stores the playerid's name in the playername variable
  1334. format(string, sizeof(string), "You removed %s from his (now) previous faction!", targetname);//Formats the message that will be sent to you (the player)
  1335. SendClientMessage(playerid, -1, string);//Sends the message that is formatted above to the playerid in a random color
  1336. format(string, sizeof(string), "You were removed from your faction by %s!", playername);//Formats the message that will be sent to the targetid
  1337. SendClientMessage(targetid, -1, string);//Sends the message that is formatted above to the targetid in a random color
  1338. pData[targetid][Faction] = 0; //Sets their faction variable to 0 (civilian)
  1339. pData[targetid][Rank] = 0; //Sets their rank variable to 0 (no rank)
  1340. return 1; //Returns a value
  1341. }
  1342. //-----------[Set rank]-------------
  1343. CMD:setrank(playerid, params[])
  1344. {
  1345. new targetid, rank, targetname[24], playername[24], string[128]; //Creates our variable
  1346. if(sscanf(params, "ui", targetid, rank)) return SendClientMessage(playerid, -1, "Usage: /setrank [playerid/partofname][rank]"); //Sends correct usage if they do not type in the rank and playerid
  1347. if(pData[playerid][Rank] != 6) return SendClientMessage(playerid, -1, "You are not the leader of a faction!"); //If their rank is not 6, send the message. Their rank won't be 6 unless they are in a faction, no need to check their faction
  1348. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "That player is not connected!"); //Sends a message if the targetid is not connected
  1349. if(pData[targetid][Faction] != pData[playerid][Faction]) return SendClientMessage(playerid, -1, "That player is not in your faction!"); //Sends a message if the targetid is not in their faction
  1350. if(0 < rank < 7) //If the rank is between 0 and 7, seeing as below 1 and above 6 is not a valid rank
  1351. { //Open bracket
  1352. GetPlayerName(playerid, playername, sizeof(playername)); //Stores the playerid's name into the playername variable
  1353. GetPlayerName(targetid, targetname, sizeof(targetname)); //Stores the targetid's name into the targetname variable
  1354. if(pData[targetid][Rank] < rank) //If the players rank is less than the rank being given (promotion)
  1355. { //Open bracket
  1356. format(string, sizeof(string), "You have been promoted to rank %i by %s!", rank, playername); //Formats the message for the targetid
  1357. SendClientMessage(targetid, -1, string); //Sends formatted message to targetid
  1358. format(string, sizeof(string), "You promoted %s to rank %i", targetname, rank); //Formats the message for the playerid
  1359. SendClientMessage(playerid, -1, string); //Sends formatted message to playerid
  1360. } //Closed bracket
  1361. else //Else (demotion)
  1362. { //Open bracket
  1363. format(string, sizeof(string), "You have been demoted to rank %i by %s!", rank, playername); //Same as above
  1364. SendClientMessage(targetid, -1, string); //Same as above
  1365. format(string, sizeof(string), "You demoted %s to rank %i", targetname, rank); //Same as above
  1366. SendClientMessage(playerid, -1, string); //Same as above
  1367. } //Closed bracket
  1368. } //Closed bracket
  1369. return 1; //Return a value
  1370. }
  1371. //-----[Ban]-----
  1372. CMD:ban(playerid, params[])
  1373. {
  1374. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1375. new targetid, reason[64], string[128];
  1376. if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /ban [PlayerID/PartOfName] [Reason]");
  1377. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1378. {
  1379. new pTargetName[24], pName[24];
  1380. GetPlayerName(playerid,pName,24);
  1381. GetPlayerName(targetid,pTargetName,24);
  1382. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" Admin %s has IP banned %s: %s", pName, pTargetName, reason);
  1383. SendClientMessageToAll(COLOR_RED,string);
  1384. Ban(targetid);
  1385. }
  1386. return 1;
  1387. }
  1388.  
  1389. //----[Explode]-----
  1390. CMD:explode(playerid, params[])
  1391. {
  1392. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1393. new targetid;
  1394. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /explode [PlayerID/PartOfName]");
  1395. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1396. else
  1397. {
  1398. new Float:SLX, Float:SLY, Float:SLZ;
  1399. GetPlayerPos(targetid, SLX, SLY,SLZ);
  1400. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  1401. new string[128];
  1402. new pName[24], pTame[24];
  1403. GetPlayerName(playerid,pName,24);
  1404. GetPlayerName(targetid,pTame,24);
  1405. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been exploded by Administrator %s.",pTame,pName);
  1406. SendClientMessageToAll(COLOR_RED, string);
  1407. }
  1408. return 1;
  1409. }
  1410. //-----[Admin PM]-----
  1411. COMMAND:apm(playerid, params[])
  1412. {
  1413. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1414. new str[128],id,pname[MAX_PLAYER_NAME], Message[128];
  1415. if(sscanf(params, "us[128]", id, Message))SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /apm [PlayerID/PartOfName] [Message]");
  1416. else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_ERROR, "Player not connected!");
  1417. else
  1418. {
  1419. GetPlayerName(id, str, 24);
  1420. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1421. GetPlayerName(id, str, 24);
  1422. format(str, sizeof(str), "[ADMIN] %s(%d): %s", str, id, Message);
  1423. SendClientMessage(playerid, COLOR_YELLOW, str);
  1424. GetPlayerName(playerid, pname, sizeof(pname));
  1425. format(str, sizeof(str), "[ADMIN] %s(%d): %s", pname, playerid, Message);
  1426. SendClientMessage(id, COLOR_YELLOW, str);
  1427. }
  1428. return 1;
  1429. }
  1430.  
  1431. //-----[Make admin]-----
  1432. COMMAND:makeadmin(playerid, params[])
  1433. {
  1434. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1435. new id, lvl;
  1436. if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeadmin [PlayerID/PartOfName] [Level]");
  1437. else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
  1438. else if(lvl > 5) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Administrator level cannot be higher then 5!");
  1439. else
  1440. {
  1441. PlayerInfo[id][Adminlevel] = lvl;
  1442. }
  1443. return 1;
  1444. }
  1445. //----[ajail]---------
  1446. CMD:ajail(playerid, params[])
  1447. {
  1448. new id, mins, str[128];
  1449. new JailTimer[MAX_PLAYERS];
  1450. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1451. if(sscanf(params, "ud", id, mins)) return SendClientMessage(playerid, COLOR_RED, "[Usage]: /jail <id> <minutes>");
  1452. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid player id.");
  1453. SetPlayerPos(playerid, 264.4176, 77.8930, 1001.0391);
  1454. SetPlayerInterior(playerid, 6);
  1455. JailTimer[id] = SetTimerEx("Unjail", mins*60*1000, 0, "d", id);
  1456. format(str, sizeof(str), "You jailed %s for %d mins.", GetName(id), mins);
  1457. SendClientMessage(playerid, COLOR_RED, str);
  1458. format(str, sizeof(str), "%s jailed you for %d mins.", GetName(playerid), mins);
  1459. SendClientMessage(id, COLOR_RED, str);
  1460. format(str, sizeof(str), "ADMIN %s has jailed %s for %d mins!", GetName(playerid), GetName(id), mins);
  1461. SendClientMessageToAll(COLOR_RED, str);
  1462. return 1;
  1463. }
  1464. //----[GM cmds start here]-------------
  1465. //---------[Game masters chat]-------------
  1466. CMD:g(playerid, params[])
  1467. {
  1468. if(PlayerInfo[playerid][Helperlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1469. new pName[MAX_PLAYER_NAME], string[128];
  1470. GetPlayerName(playerid, pName, sizeof(pName));
  1471. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /g [Text]" );
  1472.  
  1473. format(string, sizeof(string), "((Gamemaster %s: %s ))", pName, params);
  1474. SendMessageToHelpers(ORANGE,string);
  1475.  
  1476. return 1;
  1477. }
  1478. //-----[GMhelp]---------------------
  1479. CMD:gmhelp(playerid, params[])
  1480. {
  1481. if(PlayerInfo[playerid][Helperlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1482. SendClientMessage(playerid,COLOR_WHITE, "===============[ Gamemasters Commands ]===============");
  1483. SendClientMessage(playerid,COLOR_WHITE, "Gamemaster (1): /gmduty - /answerhelpme , /g(chat)");
  1484. SendClientMessage(playerid,COLOR_WHITE, " More are going to be added soon ");
  1485. SendClientMessage(playerid,COLOR_WHITE, "========================================================");
  1486. return 1;
  1487. }
  1488. //-------[GMMAKE]-----------
  1489. COMMAND:makegm(playerid, params[])
  1490. {
  1491. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1492. new id, lvl;
  1493. if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makegm [PlayerID/PartOfName] [Level]");
  1494. else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
  1495. else if(lvl > 4) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Gamemaster level cannot be higher then 5!");
  1496. else
  1497. {
  1498. PlayerInfo[id][Helperlevel] = lvl;
  1499. }
  1500. return 1;
  1501. }
  1502. //-----[GMDUTY]-----------------
  1503. CMD:gmduty(playerid, params[])
  1504. {
  1505. if(PlayerInfo[playerid][Helperlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1506. if( HelperDuty[playerid] == 0 )
  1507. {
  1508. HelperDuty[playerid] = 1;
  1509. new string[128];
  1510. new pName[24], pTame[24];
  1511. GetPlayerName(playerid,pName,24);
  1512. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED"Gamemaster %s is on Helper Duty, Contact him for help.",pName,pTame);
  1513. SendClientMessageToAll(COLOR_WHITE, string);
  1514. SetPlayerColor(playerid,COLOR_YELLOW);
  1515. }
  1516. else
  1517. {
  1518. HelperDuty[playerid] = 0;
  1519. new string[128];
  1520. new pName[24], pTame[24];
  1521. GetPlayerName(playerid,pName,24);
  1522. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Gamemaster %s is off Helper Duty, Don't bug him now.",pName,pTame);
  1523. SendClientMessageToAll(COLOR_WHITE, string);
  1524. SetPlayerColor(playerid,COLOR_WHITE);
  1525. }
  1526. return 1;
  1527. }
  1528. //--------[Answer help me]-----------
  1529. CMD:answerhelpme(playerid, params[])
  1530. {
  1531. new id, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  1532. if(PlayerInfo[playerid][Helperlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1533. if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_SYNTAX," [SYNTAX]: /answerhelpme [playerid]");
  1534. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Player not connected");
  1535. else
  1536. {
  1537. if(PlayerNeedsHelp[id] == 1)
  1538. {
  1539. PlayerNeedsHelp[id] = 0;
  1540. GetPlayerName(playerid,sendername,sizeof(sendername));
  1541. GetPlayerName(id,name,sizeof(name));
  1542. format(string, sizeof(string), "**[INFO]: [ID:%d] %s has accepted your help and now ready to assist you! Please be patience.", playerid, sendername);
  1543. SendClientMessage(id, GREEN, string);
  1544. }
  1545. else return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: This player did not ask for help! [Wrong ID]");
  1546. }
  1547. return 1;
  1548. }
  1549. //--------GM CMDS END HERE-------------
  1550. //-----[Freeze]-----
  1551. CMD:freeze(playerid, params[])
  1552. {
  1553. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1554.  
  1555. new targetid, string[128];
  1556. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /freeze [PlayerID/PartOfName]");
  1557. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1558. new pTargetName[24], pName[24];
  1559. GetPlayerName(playerid,pName,24);
  1560. GetPlayerName(targetid,pTargetName,24);
  1561. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been frozen by Administrator %s.",pTargetName, pName);
  1562. SendClientMessageToAll(COLOR_RED,string);
  1563. TogglePlayerControllable(targetid, 0);
  1564. return 1;
  1565. }
  1566.  
  1567. //-----[Unfreeze]-----
  1568. CMD:unfreeze(playerid, params[])
  1569. {
  1570. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1571. new targetid, string[128];
  1572. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /unfreeze [PlayerID/PartOfName]");
  1573. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1574. new pTargetName[24], pName[24];
  1575. GetPlayerName(playerid,pName,24);
  1576. GetPlayerName(targetid,pTargetName,24);
  1577. format(string, sizeof(string), ""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been unfrozen by Administrator %s.",pTargetName, pName);
  1578. SendClientMessageToAll(COLOR_RED,string);
  1579. TogglePlayerControllable(targetid, 1);
  1580. return 1;
  1581. }
  1582.  
  1583. //-----[Adminduty]-----
  1584. CMD:adminduty(playerid, params[])
  1585. {
  1586. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1587. if( AdminDuty[ playerid ] == 0 )
  1588. {
  1589. AdminDuty[ playerid ] = 1;
  1590. Admin[ playerid ] = Create3DTextLabel("ADMIN DUTY",0x5CD6CAFF,30.0,40.0,50.0,10.0,0);
  1591. Attach3DTextLabelToPlayer( Admin[ playerid ], playerid, 0.0, 0.0, 0.3);
  1592. new string[128];
  1593. new pName[24], pTame[24];
  1594. GetPlayerName(playerid,pName,24);
  1595. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s is on Admin Duty.",pName,pTame);
  1596. SendClientMessageToAll(COLOR_WHITE, string);
  1597. SetPlayerColor(playerid,COLOR_RED);
  1598. }
  1599. else
  1600. {
  1601. AdminDuty[ playerid ] = 0;
  1602. Delete3DTextLabel( Admin[ playerid ] );
  1603. new string[128];
  1604. new pName[24], pTame[24];
  1605. GetPlayerName(playerid,pName,24);
  1606. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s is off Admin Duty.",pName,pTame);
  1607. SendClientMessageToAll(COLOR_WHITE, string);
  1608. SetPlayerColor(playerid,COLOR_WHITE);
  1609. }
  1610. return 1;
  1611. }
  1612.  
  1613. //-----[Freeze All]-----
  1614. CMD:freezeall(playerid, params[])
  1615. {
  1616. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1617. new string[128];
  1618. new pName[24], pTame[24];
  1619. GetPlayerName(playerid,pName,24);
  1620. format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED" Administrator %s has frozen everyone.",pName,pTame);
  1621. SendClientMessageToAll(COLOR_RED, string);
  1622. for(new i=0; i<MAX_PLAYERS; i++)
  1623. {
  1624. if(IsPlayerConnected(i))
  1625. {
  1626. TogglePlayerControllable(i,0);
  1627. }
  1628. }
  1629. return 1;
  1630. }
  1631.  
  1632. //-----[Unfreeze All]-----
  1633. CMD:unfreezeall(playerid, params[])
  1634. {
  1635. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1636. new string[128];
  1637. new pName[24], pTame[24];
  1638. GetPlayerName(playerid,pName,24);
  1639. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" Administrator %s has unfrozen everyone.",pName,pTame);
  1640. SendClientMessageToAll(COLOR_RED, string);
  1641. for(new i=0; i<MAX_PLAYERS; i++)
  1642. {
  1643. if(IsPlayerConnected(i))
  1644. {
  1645. TogglePlayerControllable(i,1);
  1646. }
  1647. }
  1648. return 1;
  1649. }
  1650. // CHANGE team
  1651. // Will do this code later.
  1652.  
  1653. //-----[Jetpack]-----
  1654. CMD:jetpack(playerid, params[])
  1655. {
  1656. if(IsPlayerConnected(playerid))
  1657. {
  1658. if(PlayerInfo[playerid][Adminlevel] < 3)
  1659. {
  1660. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1661. return 1;
  1662. }
  1663. if(!IsPlayerInAnyVehicle(playerid))
  1664. {
  1665. SetPlayerSpecialAction(playerid, 2);
  1666. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Jetpack spawned. Dont forget to remove it with /removejet.");
  1667. }
  1668. }
  1669. return 1;
  1670. }
  1671. //-----------[Name change]-------------
  1672. CMD:changename(playerid, params[])
  1673. {
  1674. new targetid,name[128];
  1675. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1676. else if (sscanf(params,"us",targetid,name))SendClientMessage(playerid,COLOR_SYNTAX,"Usage: /changename [Playerid] [New name]");
  1677. else if(!IsPlayerConnected(targetid))SendClientMessage(playerid,COLOR_ERROR,"Error: Player is not connected!");
  1678. else
  1679. {
  1680. new string[128],n[MAX_PLAYER_NAME];
  1681. GetPlayerName(targetid,n,sizeof(n));
  1682. SetPlayerName(targetid,name);
  1683. format(string, sizeof(string), "Admin %s [ID:%d] Has set %s [ID:%d] name to %s",Name,playerid,n,targetid,name);
  1684. SendClientMessageToAll(YELLOW,string);
  1685. format(string, sizeof(string), "Your Name has been set to %s by Admin %s[ID:%d]",Name,n,playerid);
  1686. SendClientMessage(playerid,GREEN,string);
  1687. }
  1688. return 1;
  1689. }
  1690.  
  1691. //-----[Remove Jetpack]-----
  1692. CMD:removejet(playerid, params[])
  1693. {
  1694. if(IsPlayerConnected(playerid))
  1695. {
  1696. if(PlayerInfo[playerid][Adminlevel] < 3)
  1697. {
  1698. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1699. return 1;
  1700. }
  1701. if(!IsPlayerInAnyVehicle(playerid))
  1702. {
  1703. SetPlayerSpecialAction(playerid, 0);
  1704. SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ADMIN]"#COL_LRED" Your jetpack has been removed.");
  1705. }
  1706. }
  1707. return 1;
  1708. }
  1709.  
  1710. //-----[Goto]-----
  1711. CMD:goto(playerid, params[])
  1712. {
  1713. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1714. new targetid, string[128];
  1715. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /goto [PlayerID/PartOfName]");
  1716. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1717. else
  1718. {
  1719. new pName[24];
  1720. GetPlayerName(targetid,pName,128);
  1721. format(string, sizeof(string), ""#COL_YELLOW"[ADMIN]"#GREEN" You succesfully teleported to [%d] %s.",targetid, pName);
  1722. SendClientMessage(playerid,COLOR_RED,string);
  1723. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  1724. new Float:TPX, Float:TPY, Float:TPZ;
  1725. GetPlayerPos(targetid, TPX, TPY, TPZ);
  1726. SetPlayerPos(playerid, TPX, TPY, TPZ+1);
  1727. }
  1728. return 1;
  1729. }
  1730.  
  1731. //-----[Respawn]-----
  1732. CMD:respawn(playerid, params[])
  1733. {
  1734. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1735. new targetid;
  1736. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /respawn [PlayerID/PartOfName]");
  1737. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1738. else
  1739. {
  1740. new string[128];
  1741. new pName[24], pTame[24];
  1742. GetPlayerName(playerid,pName,24);
  1743. GetPlayerName(targetid,pTame,24);
  1744. format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been respawned by Administrator %s.",pTame,pName);
  1745. SendClientMessageToAll(COLOR_RED, string);
  1746. SpawnPlayer(targetid);
  1747. }
  1748. return 1;
  1749. }
  1750.  
  1751. //-----[Gethere]-----
  1752. CMD:gethere(playerid, params[])
  1753. {
  1754. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1755. new targetid, string[128];
  1756. if(sscanf(params, "uz", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /gethere [PlayerID/PartOfName]");
  1757. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
  1758. else
  1759. {
  1760. new pName[24];
  1761. GetPlayerName(playerid,pName,128);
  1762. format(string, sizeof(string), ""#COL_YELLOW"[ADMIN]"#COL_LRED" You have been teleported to Administrator %s.",pName);
  1763. SendClientMessage(targetid,COLOR_RED,string);
  1764. SetPlayerInterior(targetid,GetPlayerInterior(playerid));
  1765. new Float:TPX, Float:TPY, Float:TPZ;
  1766. GetPlayerPos(playerid, TPX, TPY, TPZ);
  1767. SetPlayerPos(targetid, TPX, TPY, TPZ+1);
  1768. }
  1769. return 1;
  1770. }
  1771. CMD:o(playerid, o[], help)
  1772. {
  1773. #pragma unused help
  1774. new name[ MAX_PLAYER_NAME ], string[ 128 ];
  1775. if(isnull(o)) return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /ooc [text]");
  1776. if(ooc == false && !IsPlayerAdmin( playerid )) return SendClientMessage(playerid,COLOR_ERROR -1,"[ERROR]: OOC Chat is disabled");
  1777. GetPlayerName(playerid, name, sizeof( name ));
  1778. format(string, sizeof(string),"[Global OOC Chat]%s: %s", name, o);
  1779. SendClientMessageToAll(GREY -1,string);
  1780. return 1;
  1781. }
  1782. CMD:addveh(playerid, params[])
  1783. {
  1784. #pragma unused params
  1785. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1786. if(IsPlayerInAnyVehicle(playerid)) {
  1787. new filestring[264],Float:X,Float:Y,Float:Z,Float:Rot;
  1788. GetPlayerPos(playerid,X,Y,Z);
  1789. GetVehicleZAngle(GetPlayerVehicleID(playerid), Rot);
  1790. new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
  1791. new File:pos=fopen("vehicles.ini", io_append);
  1792. format(filestring, 256, "\n%d,%f,%f,%f,%f,-1,-1 ;", vid, X, Y, Z, Rot);
  1793. fwrite(pos, filestring);
  1794. fclose(pos);
  1795. SendClientMessage(playerid,GREEN,"[SUCCESS]: You have successfully added a vehicle!");
  1796. }
  1797. else {
  1798. SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not in a vehicle!.");
  1799. }
  1800. return 1;
  1801. }
  1802. CMD:veh(playerid, params[])
  1803. {
  1804. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1805. {
  1806. new veh,color1,color2;
  1807. if (!sscanf(params, "iii", veh, color1,color2))
  1808. {
  1809. new Float:x, Float:y, Float:z;
  1810. GetPlayerPos(playerid, x,y,z);
  1811. AddStaticVehicle(veh, x,y,z,0,color1, color2);
  1812. }
  1813. else SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /veh [carid] [Color 1] [Color 2]");
  1814. }
  1815. return 1;
  1816. }
  1817. CMD:sendtols(playerid, params[])
  1818. {
  1819. new id, sendername[MAX_PLAYER_NAME], string[128];
  1820. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1821. else if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /sendtols [PlayerID]");
  1822. else if(GetPlayerState(id) == 2)
  1823. {
  1824. new tmpcar = GetPlayerVehicleID(id);
  1825. SetVehiclePos(tmpcar,1529.6,-1691.2,13.3);
  1826. }
  1827. else
  1828. {
  1829. SetPlayerPos(id, 1529.6,-1691.2,13.3);
  1830. }
  1831. GetPlayerName(playerid, sendername, sizeof(sendername));
  1832. sendername[strfind(sendername,"_")] = ' ';
  1833. format(string, sizeof(string),"[INFO]: You have been teleported to Los Santos by Administrator %s !", sendername);
  1834. SendClientMessage(id, GREEN, string);
  1835. SetPlayerInterior(id,0);
  1836. SetPlayerVirtualWorld(id, 0);
  1837. return 1;
  1838. }
  1839. CMD:setskin(playerid, params[])
  1840. {
  1841. new
  1842. id, skin, name[ MAX_PLAYER_NAME ], name2[ MAX_PLAYER_NAME ], str[ 128 ];
  1843. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1844. if( sscanf ( params, "ui", id, skin ) ) return SendClientMessage( playerid, COLOR_SYNTAX -1,#[SYNTAX]: /setskin [PlayerName/ID] [SkinModel]);
  1845. if( id == INVALID_PLAYER_ID ) return SendClientMessage( playerid,COLOR_ERROR -1, #[ERROR]: Invalid player ID);
  1846. if(skin > 299 || skin < 1) return SendClientMessage(playerid, -1,#Wrong Skin ID! Available ID's: 1-299);
  1847. GetPlayerName( playerid, name, MAX_PLAYER_NAME ); GetPlayerName( id, name2, MAX_PLAYER_NAME );
  1848. format( str, sizeof ( str ),"[SUCCESS] You have set %s skin to model %d", name2, skin);
  1849. SendClientMessage( playerid, GREEN -1, str );
  1850. format( str, sizeof ( str ),"[SUCCESS] Your skin has been set to model %d by %s", skin, name);
  1851. SendClientMessage( id, GREEN -1, str );
  1852. SetPlayerSkin( id, skin );
  1853. return true;
  1854. }
  1855. CMD:me(playerid, params[])
  1856. {
  1857. new name[MAX_PLAYER_NAME], str[128];
  1858. GetPlayerName(playerid, name, sizeof(name));
  1859. if(isnull(params))
  1860. return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /me [Action]");
  1861. format(str,sizeof(str),"*%s %s",name, params);
  1862. ProxDetector(30.0, playerid, str, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME);
  1863. return 1;
  1864. }
  1865.  
  1866.  
  1867. CMD:do(playerid, params[])
  1868. {
  1869. new name[MAX_PLAYER_NAME], str[128];
  1870. GetPlayerName(playerid, name, sizeof(name));
  1871. if(isnull(params))
  1872. return SendClientMessage(playerid,COLOR_SYNTAX -1,"[SYNTAX]: /do [Action]");
  1873. format(str,sizeof(str),"*%s ((%s))",params, name);
  1874. ProxDetector(30.0, playerid, str, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME, COLOR_ME);
  1875. return 1;
  1876. }
  1877.  
  1878.  
  1879. CMD:b(playerid,params[])
  1880. {
  1881. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /b [local ooc chat]");
  1882. new sendername[MAX_PLAYER_NAME], string[128];
  1883. GetPlayerName(playerid,sendername,sizeof(sendername));
  1884. sendername[strfind(sendername,"_")] = ' ';
  1885. format(string, sizeof(string), "((%s: %s ))", sendername, params);
  1886. ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  1887. return 1;
  1888. }
  1889.  
  1890.  
  1891. CMD:s(playerid,params[])
  1892. {
  1893. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /s [shout]");
  1894. new sendername[MAX_PLAYER_NAME], string[128];
  1895. GetPlayerName(playerid, sendername, sizeof(sendername));
  1896. format(string, sizeof(string), "%s Shouts: %s!!", sendername, params);
  1897. ProxDetector(40.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
  1898. return 1;
  1899. }
  1900.  
  1901.  
  1902. CMD:low(playerid,params[])
  1903. {
  1904. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"/low [Quiet Talk]");
  1905. new sendername[MAX_PLAYER_NAME], string[128];
  1906. GetPlayerName(playerid,sendername,sizeof(sendername));
  1907. sendername[strfind(sendername,"_")] = ' ';
  1908. format(string,sizeof(string), "%s says quietly: %s", sendername, params);
  1909. ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  1910. return 1;
  1911. }
  1912. CMD:l(playerid, params[])
  1913. {
  1914. return cmd_low(playerid, params);
  1915. }
  1916. CMD:enableooc(playerid, o[], help)
  1917. {
  1918. #pragma unused help
  1919. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1920. ooc = true;
  1921. SendClientMessageToAll(GREEN-1,"[INFO]: OOC Chat has been enabled");
  1922. return 1;
  1923. }
  1924. CMD:disableooc(playerid, o[], help)
  1925. {
  1926. #pragma unused help
  1927. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1928. if(ooc == true)
  1929. {
  1930. ooc = false;
  1931. SendClientMessageToAll(GREEN-1,"[INFO]: OOC Chat has been disabled");
  1932. }
  1933. return 1;
  1934. }
  1935. CMD:vrespawn(playerid, params[])
  1936. {
  1937. #pragma unused params
  1938. if(PlayerInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1939. new bool:VehicleUsed[MAX_VEHICLES] = false;
  1940. foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
  1941. {
  1942. if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
  1943. }
  1944. for(new i = 0; i < MAX_VEHICLES; i++)
  1945. {
  1946. if(VehicleUsed[i] == false) SetVehicleToRespawn(i);
  1947. }
  1948. return SendClientMessageToAll(GREEN,"[INFO]: All Unccupied Vehicles Have Been Respawned!");
  1949. }
  1950. COMMAND:cc( playerid, params[ ] )
  1951. {
  1952. #pragma unused params
  1953. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1954. for( new i = 0; i < 50; i++ ) SendClientMessageToAll(0x33FF33AA, " "); return 1;
  1955. }
  1956. CMD:sethp(playerid, params[])
  1957. {
  1958. new id, hp, sendername[MAX_PLAYER_NAME], string[128];
  1959. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1960. else if(sscanf(params,"ui", id, hp)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /sethp [PlayerID] [Amount]");
  1961. else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1962. else
  1963. {
  1964. SetPlayerHealth(id, hp);
  1965. GetPlayerName(playerid, sendername, sizeof(sendername));
  1966. sendername[strfind(sendername,"_")] = ' ';
  1967. format(string, sizeof(string),"[INFO]: Your health has been set to %i by Administrator %s", hp, sendername);
  1968. SendClientMessage(id, GREEN, string);
  1969. }
  1970. return 1;
  1971. }
  1972. CMD:setarmour(playerid, params[])
  1973. {
  1974. new id, arm, sendername[MAX_PLAYER_NAME], string[128];
  1975. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1976. else if(sscanf(params,"ui", id, arm)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /sethp [PlayerID] [Amount]");
  1977. else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  1978. else
  1979. {
  1980. SetPlayerArmour(id, arm);
  1981. GetPlayerName(playerid, sendername, sizeof(sendername));
  1982. sendername[strfind(sendername,"_")] = ' ';
  1983. format(string, sizeof(string),"[INFO]: Your Armour has been set to %i by Administrator %s", arm, sendername);
  1984. SendClientMessage(id, GREEN, string);
  1985. }
  1986. return 1;
  1987. }
  1988. CMD:givegun(playerid, params[])
  1989. {
  1990. new id, gun, ammo;
  1991. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  1992. else if(sscanf(params,"uii", id, gun, ammo)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /givegun [PlayerID] [GunID] [Ammo]");
  1993. else if(gun > 47 || gun < 1) return SendClientMessage(playerid, COLOR_YELLOW,"[INFO]: GUN ID'S: 1-47");
  1994. else if(ammo > 999 || ammo < 1) return SendClientMessage(playerid, COLOR_YELLOW,"[INFO]: Ammo 1-999");
  1995. else
  1996. {
  1997. GivePlayerWeapon(id, gun, ammo);
  1998. }
  1999. return 1;
  2000. }
  2001. CMD:healall(playerid, params[])
  2002. {
  2003. new sendername[MAX_PLAYER_NAME], string[128];
  2004. GetPlayerName(playerid, sendername, sizeof(sendername));
  2005. sendername[strfind(sendername,"_")] = ' ';
  2006. if(PlayerInfo[playerid][Adminlevel] < 3) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  2007. else
  2008. {
  2009. format(string, sizeof(string), "[INFO]: Administrator %s has healed everyone", sendername);
  2010. SendClientMessageToAll(GREEN, string);
  2011. for(new i = 0; i < MAX_PLAYERS; i ++)
  2012. SetPlayerHealth(i,100);
  2013. }
  2014. return 1;
  2015. }
  2016. CMD:admins(playerid,params[])
  2017. {
  2018. if(IsPlayerConnected(playerid))
  2019. {
  2020. SendClientMessage(playerid, COLOR_WHITE, " ");
  2021. SendClientMessage(playerid, COLOR_WHITE, "-| ADMINS |-");
  2022. for(new i = 0; i < MAX_PLAYERS; i++)
  2023. {
  2024. if(IsPlayerConnected(i))
  2025. {
  2026. if(PlayerInfo[i][Adminlevel] >= 1 && PlayerInfo[i][Adminlevel] < 1341)
  2027. {
  2028. new admtext[64];
  2029. new sendername[MAX_PLAYER_NAME];
  2030. new string[256];
  2031. if(PlayerInfo[i][Adminlevel] == 1) { admtext = "Trial Admin"; }
  2032. else if(PlayerInfo[i][Adminlevel] == 2) { admtext = "Administrator"; }
  2033. else if(PlayerInfo[i][Adminlevel] == 3) { admtext = "Senior Administrator"; }
  2034. else if(PlayerInfo[i][Adminlevel] == 4) { admtext = "Level 1337 - Management"; }
  2035. else { admtext = "Admins"; }
  2036. GetPlayerName(i, sendername, sizeof(sendername));
  2037. format(string, 256, "%s [ %s ]", sendername, admtext);
  2038. SendClientMessage(playerid, COLOR_GREEN, string);
  2039. }
  2040. }
  2041. }
  2042. }
  2043. return 1;
  2044. }
  2045. CMD:gamemasters(playerid,params[])
  2046. {
  2047. if(IsPlayerConnected(playerid))
  2048. {
  2049. SendClientMessage(playerid, COLOR_WHITE, "_______________________________________ ");
  2050. SendClientMessage(playerid, COLOR_WHITE, "-____________ Gamemasters___________-");
  2051. for(new i = 0; i < MAX_PLAYERS; i++)
  2052. {
  2053. if(IsPlayerConnected(i))
  2054. {
  2055. if(PlayerInfo[i][Helperlevel] >= 1 && PlayerInfo[i][Helperlevel] < 1341)
  2056. {
  2057. new helpertext[64];
  2058. new sendername[MAX_PLAYER_NAME];
  2059. new string[256];
  2060. if(PlayerInfo[i][Helperlevel] == 1) { helpertext = "Trial Gamemaster(s)"; }
  2061. else if(PlayerInfo[i][Helperlevel] == 2) { helpertext = "Gamemaster(s)"; }
  2062. else if(PlayerInfo[i][Helperlevel] == 3) { helpertext = "Senior Gamemaster(s)"; }
  2063. else if(PlayerInfo[i][Helperlevel] == 4) { helpertext = "Lead Gamemaster"; }
  2064. else { helpertext = "Gamemaster"; }
  2065. GetPlayerName(i, sendername, sizeof(sendername));
  2066. format(string, 256, "%s [ %s ]", sendername, helpertext);
  2067. SendClientMessage(playerid, COLOR_WHITE, string);
  2068. }
  2069. }
  2070. }
  2071. }
  2072. return 1;
  2073. }
  2074. CMD:report(playerid,params[])
  2075. {
  2076. new id, reason[35], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
  2077. if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /report [PlayerID] [Reason]");
  2078. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  2079. else
  2080. {
  2081. GetPlayerName(id, name,sizeof(name));
  2082. GetPlayerName(playerid, sendername, sizeof(sendername));
  2083. sendername[strfind(sendername,"_")] = ' ';
  2084. format(string, sizeof(string), "[ID:%d] %s has reported %s: %s.", playerid, sendername, name, reason);
  2085. ABroadCast(COLOR_YELLOW,string,1);
  2086. format(string, sizeof(string), "[INFO]: If he misused it, PM him about it using /apm.");
  2087. ABroadCast(COLOR_YELLOW,string,1);
  2088. format(string, sizeof(string), "[INFO]: Your report was just send to the online admins, please wait for a reply");
  2089. SendClientMessage(playerid,GREEN,string);
  2090.  
  2091. return 1;
  2092. }
  2093. }
  2094. CMD:helpme(playerid, params[])
  2095. {
  2096. new string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], id;
  2097. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /helpme [Description]");
  2098. GetPlayerName(playerid,sendername,sizeof(sendername));
  2099. GetPlayerName(id,name,sizeof(name));
  2100. format(string,sizeof(string),"[INFO]: %s has requested for help: %s", sendername, params);
  2101. HBroadCast(ORANGE,string,1);
  2102. SendClientMessage(playerid, GREEN,"[INFO]: You have requested for help, please wait for a reply");
  2103. PlayerNeedsHelp[id] = 1;
  2104. return 1;
  2105. }
  2106. CMD:whisper(playerid, params[])
  2107. {
  2108. new id, text[35], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  2109. if(sscanf(params,"uz", id, text)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /(w)hisper [PlayerID] [Text]");
  2110. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  2111. else
  2112. {
  2113. new Float:x, Float:y, Float:z;
  2114. GetPlayerPos(id,x,y,z);
  2115. if(PlayerToPoint(5, playerid, x,y,z))
  2116. {
  2117. GetPlayerName(playerid, sendername,sizeof(sendername));
  2118. GetPlayerName(id, name, sizeof(name));
  2119. if(id == playerid)
  2120. {
  2121. format(string,sizeof(string),"%s mutters something", sendername);
  2122. ProxDetector(5.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  2123. }
  2124. else
  2125. {
  2126. format(string,sizeof(string),"%s whispers something to %s", sendername, name);
  2127. ProxDetector(15.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  2128. }
  2129. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  2130. SendClientMessage(id, COLOR_YELLOW3, string);
  2131. format(string, sizeof(string), "%s whispers: %s", sendername, text);
  2132. SendClientMessage(playerid, COLOR_YELLOW3, string);
  2133. }
  2134. else return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: That player is not near you!");
  2135. }
  2136. return 1;
  2137. }
  2138. CMD:w(playerid, params[])
  2139. {
  2140. return cmd_whisper(playerid, params);
  2141. }
  2142. CMD:pay(playerid, params[])
  2143. {
  2144. new id, money, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  2145. if(sscanf(params,"ui", id, money)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /pay [PlayerID] [Amount]");
  2146. if(money < 1 || money > 2000) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: You can't pay less than 1 Dollar!.");
  2147. if(!ProxDetectorS(5.0, playerid, id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: You are too far away from that player!");
  2148. else
  2149. {
  2150. GetPlayerName(id, name, sizeof(name));
  2151. GetPlayerName(playerid, sendername, sizeof(sendername));
  2152. new pmoney = GetPlayerMoney(playerid);
  2153. if (money > 0 && pmoney >= money)
  2154. {
  2155. GivePlayerMoney(playerid, (0 - money));
  2156. GivePlayerMoney(id, money);
  2157. format(string, sizeof(string), "[INFO]: You payed %s(ID: %d) $%d.", name,id, money);
  2158. SendClientMessage(playerid, GREEN, string);
  2159. format(string, sizeof(string), "[INFO]: You recieved $%d from %s(ID: %d).", money, sendername, playerid);
  2160. {
  2161. }
  2162. sendername[strfind(sendername,"_")] = ' ';
  2163. format(string, sizeof(string), "* %s takes out %d$ from his pocket and hands it to %s.", sendername , money ,name);
  2164. ProxDetector(30.0, playerid, string, COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME,COLOR_ME);
  2165. ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
  2166. }
  2167. }
  2168. return 1;
  2169. }
  2170. CMD:givemoney(playerid, params[])
  2171. {
  2172. new id, cash, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
  2173. if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  2174. if(sscanf(params,"ui", id, cash)) return SendClientMessage(playerid, COLOR_SYNTAX,"[SYNTAX]: /givemoney [playerid/partofname] [ammount]");
  2175. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR]: Invalid player ID");
  2176. else
  2177. {
  2178. GivePlayerMoney(id, cash);
  2179. GetPlayerName(playerid,sendername,sizeof(sendername));
  2180. GetPlayerName(id,name,sizeof(name));
  2181. format(string,sizeof(string),"[INFO]: %s has given %s money in amout of: $%d", sendername, name, cash);
  2182. ABroadCast(GREEN,string,1);
  2183. format(string,sizeof(string),"[INFO]: You have recieved %d money from Administrator in amount of: $%s", cash, sendername);
  2184. SendClientMessage(id, GREEN, string);
  2185. }
  2186. return 1;
  2187. }
  2188. //-----[Adminchat]-----
  2189. CMD:a(playerid, params[])
  2190. {
  2191. if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
  2192. new pName[MAX_PLAYER_NAME], string[128];
  2193. GetPlayerName(playerid, pName, sizeof(pName));
  2194. if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /a [Text]" );
  2195.  
  2196. format(string, sizeof(string), "(( Administrator %s: %s ))", pName, params);
  2197. SendMessageToAdmins(ORANGE,string);
  2198.  
  2199. return 1;
  2200. }
  2201. CMD:ad( playerid, params[]) //This ad will not add any name or contact number, so adverts wont be MG'ed if the advertiser does not want his name in.
  2202. {
  2203. if( !strlen ( params ) )
  2204. return SendClientMessage ( playerid, COLOR_SYNTAX, "[SYNTAX]: /ad [Advertisement]" );
  2205.  
  2206. if( strlen( params ) < 2 )
  2207. return SendClientMessage( playerid, COLOR_ERROR, "[ERROR]: Your advertisement is not long enough." );
  2208.  
  2209. new szAdMsg[255];
  2210. format( szAdMsg, 255, "Advertisement: %s", params );
  2211. SendClientMessageToAll( COLOR_GREEN, szAdMsg );
  2212. return 1;
  2213. }
  2214. //-----[Create LMS]-----
  2215. CMD:createlms(playerid, params[]) {
  2216. new
  2217. WeaponID,
  2218. RewardAmount,
  2219. string[128],
  2220. player_Name[MAX_PLAYER_NAME];
  2221.  
  2222. if(PlayerInfo[playerid][Adminlevel] < 5) {
  2223.  
  2224. if(sscanf(params, "ii", WeaponID, RewardAmount))
  2225. return SendClientMessage(playerid, -1, ""#COL_DGREY"[CMD] / "#COL_SGREY"[WeaponID] [Reward]");
  2226.  
  2227. GetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  2228. GetPlayerFacingAngle(playerid, g_EventPosition[3]);
  2229. GetPlayerRame(playerid, player_Name, sizeof(player_Name));
  2230.  
  2231. g_EventWeapon = WeaponID;
  2232. g_EventReward = RewardAmount;
  2233. format(string, sizeof(string), ""COL_BROWN"[EVENT]"#COL_EASY" Administrator %s has created an DM event! "#COL_BROWN"/join "#COL_EASY"to join the event!", player_Name);
  2234. SendClientMessageToAll(-1, string);
  2235.  
  2236. SetTimerEx("UnfreezeLMS", 20000, false, "i", playerid);
  2237.  
  2238. g_EventOpen = 1;
  2239. g_EventPlayers = 0;
  2240.  
  2241. }
  2242. else return SendClientMessage(playerid, COLOR_RED, ".:: You are not authorized to use this command ::.");
  2243. return true;
  2244.  
  2245. }
  2246.  
  2247. //-----[Join LMS]-----
  2248. CMD:join(playerid, params[]) {
  2249. #pragma unused params
  2250. if(pInEvent[playerid] == 0) {
  2251. if(g_EventOpen == 1) {
  2252.  
  2253. SetPlayerPos(playerid, g_EventPosition[0], g_EventPosition[1], g_EventPosition[2]);
  2254. SetPlayerFacingAngle(playerid, g_EventPosition[3]);
  2255.  
  2256. ResetPlayerWeapons(playerid);
  2257. GivePlayerWeapon(playerid, g_EventWeapon, 100000);
  2258.  
  2259. GameTextForPlayer(playerid, "~g~Joined event~n~~w~Please wait..", 3000, 3);
  2260.  
  2261. TogglePlayerControllable(playerid, 0);
  2262.  
  2263. g_EventPlayers++;
  2264. pInEvent[playerid] = 1; //Now in the event!
  2265.  
  2266. }
  2267. else return SendClientMessage(playerid, COLOR_RED, ".:: No event is going on ::.");
  2268.  
  2269. }
  2270. else return SendClientMessage(playerid, COLOR_RED, ".:: You're already in the event ::.");
  2271.  
  2272. return true;
  2273.  
  2274. }
  2275.  
  2276. // .:-----------------------------------------------------------------------:.
  2277. // .:=======================================================================:.
  2278. // { This is the start of IRC commands. }
  2279. // { Date: 09/09/11 using IRC plugin }
  2280. // { Last Updated: 10/09/11 By: Kingunit }
  2281. //
  2282. // .:-----------------------------------------------------------------------:.
  2283. // .:=======================================================================:.
  2284.  
  2285. //-----[IRC Kick]-----
  2286. IRCCMD:kick(botid, channel[], user[], host[], params[])
  2287. {
  2288. if (IRC_IsOp(botid, channel, user))
  2289. {
  2290. new playerid, reason[64];
  2291. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  2292. {
  2293. return 1;
  2294. }
  2295. if (IsPlayerConnected(playerid))
  2296. {
  2297. new msg[128], name[MAX_PLAYER_NAME];
  2298. GetPlayerName(playerid, name, sizeof(name));
  2299. format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
  2300. IRC_GroupSay(gGroupID, channel, msg);
  2301. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been kicked by IRC Admin %s: %s", name, user, reason);
  2302. SendClientMessageToAll(0x0000FFFF, msg);
  2303.  
  2304. Kick(playerid);
  2305. }
  2306. }
  2307. return 1;
  2308. }
  2309.  
  2310. //-----[IRC Ban]-----
  2311. IRCCMD:ban(botid, channel[], user[], host[], params[])
  2312. {
  2313. if (IRC_IsOp(botid, channel, user))
  2314. {
  2315. new playerid, reason[64];
  2316. if (sscanf(params, "dS(No reason)[64]", playerid, reason))
  2317. {
  2318. return 1;
  2319. }
  2320. if (IsPlayerConnected(playerid))
  2321. {
  2322. new msg[128], name[MAX_PLAYER_NAME];
  2323. GetPlayerName(playerid, name, sizeof(name));
  2324. format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
  2325. IRC_GroupSay(gGroupID, channel, msg);
  2326. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been banned by IRC Admin %s: %s", name, user, reason);
  2327. SendClientMessageToAll(0x0000FFFF, msg);
  2328.  
  2329. BanEx(playerid, reason);
  2330. }
  2331. }
  2332. return 1;
  2333. }
  2334.  
  2335. //-----[IRC RCON]-----
  2336. IRCCMD:rcon(botid, channel[], user[], host[], params[])
  2337. {
  2338. if (IRC_IsOp(botid, channel, user))
  2339. {
  2340. if (!isnull(params))
  2341. {
  2342. if (strcmp(params, "exit", true) != 0 && strfind(params, "loadfs irc", true) == -1)
  2343. {
  2344. new msg[128];
  2345. format(msg, sizeof(msg), "RCON command %s has been executed.", params);
  2346. IRC_GroupSay(gGroupID, channel, msg);
  2347.  
  2348. SendRconCommand(params);
  2349. }
  2350. }
  2351. }
  2352. return 1;
  2353. }
  2354.  
  2355. //-----[IRC Slap]-----
  2356. IRCCMD:slap(botid, channel[], user[], host[], params[])
  2357. {
  2358. if (IRC_IsHalfop(botid, channel, user))
  2359. {
  2360. new playerid;
  2361. if (IsPlayerConnected(playerid))
  2362. {
  2363. new Float:SLX, Float:SLY, Float:SLZ;
  2364. GetPlayerPos(playerid, SLX, SLY,SLZ);
  2365. SetPlayerPos(playerid, SLX, SLY, SLZ+5);
  2366.  
  2367. new msg[128], name[MAX_PLAYER_NAME];
  2368. GetPlayerName(playerid, name, sizeof(name));
  2369.  
  2370. format(msg, sizeof(msg), "02*** %s has been slapped by IRC Admin %s", name, user);
  2371. IRC_GroupSay(gGroupID, channel, msg);
  2372. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been slapped by IRC Admin %s", name, user);
  2373. SendClientMessageToAll(0x0000FFFF, msg);
  2374. }
  2375. }
  2376. return 1;
  2377. }
  2378.  
  2379. //-----[IRC Explode]-----
  2380. IRCCMD:explode(botid, channel[], user[], host[], params[])
  2381. {
  2382. if (IRC_IsHalfop(botid, channel, user))
  2383. {
  2384. new playerid;
  2385. if (IsPlayerConnected(playerid))
  2386. {
  2387. new Float:SLX, Float:SLY, Float:SLZ;
  2388. GetPlayerPos(playerid, SLX, SLY,SLZ);
  2389. CreateExplosion(SLX, SLY, SLZ, 11, 0.25);
  2390.  
  2391. new msg[128], name[MAX_PLAYER_NAME];
  2392. GetPlayerName(playerid, name, sizeof(name));
  2393.  
  2394. format(msg, sizeof(msg), "02*** %s has been exploded by IRC Admin %s", name, user);
  2395. IRC_GroupSay(gGroupID, channel, msg);
  2396. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been exploded by IRC Admin %s", name, user);
  2397. SendClientMessageToAll(0x0000FFFF, msg);
  2398. }
  2399. }
  2400. return 1;
  2401. }
  2402.  
  2403. //-----[IRC Armup]-----
  2404. IRCCMD:armup(botid, channel[], user[], host[], params[])
  2405. {
  2406. if (IRC_IsHalfop(botid, channel, user))
  2407. {
  2408. new playerid;
  2409. if (IsPlayerConnected(playerid))
  2410. {
  2411. new msg[128], name[MAX_PLAYER_NAME];
  2412. GetPlayerName(playerid, name, sizeof(name));
  2413.  
  2414. SetPlayerHealth(playerid, 100);
  2415. SetPlayerArmour(playerid, 100.0);
  2416. GivePlayerWeapon(playerid, 24, 500);
  2417. GivePlayerWeapon(playerid, 27, 500);
  2418. GivePlayerWeapon(playerid, 31, 500);
  2419. GivePlayerWeapon(playerid, 1, 1);
  2420.  
  2421. format(msg, sizeof(msg), "02*** %s has been armed by IRC Admin %s", name, user);
  2422. IRC_GroupSay(gGroupID, channel, msg);
  2423. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been armed by IRC Admin %s", name, user);
  2424. SendClientMessageToAll(0x0000FFFF, msg);
  2425. }
  2426. }
  2427. return 1;
  2428. }
  2429.  
  2430. //-----[IRC Respawn]-----
  2431. IRCCMD:respawn(botid, channel[], user[], host[], params[])
  2432. {
  2433. if (IRC_IsHalfop(botid, channel, user))
  2434. {
  2435. new playerid;
  2436. if (IsPlayerConnected(playerid))
  2437. {
  2438. new msg[128], name[MAX_PLAYER_NAME];
  2439. GetPlayerName(playerid, name, sizeof(name));
  2440.  
  2441. format(msg, sizeof(msg), "02*** %s has been respawned by IRC Admin %s", name, user);
  2442. IRC_GroupSay(gGroupID, channel, msg);
  2443. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been respawned by IRC Admin %s", name, user);
  2444. SendClientMessageToAll(0x0000FFFF, msg);
  2445.  
  2446. SpawnPlayer(playerid);
  2447. }
  2448. }
  2449. return 1;
  2450. }
  2451.  
  2452. //-----[IRC Freeze]-----
  2453. IRCCMD:freeze(botid, channel[], user[], host[], params[])
  2454. {
  2455. if (IRC_IsHalfop(botid, channel, user))
  2456. {
  2457. new playerid;
  2458. if (IsPlayerConnected(playerid))
  2459. {
  2460. new msg[128], name[MAX_PLAYER_NAME];
  2461. GetPlayerName(playerid, name, sizeof(name));
  2462.  
  2463. format(msg, sizeof(msg), "02*** %s has been frozen by IRC Admin %s", name, user);
  2464. IRC_GroupSay(gGroupID, channel, msg);
  2465. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been frozen by IRC Admin %s", name, user);
  2466. SendClientMessageToAll(0x0000FFFF, msg);
  2467.  
  2468. TogglePlayerControllable(playerid, 0);
  2469. }
  2470. }
  2471. return 1;
  2472. }
  2473.  
  2474. //-----[IRC Unfreeze]-----
  2475. IRCCMD:unfreeze(botid, channel[], user[], host[], params[])
  2476. {
  2477. if (IRC_IsHalfop(botid, channel, user))
  2478. {
  2479. new playerid;
  2480. if (IsPlayerConnected(playerid))
  2481. {
  2482. new msg[128], name[MAX_PLAYER_NAME];
  2483. GetPlayerName(playerid, name, sizeof(name));
  2484.  
  2485. format(msg, sizeof(msg), "02*** %s has been unfrozen by IRC Admin %s", name, user);
  2486. IRC_GroupSay(gGroupID, channel, msg);
  2487. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" %s has been unfrozen by IRC Admin %s", name, user);
  2488. SendClientMessageToAll(0x0000FFFF, msg);
  2489.  
  2490. TogglePlayerControllable(playerid, 1);
  2491. }
  2492. }
  2493. return 1;
  2494. }
  2495.  
  2496. //-----[IRC Freezeall]-----
  2497. IRCCMD:freezeall(botid, channel[], user[], host[], params[])
  2498. {
  2499. if (IRC_IsOp(botid, channel, user))
  2500. {
  2501. new playerid;
  2502. if (IsPlayerConnected(playerid))
  2503. {
  2504. new msg[128], name[MAX_PLAYER_NAME];
  2505. GetPlayerName(playerid, name, sizeof(name));
  2506.  
  2507. format(msg, sizeof(msg), "02*** All players are frozen by IRC Admin %s", user);
  2508. IRC_GroupSay(gGroupID, channel, msg);
  2509.  
  2510. format(msg, sizeof(msg), ""#COL_ORANGE"[SERVER]"#COL_LRED" All players are frozen by IRC Admin %s", user);
  2511. SendClientMessageToAll(0x0000FFFF, msg);
  2512.  
  2513. for(new i=0; i<MAX_PLAYERS; i++)
  2514. {
  2515. if(IsPlayerConnected(i))
  2516. {
  2517. TogglePlayerControllable(i,0);
  2518. }
  2519. }
  2520. }
  2521. }
  2522. return 1;
  2523. }
  2524. //----[PROX DETECTOR]-----
  2525. ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  2526. {
  2527. if(IsPlayerConnected(playerid))
  2528. {
  2529. new Float:posx, Float:posy, Float:posz;
  2530. new Float:oldposx, Float:oldposy, Float:oldposz;
  2531. new Float:tempposx, Float:tempposy, Float:tempposz;
  2532. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2533. for(new i = 0; i < MAX_PLAYERS; i++)
  2534. {
  2535. if(IsPlayerConnected(i))
  2536. {
  2537. GetPlayerPos(i, posx, posy, posz);
  2538. tempposx = (oldposx -posx);
  2539. tempposy = (oldposy -posy);
  2540. tempposz = (oldposz -posz);
  2541. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  2542. {
  2543. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  2544. {
  2545. SendClientMessage(i, col1, string);
  2546. }
  2547. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  2548. {
  2549. SendClientMessage(i, col2, string);
  2550. }
  2551. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  2552. {
  2553. SendClientMessage(i, col3, string);
  2554. }
  2555. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  2556. {
  2557. SendClientMessage(i, col4, string);
  2558. }
  2559. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2560. {
  2561. SendClientMessage(i, col5, string);
  2562. }
  2563. }
  2564. }
  2565. }
  2566. }
  2567. return 1;
  2568. //======[STOCKS]======
  2569. }
  2570. stock strreplace(string[], find, replace)
  2571. {
  2572. for(new i=0; string[i]; i++)
  2573. {
  2574. if(string[i] == find)
  2575. {
  2576. string[i] = replace;
  2577. }
  2578. }
  2579. }
  2580. stock LoadStaticVehiclesFromFile(const filename[])
  2581. {
  2582. new File:file_ptr;
  2583. new line[256];
  2584. new var_from_line[64];
  2585. new vehicletype;
  2586. new Float:SpawnX;
  2587. new Float:SpawnY;
  2588. new Float:SpawnZ;
  2589. new Float:SpawnRot;
  2590. new Color1, Color2;
  2591. new index;
  2592. new vehicles_loaded;
  2593.  
  2594. file_ptr = fopen(filename,filemode:io_read);
  2595. if(!file_ptr) return 0;
  2596.  
  2597. vehicles_loaded = 0;
  2598.  
  2599. while(fread(file_ptr,line,256) > 0) {
  2600. index = 0;
  2601.  
  2602. // Read type
  2603. index = token_by_delim(line,var_from_line,',',index);
  2604. if(index == (-1)) continue;
  2605. vehicletype = strval(var_from_line);
  2606. if(vehicletype < 400 || vehicletype > 611) continue;
  2607.  
  2608. // Read X, Y, Z, Rotation
  2609. index = token_by_delim(line,var_from_line,',',index+1);
  2610. if(index == (-1)) continue;
  2611. SpawnX = floatstr(var_from_line);
  2612.  
  2613. index = token_by_delim(line,var_from_line,',',index+1);
  2614. if(index == (-1)) continue;
  2615. SpawnY = floatstr(var_from_line);
  2616.  
  2617. index = token_by_delim(line,var_from_line,',',index+1);
  2618. if(index == (-1)) continue;
  2619. SpawnZ = floatstr(var_from_line);
  2620.  
  2621. index = token_by_delim(line,var_from_line,',',index+1);
  2622. if(index == (-1)) continue;
  2623. SpawnRot = floatstr(var_from_line);
  2624.  
  2625. // Read Color1, Color2
  2626. index = token_by_delim(line,var_from_line,',',index+1);
  2627. if(index == (-1)) continue;
  2628. Color1 = strval(var_from_line);
  2629.  
  2630. index = token_by_delim(line,var_from_line,';',index+1);
  2631. Color2 = strval(var_from_line);
  2632.  
  2633. //printf("%d,%d,%f,%f,%f,%f,%d,%d",total_vehicles_from_files+vehicles_loaded+1,vehicletype,SpawnX,SpawnY,SpawnZ,SpawnRot,Color1,Color2);
  2634.  
  2635. // respawn 30 minutes
  2636. AddStaticVehicleEx(vehicletype,SpawnX,SpawnY,SpawnZ+1,SpawnRot,Color1,Color2,(30*60));
  2637. vehicles_loaded++;
  2638. }
  2639.  
  2640. fclose(file_ptr);
  2641. printf("Loaded %d vehicles from: %s",vehicles_loaded,filename);
  2642. return vehicles_loaded;
  2643. }
  2644.  
  2645.  
  2646. stock token_by_delim(const string[], return_str[], delim, start_index)
  2647. {
  2648. new x=0;
  2649. while(string[start_index] != EOS && string[start_index] != delim) {
  2650. return_str[x] = string[start_index];
  2651. x++;
  2652. start_index++;
  2653. }
  2654. return_str[x] = EOS;
  2655. if(string[start_index] == EOS) start_index = (-1);
  2656. return start_index;
  2657. }
  2658.  
  2659. stock GetName(playerid) {
  2660. new sPlayerName[MAX_PLAYER_NAME];
  2661. GetPlayerName(playerid, sPlayerName, sizeof(sPlayerName));
  2662. return sPlayerName;
  2663. }
  2664.  
  2665. stock IsRolePlayName(playerid, bool:alphaonly = true)
  2666. {
  2667. new trpn[MAX_PLAYER_NAME];
  2668. if(GetPlayerName(playerid,trpn,sizeof(trpn))) {
  2669. new strd = strfind(trpn, "_", false);
  2670.  
  2671. if(strfind(trpn,"_",false,strd+1) == -1) {
  2672. if(strd > 0) {
  2673. if(trpn[strd-1] && trpn[strd+1]) {
  2674. if(alphaonly) {
  2675. for(new a = 0, l = strlen(trpn); a < l; a++) {
  2676. switch(trpn[a]) {
  2677. case '0' .. '9': return 0;
  2678.  
  2679. case 'a' .. 'z': continue;
  2680. case 'A' .. 'Z': continue;
  2681. // easier than specifying every invalid char
  2682. case '_': continue;
  2683.  
  2684. default: return 0;
  2685. }
  2686. }
  2687. }
  2688. return 1;
  2689. }
  2690. }
  2691. }
  2692. }
  2693. return 0;
  2694. }
  2695. stock SendMessageToAdmins(color, string[])
  2696. {
  2697. for(new i = 0; i < MAX_PLAYERS; i++)
  2698. {
  2699. if(IsPlayerConnected(i) && PlayerInfo[i][Adminlevel] > 0) // Own var
  2700. {
  2701. SendClientMessage(i, color, string);
  2702. }
  2703. }
  2704. return 1;
  2705. }
  2706. stock SendMessageToHelpers(color, string[])
  2707. {
  2708. for(new i = 0; i < MAX_PLAYERS; i++)
  2709. {
  2710. if(IsPlayerConnected(i) && PlayerInfo[i][Helperlevel] > 0) // Own var
  2711. {
  2712. SendClientMessage(i, color, string);
  2713. }
  2714. }
  2715. return 1;
  2716. }
  2717. public Timer()
  2718. {
  2719. for(new a=0; a<MAX_PLAYERS; a++)
  2720. {
  2721. GivePlayerMoney(a, 3000);
  2722. SetPlayerScore(a, GetPlayerScore(a)+1);
  2723. }
  2724. SendClientMessageToAll(COLOR_LIGHTGREEN, "You have recieved 3,000$ by the Local Government for being a citizen.");
  2725. SendClientMessageToAll(COLOR_LIGHTGREEN, "(( One point / score has been added to your account for Completion of 1 hour. ))");
  2726. return 1;
  2727. }
  2728. public ABroadCast(color,const string[],level)
  2729. {
  2730. for(new i = 0; i < MAX_PLAYERS; i++)
  2731. {
  2732. if(IsPlayerConnected(i))
  2733. {
  2734. if (PlayerInfo[i][Adminlevel] >= level)
  2735. {
  2736. SendClientMessage(i, color, string);
  2737. }
  2738. }
  2739. }
  2740. return 1;
  2741. }
  2742. public HBroadCast(color,const string[],level)
  2743. {
  2744. for(new i = 0; i < MAX_PLAYERS; i++)
  2745. {
  2746. if(IsPlayerConnected(i))
  2747. {
  2748. if (PlayerInfo[i][Helperlevel] >= level)
  2749. {
  2750. SendClientMessage(i, color, string);
  2751. }
  2752. }
  2753. }
  2754. return 1;
  2755. }
  2756. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  2757. {
  2758. if(IsPlayerConnected(playerid))
  2759. {
  2760. new Float:oldposx, Float:oldposy, Float:oldposz;
  2761. new Float:tempposx, Float:tempposy, Float:tempposz;
  2762. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2763. tempposx = (oldposx -x);
  2764. tempposy = (oldposy -y);
  2765. tempposz = (oldposz -z);
  2766. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2767. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2768. {
  2769. return 1;
  2770. }
  2771. }
  2772. return 0;
  2773. }
  2774. public ProxDetectorS(Float:radi, playerid, targetid)
  2775. {
  2776. if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  2777. {
  2778. new Float:posx, Float:posy, Float:posz;
  2779. new Float:oldposx, Float:oldposy, Float:oldposz;
  2780. new Float:tempposx, Float:tempposy, Float:tempposz;
  2781. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2782. //radi = 2.0; //Trigger Radius
  2783. GetPlayerPos(targetid, posx, posy, posz);
  2784. tempposx = (oldposx -posx);
  2785. tempposy = (oldposy -posy);
  2786. tempposz = (oldposz -posz);
  2787. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  2788. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2789. {
  2790. return 1;
  2791. }
  2792. }
  2793. return 0;
  2794. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement