Guest User

Untitled

a guest
Jun 9th, 2012
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.22 KB | None | 0 0
  1. // This gamemode is made by Audi_Quattrix
  2. // It is started on 2012.06.09 at 10:00am
  3. #include <a_samp>
  4.  
  5. #if defined FILTERSCRIPT
  6. #pragma tabsize 0
  7.  
  8. #include <a_samp>
  9. #include <YSI\y_ini>
  10. #include <zcmd>
  11. #include <foreach>
  12. #include <sscanf>
  13. #include <dini>
  14. #include <dudb>
  15. #pragma unused ret_memcpy
  16.  
  17. #define Ferg 1336
  18. #define DIALOG_REGISTER1 0
  19. #define DIALOG_REGISTER2 1
  20. #define DIALOG_REGISTER3 2
  21. #define DIALOG_REGISTER4 3
  22. #define DIALOG_LOGIN1 4
  23. #define DIALOG_NOPW1 5
  24. #define DIALOG_NOPW2 6
  25. #define DIALOG_WRONGPW 7
  26. #define weapons 1111
  27. #define cars 1112
  28. // Create a folder "Users" in scriptfiles
  29. #define SERVER_USER_FILE "Users/%s.ini"
  30. #include "../include/gl_common.inc"
  31.  
  32. // This is For Groves Spawn place
  33. new Float:gRandomSpawns[][] = //Grove
  34. {
  35. {2528.8550,-1667.2024,15.1685},
  36. {2495.1848,-1688.9705,14.1388},
  37. {2487.5295,-1647.2445,17.8239},
  38. {2524.3560,-1677.0464,19.9302}
  39. };
  40. // This is For Groves Spawn place
  41.  
  42. //----------------------------------------------------------------------------------
  43. // This is For Ballas Spawn place
  44. new Float:bRandomSpawns[][] = //Ballas
  45. {
  46. {2006.1444,-1116.1742,27.1250},
  47. {2006.1444,-1116.1742,27.1250},
  48. {2029.3414,-1122.3053,26.4164},
  49. {2046.1130,-1116.0215,26.3617}
  50. };
  51. // This is For Groves Spawn place
  52. //----------------------------------------------------------------------------------
  53. new Float:cRandomSpawns[][] = //Cops
  54. {
  55. {1553.5991,-1675.6692,16.1953},
  56. {1553.5991,-1675.6692,16.1953},
  57. {1579.5630,-1635.8815,13.5603},
  58. {1579.5630,-1635.8815,13.5603}
  59. };
  60. new Float:vRandomSpawns[][] = //Vagos
  61. {
  62. {2579.1199,-1032.9240,72.8701},
  63. {2319.0576,-1168.7308,27.7298},
  64. {2359.5972,-1170.6938,28.0039},
  65. {1808.3914,-1906.7159,13.5736}
  66. };
  67. new Float:aRandomSpawns[][] = //Aztecas
  68. {
  69. {1767.7189,-1933.3131,13.5621},
  70. {1771.3771,-1915.1287,13.5549},
  71. {1790.5698,-1936.6094,13.5469},
  72. {1771.3771,-1915.1287,13.5549}
  73. };
  74. new Float:rRandomSpawns[][] = //Red a.k.a Pirus
  75. {
  76. {2415.8403,-1221.0621,25.2201},
  77. {2405.4163,-1239.6541,23.8125},
  78. {2393.6394,-1232.1379,25.4369},
  79. {2421.4116,-1221.0481,29.6202}
  80. };
  81. new Float:biRandomSpawns[][] = //Bikers
  82. {
  83. {2353.4324,-1366.6510,24.3984},
  84. {2354.2649,-1358.5103,24.3984},
  85. {2339.6804,-1374.7615,24.0000},
  86. {2348.3926,-1373.6440,24.3984}
  87. };
  88. new Float:sRandomSpawns[][] = //Skaters
  89. {
  90. {1930.4969,-1416.3407,13.7027},
  91. {1877.2080,-1366.5339,14.6406},
  92. {1866.9103,-1428.9968,13.8195},
  93. {1966.3451,-1424.0236,13.7558}
  94. };
  95.  
  96. //=============Colours=================
  97. #define COLOR_WHITE 0xFFFFFFFF
  98. #define COLOR_RED 0xF81414AA
  99. #define COLOR_GREEN "{00FF22}"
  100. #define COLOR_LIGHTBLUE "{00CED1}"
  101. #define COLOR_YELLOW 0xFFFF00AA
  102. #define COLOR_GGREEN 0x33AA33AA
  103. #define COLOR_PURPLE 0xC2A2DAAA
  104. #define COLOR_PINK 0xFF66FFAA
  105. #define COLOR_ORANGE 0xFF8C00AA
  106. #define COLOR_DRED 0xFF0000AA
  107. #define COLOR_BROWN 0x654321AA
  108.  
  109. //===============new===================
  110. new total_vehicles_from_files=0;
  111. new gTeam[MAX_PLAYERS];
  112.  
  113. // Stats / Saves
  114. enum pInfo
  115. {
  116. pPass,
  117. pCash,
  118. pAdmin,
  119. pKills,
  120. pDeaths,
  121. pScore,
  122. pMuted,
  123. pVip,
  124. }
  125.  
  126.  
  127. new PlayerInfo[MAX_PLAYERS][pInfo];
  128. new gPlayerLogged[MAX_PLAYERS];
  129.  
  130. stock SendStaffMessage(color, string[])
  131. {
  132. foreach(Player, i) {
  133. if(PlayerInfo[i][pAdmin] >= 1) {
  134. SendClientMessage(i, color, string);
  135. }
  136. }
  137. }
  138.  
  139. stock CheckPlayerAdmin(targetid)
  140. {
  141. new adminrank[11];
  142. if(PlayerInfo[targetid][pAdmin] == 0) { adminrank = "None"; }
  143. if(PlayerInfo[targetid][pAdmin] == 1) { adminrank = "Test Admin"; }
  144. if(PlayerInfo[targetid][pAdmin] == 2) { adminrank = "Moderator"; }
  145. if(PlayerInfo[targetid][pAdmin] == 3) { adminrank = "Admin"; }
  146. if(PlayerInfo[targetid][pAdmin] == 4) { adminrank = "Owner"; }
  147.  
  148. return adminrank;
  149. }
  150.  
  151. stock GetPlayerNameEx(playerid)
  152. {
  153. new Name[MAX_PLAYER_NAME];
  154. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  155. return Name;
  156. }
  157.  
  158. stock GetPlayerIPEx(playerid)
  159. {
  160. new IP[15];//Is it 16 :O
  161. GetPlayerIp(playerid, IP, 15);
  162. return IP;
  163. }
  164.  
  165. //============================WorldCars=========================================
  166. // LAS VENTURAS
  167. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
  168. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  169. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  170.  
  171. // SAN FIERRO
  172. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
  173. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  174. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  175. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_Spawn.txt");
  176.  
  177. // LOS SANTOS
  178. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  179. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  180. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  181. total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  182. printf("Total vehicles from files: %d",total_vehicles_from_files);
  183.  
  184. public OnFilterScriptInit()
  185. {
  186. print("\n--------------------------------------");
  187. print("FreeRoam [NL/RUS/ENG/DE] by Audi_Quattrix");
  188. print("--------------------------------------\n");
  189. return 1;
  190. }
  191.  
  192. public OnFilterScriptExit()
  193. {
  194. return 1;
  195. }
  196.  
  197. #else
  198.  
  199. main()
  200. {
  201. print("\n----------------------------------");
  202. print("FreeRoam [NL/RUS/ENG/DE]");
  203. print("----------------------------------\n");
  204. }
  205.  
  206. #endif
  207.  
  208. public OnGameModeInit()
  209. {
  210. SetGameModeText("FreeRoam [NL/RUS/ENG/DE]");
  211. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  212. return 1;
  213. }
  214.  
  215. public OnGameModeExit()
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerUpdate(playerid)
  221. {
  222. return 1;
  223. }
  224.  
  225. public OnPlayerRequestClass(playerid, classid)
  226. {
  227. if(classid == 0 || classid == 1 || classid == 2 || classid == 3) SetPlayerTeam(playerid,0);
  228. if(classid == 4 || classid == 5 || classid == 6) SetPlayerTeam(playerid,1);
  229. if(classid == 7 || classid == 8 || classid == 9) SetPlayerTeam(playerid,2);
  230. if(classid == 10 || classid == 11 || classid == 12 || classid == 13) SetPlayerTeam(playerid,3);
  231. if(classid == 14 || classid == 15 || classid == 16) SetPlayerTeam(playerid,4);
  232. if(classid == 17 || classid == 18 || classid == 19) SetPlayerTeam(playerid,5);
  233. if(classid == 20 || classid == 21) SetPlayerTeam(playerid,6);
  234. if(classid == 22 || classid == 23 || classid == 24 || classid == 25) SetPlayerTeam(playerid,7);
  235. if(classid == 22 || classid == 23 || classid == 24 || classid == 25) SetPlayerTeam(playerid,8);
  236. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  237. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  238. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  239. return 1;
  240. }
  241.  
  242. public OnPlayerConnect(playerid)
  243. {
  244. gPlayerLogged[playerid] = 0;
  245.  
  246. new pName[30], string[128];
  247. GetPlayerName(playerid, pName, 30);
  248. format(string, 256, "{FFFFFF}%s has {00FF22}joined {FFFFFF}the server", pName);
  249. SendClientMessageToAll(0x33AA33AA,string);
  250. new name[MAX_PLAYER_NAME], file[256];
  251. GetPlayerName(playerid, name, sizeof(name));
  252. format(file, sizeof(file), SERVER_USER_FILE, name);
  253. if (!dini_Exists(file))
  254. {
  255. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Your account is not Registered", "Password:", "Register", "Leave");
  256. }
  257. if(fexist(file))
  258. {
  259. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is registered", "Password:", "Login", "Leave");
  260. }
  261. return 1;
  262. }
  263.  
  264. public OnPlayerDisconnect(playerid, reason)
  265. {
  266.  
  267. new name[MAX_PLAYER_NAME], file[256];
  268. GetPlayerName(playerid, name, sizeof(name));
  269. format(file, sizeof(file), SERVER_USER_FILE, name);
  270.  
  271. if(gPlayerLogged[playerid] == 1)
  272. {
  273. dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
  274. dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
  275. dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin]);
  276. dini_IntSet(file, "Kills",PlayerInfo[playerid][pKills]);
  277. dini_IntSet(file, "Deaths",PlayerInfo[playerid][pDeaths]);
  278. dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted]);
  279. dini_IntSet(file, "Vip",PlayerInfo[playerid][pVip]);
  280. }
  281. gPlayerLogged[playerid] = 0;
  282.  
  283. new
  284. string[64];
  285. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  286. switch(reason) {
  287. case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
  288. case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
  289. case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
  290. }
  291. SendClientMessageToAll(0xFFFFFFAA,string);
  292. return 1;
  293. }
  294. public OnPlayerSpawn(playerid)
  295. {
  296. SetPlayerHealth(playerid,100);
  297. SetPlayerArmour(playerid,50);
  298. new string[128];
  299. if (PlayerInfo[playerid][pAdmin] <1 || !IsPlayerAdmin(playerid))
  300. if (GetPlayerPing(playerid) > 600)
  301. {
  302. format(string,sizeof(string),"[Server]: Player %s Have been kicked from server (High Ping, %d /600)",GetPlayerNameEx(playerid),GetPlayerPing(playerid));
  303. SendClientMessageToAll(COLOR_DRED, string);
  304. printf(string);
  305. Kick(playerid);
  306. }
  307. return 1;
  308. }
  309.  
  310. public OnPlayerDeath(playerid, killerid, reason)
  311. {
  312. PlayerInfo[killerid][pKills]++;
  313. PlayerInfo[playerid][pDeaths]++;
  314. GameTextForPlayer(playerid,"~w~YOU ~r~DIED",1000,1);
  315. SendDeathMessage(killerid,playerid,reason);
  316. return 1;
  317. }
  318.  
  319. public OnVehicleSpawn(vehicleid)
  320. {
  321. if(gTeam[playerid] == TEAM_GROVE)
  322. {
  323. new Float:X, Float:Y, Float:Z;
  324. GetPlayerPos(playerid, X, Y, Z);
  325. Team[playerid] = Create3DTextLabel("Grove Street Family",COLOR_GREEN,X, Y, Z+2.0,20.0,1); // Creating 3D Text Label
  326. Attach3DTextLabelToPlayer(Team[playerid],playerid,0,0,1.2);
  327. SetPlayerColor(playerid, COLOR_GREEN);
  328. GivePlayerWeapon(playerid, 5, 9999);
  329. GivePlayerWeapon(playerid, 22, 60);
  330. GivePlayerWeapon(playerid, 25, 25);
  331. GivePlayerWeapon(playerid, 28, 100);
  332. GivePlayerWeapon(playerid, 30, 100);
  333. new rand = random(sizeof(gRandomSpawns));
  334. SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
  335. }
  336. else if(gTeam[playerid] == TEAM_BALLAS)
  337. {
  338. new Float:X, Float:Y, Float:Z;
  339. GetPlayerPos(playerid, X, Y, Z);
  340. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_PURPLE, "Rollin Heights Ballas");
  341. SetPlayerColor(playerid, COLOR_PURPLE);
  342. GivePlayerWeapon(playerid, 5, 9999);
  343. GivePlayerWeapon(playerid, 22, 60);
  344. GivePlayerWeapon(playerid, 25, 25);
  345. GivePlayerWeapon(playerid, 28, 100);
  346. GivePlayerWeapon(playerid, 30, 100);
  347. new rand = random(sizeof(bRandomSpawns));
  348. SetPlayerPos(playerid, bRandomSpawns[rand][0], bRandomSpawns[rand][1], bRandomSpawns[rand][2]);
  349. }
  350. else if(gTeam[playerid] == TEAM_VAGOS)
  351. {
  352. new Float:X, Float:Y, Float:Z;
  353. GetPlayerPos(playerid, X, Y, Z);
  354. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_YELLOW, "Los Colinas Vagos");
  355. SetPlayerColor(playerid, COLOR_YELLOW);
  356. GivePlayerWeapon(playerid, 5, 9999);
  357. GivePlayerWeapon(playerid, 22, 60);
  358. GivePlayerWeapon(playerid, 25, 25);
  359. GivePlayerWeapon(playerid, 28, 100);
  360. GivePlayerWeapon(playerid, 30, 100);
  361. new rand = random(sizeof(vRandomSpawns));
  362. SetPlayerPos(playerid, vRandomSpawns[rand][0], vRandomSpawns[rand][1], vRandomSpawns[rand][2]);
  363. }
  364. else if(gTeam[playerid] == TEAM_AZTECAS)
  365. {
  366. new Float:X, Float:Y, Float:Z;
  367. GetPlayerPos(playerid, X, Y, Z);
  368. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_LIGHTBLUE, "Varrios Los Aztecas");
  369. SetPlayerColor(playerid, COLOR_LIGHTBLUE);
  370. GivePlayerWeapon(playerid, 5, 9999);
  371. GivePlayerWeapon(playerid, 22, 60);
  372. GivePlayerWeapon(playerid, 25, 25);
  373. GivePlayerWeapon(playerid, 28, 100);
  374. GivePlayerWeapon(playerid, 30, 100);
  375. new rand = random(sizeof(aRandomSpawns));
  376. SetPlayerPos(playerid, aRandomSpawns[rand][0], aRandomSpawns[rand][1], aRandomSpawns[rand][2]);
  377. }
  378. else if(gTeam[playerid] == TEAM_COPS)
  379. {
  380. new Float:X, Float:Y, Float:Z;
  381. GetPlayerPos(playerid, X, Y, Z);
  382. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_BLUE, "Los Santos Police Department");
  383. SetPlayerColor(playerid, COLOR_BLUE);
  384. GivePlayerWeapon(playerid, 5, 9999);
  385. GivePlayerWeapon(playerid, 22, 60);
  386. GivePlayerWeapon(playerid, 25, 25);
  387. GivePlayerWeapon(playerid, 28, 100);
  388. GivePlayerWeapon(playerid, 30, 100);
  389. new rand = random(sizeof(cRandomSpawns));
  390. SetPlayerPos(playerid, cRandomSpawns[rand][0], cRandomSpawns[rand][1], cRandomSpawns[rand][2]);
  391. }
  392. else if(gTeam[playerid] == TEAM_SKATERS)
  393. {
  394. new Float:X, Float:Y, Float:Z;
  395. GetPlayerPos(playerid, X, Y, Z);
  396. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_WHITE, "Glen Park Skaters");
  397. SetPlayerColor(playerid, COLOR_WHITE);
  398. GivePlayerWeapon(playerid, 5, 9999);
  399. GivePlayerWeapon(playerid, 22, 60);
  400. GivePlayerWeapon(playerid, 25, 25);
  401. GivePlayerWeapon(playerid, 28, 100);
  402. GivePlayerWeapon(playerid, 30, 100);
  403. new rand = random(sizeof(sRandomSpawns));
  404. SetPlayerPos(playerid, sRandomSpawns[rand][0], sRandomSpawns[rand][1], sRandomSpawns[rand][2]);
  405. }
  406. else if(gTeam[playerid] == TEAM_BIKERS)
  407. {
  408. new Float:X, Float:Y, Float:Z;
  409. GetPlayerPos(playerid, X, Y, Z);
  410. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_BROWN, "East Los Santos Bikers");
  411. SetPlayerColor(playerid, COLOR_BROWN);
  412. GivePlayerWeapon(playerid, 5, 9999);
  413. GivePlayerWeapon(playerid, 22, 60);
  414. GivePlayerWeapon(playerid, 25, 25);
  415. GivePlayerWeapon(playerid, 28, 100);
  416. GivePlayerWeapon(playerid, 30, 100);
  417. new rand = random(sizeof(biRandomSpawns));
  418. SetPlayerPos(playerid, biRandomSpawns[rand][0], biRandomSpawns[rand][1], biRandomSpawns[rand][2]);
  419. }
  420. else if(gTeam[playerid] == TEAM_RED)
  421. {
  422. new Float:X, Float:Y, Float:Z;
  423. GetPlayerPos(playerid, X, Y, Z);
  424. UpdatePlayer3DTextLabelText(playerid, PlayerText3D:Team[playerid], COLOR_RED, "Jefferson Pirus");
  425. SetPlayerColor(playerid, COLOR_RED);
  426. GivePlayerWeapon(playerid, 5, 9999);
  427. GivePlayerWeapon(playerid, 22, 60);
  428. GivePlayerWeapon(playerid, 25, 25);
  429. GivePlayerWeapon(playerid, 28, 100);
  430. GivePlayerWeapon(playerid, 30, 100);
  431. new rand = random(sizeof(rRandomSpawns));
  432. SetPlayerPos(playerid, rRandomSpawns[rand][0], rRandomSpawns[rand][1], rRandomSpawns[rand][2]);
  433. }
  434. return 1;
  435. }
  436.  
  437. public OnVehicleDeath(vehicleid, killerid)
  438. {
  439. return 1;
  440. }
  441.  
  442. public OnPlayerText(playerid, text[])
  443. {
  444. SetPlayerChatBubble(playerid, text, 0xFF0000FF, 100.0, 10000);
  445. if(text[0] == '!')
  446. {
  447. new str[128];
  448. new playername[MAX_PLAYER_NAME];
  449. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  450. format(str, sizeof(str), "[GANG CHAT] %s: %s", playername, text[1]);
  451. for(new i = 0; i < MAX_PLAYERS; i++)
  452. if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid])
  453. SendClientMessage(i, COLOR_ORANGE, str);
  454. return 0;
  455. }
  456. }
  457.  
  458. public OnPlayerCommandText(playerid, cmdtext[])
  459. {
  460. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  461. {
  462. // Do something here
  463. return 1;
  464. }
  465. return 0;
  466. }
  467.  
  468. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  469. {
  470. return 1;
  471. }
  472.  
  473. public OnPlayerExitVehicle(playerid, vehicleid)
  474. {
  475. return 1;
  476. }
  477.  
  478. public OnPlayerStateChange(playerid, newstate, oldstate)
  479. {
  480. return 1;
  481. }
  482.  
  483. public OnPlayerEnterCheckpoint(playerid)
  484. {
  485. return 1;
  486. }
  487.  
  488. public OnPlayerLeaveCheckpoint(playerid)
  489. {
  490. return 1;
  491. }
  492.  
  493. public OnPlayerEnterRaceCheckpoint(playerid)
  494. {
  495. return 1;
  496. }
  497.  
  498. public OnPlayerLeaveRaceCheckpoint(playerid)
  499. {
  500. return 1;
  501. }
  502.  
  503. public OnRconCommand(cmd[])
  504. {
  505. return 1;
  506. }
  507.  
  508. public OnPlayerRequestSpawn(playerid)
  509. {
  510. return 1;
  511. }
  512.  
  513. public OnObjectMoved(objectid)
  514. {
  515. return 1;
  516. }
  517.  
  518. public OnPlayerObjectMoved(playerid, objectid)
  519. {
  520. return 1;
  521. }
  522.  
  523. public OnPlayerPickUpPickup(playerid, pickupid)
  524. {
  525. return 1;
  526. }
  527.  
  528. public OnVehicleMod(playerid, vehicleid, componentid)
  529. {
  530. return 1;
  531. }
  532.  
  533. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  534. {
  535. return 1;
  536. }
  537.  
  538. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  539. {
  540. return 1;
  541. }
  542.  
  543. public OnPlayerSelectedMenuRow(playerid, row)
  544. {
  545. return 1;
  546. }
  547.  
  548. public OnPlayerExitedMenu(playerid)
  549. {
  550. return 1;
  551. }
  552.  
  553. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  554. {
  555. return 1;
  556. }
  557.  
  558. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  559. {
  560. return 1;
  561. }
  562.  
  563. public OnRconLoginAttempt(ip[], password[], success)
  564. {
  565. return 1;
  566. }
  567.  
  568. public OnPlayerUpdate(playerid)
  569. {
  570. return 1;
  571. }
  572.  
  573. public OnPlayerStreamIn(playerid, forplayerid)
  574. {
  575. return 1;
  576. }
  577.  
  578. public OnPlayerStreamOut(playerid, forplayerid)
  579. {
  580. return 1;
  581. }
  582.  
  583. public OnVehicleStreamIn(vehicleid, forplayerid)
  584. {
  585. return 1;
  586. }
  587.  
  588. public OnVehicleStreamOut(vehicleid, forplayerid)
  589. {
  590. return 1;
  591. }
  592.  
  593. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  594. {
  595. return 1;
  596. }
  597.  
  598. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  599. {
  600. new string[128], Float:Ratio = (float(PlayerInfo[clickedplayerid][pKills])/float(PlayerInfo[clickedplayerid][pDeaths]));
  601. format(string, sizeof(string), "------------------------------------[%s]-------------------------------", GetPlayerNameEx(playerid));
  602. SendClientMessage(playerid, COLOR_GGREEN, string);
  603. format(string, sizeof(string), "|| [Admin]: %s ||", CheckPlayerAdmin(clickedplayerid));
  604. SendClientMessage(playerid, COLOR_GGREEN, string);
  605. format(string, sizeof(string), "|| [Money]: %d ||", GetPlayerMoney(clickedplayerid));
  606. SendClientMessage(playerid, COLOR_GGREEN, string);
  607. format(string, sizeof(string), "|| [Score]: %d ||", GetPlayerScore(clickedplayerid));
  608. SendClientMessage(playerid, COLOR_GGREEN, string);
  609. format(string, sizeof(string), "|| [Kills]: %d ||", PlayerInfo[clickedplayerid][pKills]);
  610. SendClientMessage(playerid, COLOR_GGREEN, string);
  611. format(string, sizeof(string), "|| [Deaths]: %d ||", PlayerInfo[clickedplayerid][pDeaths]);
  612. SendClientMessage(playerid, COLOR_GGREEN, string);
  613. format(string, sizeof(string), "|| [Ratio]: %.2f ||", Ratio);
  614. SendClientMessage(playerid, COLOR_GGREEN, string);
  615. GetPlayerVersion(clickedplayerid,string,sizeof(string));
  616. format(string,sizeof(string),"|| [SA-MP version]: %s ||",string);
  617. SendClientMessage(playerid, COLOR_GGREEN,string);
  618. return 1;
  619. }
  620.  
  621. CMD:stats(playerid)
  622. {
  623. new string[128], Float:Ratio = (float(PlayerInfo[playerid][pKills])/float(PlayerInfo[playerid][pDeaths]));
  624. format(string, sizeof(string), "------------------------------------[%s]-------------------------------", GetPlayerNameEx(playerid));
  625. SendClientMessage(playerid, COLOR_GGREEN, string);
  626. format(string, sizeof(string), "|| [Admin]: %s ||", CheckPlayerAdmin(playerid));
  627. SendClientMessage(playerid, COLOR_GGREEN, string);
  628. format(string, sizeof(string), "|| [Money]: %d ||", GetPlayerMoney(playerid));
  629. SendClientMessage(playerid, COLOR_GGREEN, string);
  630. format(string, sizeof(string), "|| [Score]: %d ||", GetPlayerScore(playerid));
  631. SendClientMessage(playerid, COLOR_GGREEN, string);
  632. format(string, sizeof(string), "|| [Kills]: %d ||", PlayerInfo[playerid][pKills]);
  633. SendClientMessage(playerid, COLOR_GGREEN, string);
  634. format(string, sizeof(string), "|| [Deaths]: %d ||", PlayerInfo[playerid][pDeaths]);
  635. SendClientMessage(playerid, COLOR_GGREEN, string);
  636. format(string, sizeof(string), "|| [Ratio]: %.2f ||", Ratio);
  637. SendClientMessage(playerid, COLOR_GGREEN, string);
  638. GetPlayerVersion(playerid,string,sizeof(string));
  639. format(string,sizeof(string),"|| [SA-MP version]: %s ||",string);
  640. SendClientMessage(playerid, COLOR_GGREEN,string);
  641. return 1;
  642. }
  643.  
  644. CMD:gmx(playerid)
  645. {
  646. if (PlayerInfo[playerid][pAdmin] >=4 ||IsPlayerAdmin(playerid))
  647. SendRconCommand("gmx");
  648. else
  649. SendClientMessage(playerid,COLOR_DRED,"You are not an Admin");
  650. return 1;
  651. }
  652.  
  653. CMD:aduty(playerid)
  654. {
  655. if(PlayerInfo[playerid][pAdmin] >=1 || IsPlayerAdmin(playerid))
  656. SetPlayerHealth(playerid,100);
  657. SetPlayerColor(playerid,COLOR_DRED);
  658. format(string,sizeof(string), "%s is now on Duty!",GetPlayerNameEx(playerid));
  659. SendClientMessageToAll(COLOR_DRED,string);
  660. SendClientMessage(playerid,COLOR_DRED,"You are now on duty!");
  661. }
  662.  
  663. CMD:get(playerid, params[])
  664. {
  665. if (PlayerInfo[playerid][pAdmin] >=3 || IsPlayerAdmin(playerid))
  666. {
  667. new Float:x,Float:y, Float:z;
  668. new giveplayerid;
  669. if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_DRED, "SYNTAX: /Get <Playerid>");
  670. if(IsPlayerInAnyVehicle(playerid)) GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  671. else
  672. {
  673. GetPlayerPos(playerid,x,y,z);
  674. GetPlayerInterior(playerid);
  675. }
  676. if (IsPlayerConnected(giveplayerid))
  677. {
  678. if (IsPlayerInAnyVehicle(giveplayerid) && GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
  679. {
  680. SetVehiclePos(GetPlayerVehicleID(giveplayerid),x+2,y,z);
  681. SetPlayerPos(giveplayerid,x+2,y,z);
  682. PutPlayerInVehicle(giveplayerid,GetPlayerVehicleID(giveplayerid),0);
  683. }
  684. else
  685. SetPlayerPos(giveplayerid,x+2,y,z);
  686. }
  687. else
  688. SendClientMessage(playerid,COLOR_DRED,"Player is not Connected!");
  689. }
  690. else
  691. SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
  692. return 1;
  693. }
  694.  
  695. CMD:goto(playerid,params[])
  696. {
  697. if (PlayerInfo[playerid][pAdmin] >=3 || IsPlayerAdmin(playerid))
  698. {
  699. new Float:x,Float:y, Float:z;
  700. new giveplayerid;
  701. if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_DRED, "SYNTAX: /Get <Playerid>");
  702. if(IsPlayerInAnyVehicle(giveplayerid)) GetVehiclePos(GetPlayerVehicleID(giveplayerid), x, y, z);
  703. else
  704. {
  705. GetPlayerPos(giveplayerid,x,y,z);
  706. GetPlayerInterior(giveplayerid);
  707. }
  708. if (IsPlayerConnected(giveplayerid))
  709. {
  710. if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  711. {
  712. SetVehiclePos(GetPlayerVehicleID(playerid),x+2,y,z);
  713. SetPlayerPos(playerid,x+2,y,z);
  714. PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
  715. }
  716. else
  717. SetPlayerPos(playerid,x+2,y,z);
  718. }
  719. else
  720. SendClientMessage(playerid,COLOR_DRED,"Player is not Connected!");
  721. }
  722. else
  723. SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
  724. return 1;
  725. }
  726.  
  727.  
  728.  
  729. CMD:pm(playerid, params[])
  730. {
  731. new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  732. if(sscanf(params, "us", id, str2))
  733. {
  734. SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
  735. return 1;
  736. }
  737. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  738. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
  739. {
  740. GetPlayerName(playerid, Name1, sizeof(Name1));
  741. GetPlayerName(id, Name2, sizeof(Name2));
  742. format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
  743. SendClientMessage(playerid, 0xFF0000FF, str);
  744. format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
  745. SendClientMessage(id, 0xFF0000FF, str);
  746. }
  747. return 1;
  748. }
  749.  
  750. CMD:kill(playerid, params[])
  751. {
  752. SetPlayerHealth(playerid,0.0);
  753. PlayerInfo[playerid][pDeaths]++;
  754. return 1;
  755. }
  756.  
  757. CMD:a(playerid, params[])
  758. {
  759.  
  760. if(PlayerInfo[playerid][pAdmin] >= 1) {
  761. new admin[128];
  762. new Name[MAX_PLAYER_NAME];
  763. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  764. if(PlayerInfo[playerid][pAdmin] == 1) format(admin, sizeof(admin), "[Admin Chat] (Level 1 Admin) %s: %s", Name, params);
  765. else if(PlayerInfo[playerid][pAdmin] == 2) format(admin, sizeof(admin), "[Admin Chat] (Level 2 Admin) %s: %s", Name, params);
  766. else if(PlayerInfo[playerid][pAdmin] == 3) format(admin, sizeof(admin), "[Admin Chat] (Level 3 Admin) %s: %s", Name, params);
  767. else if(PlayerInfo[playerid][pAdmin] == 4) format(admin, sizeof(admin), "[Admin Chat] (Level 4 Admin) %s: %s", Name, params);
  768. else if(PlayerInfo[playerid][pAdmin] == 5) format(admin, sizeof(admin), "[Admin Chat] (Level 5 Admin) %s: %s", Name, params);
  769. SendStaffMessage(COLOR_GGREEN, admin);
  770. }
  771. return 1;
  772. }
  773.  
  774.  
  775. CMD:kick(playerid, params[])
  776. {
  777. if(PlayerInfo[playerid][pAdmin] >= 1) {
  778. new targetid, reason;
  779. new VBName[MAX_PLAYER_NAME];
  780. new VBName1[MAX_PLAYER_NAME];
  781. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  782. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  783. if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_PURPLE,"Usage: /kick [playerid] [reason]");
  784. if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Yourself!");
  785. if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
  786. else {
  787. new str[128];
  788. format(str, sizeof(str), "Administrator %s Has Kicked %s Reason: %d!", VBName, VBName1, reason);
  789. SendClientMessageToAll(COLOR_DRED,str);
  790. Kick(targetid);
  791. }
  792. }
  793. else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
  794. return 1;
  795. }
  796.  
  797.  
  798. CMD:setlevel(playerid, params[])
  799. {
  800. if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid)) {
  801. new VBName[MAX_PLAYER_NAME];
  802. new VBName1[MAX_PLAYER_NAME];
  803. new targetid;
  804. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  805. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  806. new
  807. iAdminValue,
  808. iTargetID;
  809.  
  810. if(sscanf(params, "di", iTargetID, iAdminValue)) {
  811. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /setlevel [playerid] [level]");
  812. }
  813. else if(IsPlayerConnected(iTargetID)) {
  814. new
  815. szMessage[47 + (MAX_PLAYER_NAME * 2)];
  816.  
  817. if(iAdminValue < 0 || iAdminValue > 4) return SendClientMessage(playerid, COLOR_PURPLE, "Valid range is 0 - 8.");
  818. PlayerInfo[iTargetID][pAdmin] = iAdminValue;
  819. format(szMessage, sizeof(szMessage), "Administrator %s has promoted %s to a level %d admin.", VBName, VBName1, iAdminValue);
  820. SendStaffMessage(COLOR_PURPLE,szMessage);
  821. format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, VBName);
  822. SendClientMessage(iTargetID, COLOR_PURPLE, szMessage);
  823. format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", VBName1,iAdminValue);
  824. SendClientMessage(playerid, COLOR_PURPLE, szMessage);
  825. }
  826. else SendClientMessage(playerid, COLOR_PURPLE, "Invalid player specified.");
  827. }
  828. return 1;
  829. }
  830.  
  831. CMD:ip(playerid, params[])
  832. {
  833. new giveplayerid;
  834. new string[128];
  835. if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
  836. {
  837. format(string,sizeof(string),"%s IP: %s",GetPlayerNameEx(giveplayerid),GetPlayerIPEx(giveplayerid));
  838. SendStaffMessage(COLOR_GGREEN, string);
  839. }
  840. else
  841. SendClientMessage(playerid,COLOR_DRED,"You are not high level enough!");
  842. return 1;
  843. }
  844.  
  845. CMD:ban(playerid, params[])
  846. {
  847. if(PlayerInfo[playerid][pAdmin] >= 4) {
  848. new targetid, reason;
  849. new VBName[MAX_PLAYER_NAME];
  850. new VBName1[MAX_PLAYER_NAME];
  851. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  852. GetPlayerName(targetid, VBName1, MAX_PLAYER_NAME);
  853. if(sscanf(params, "ri", targetid, reason)) return SendClientMessage(playerid, COLOR_DRED,"Usage: /Ban [playerid] [reason]");
  854. if(targetid == playerid) return SendClientMessage(playerid, COLOR_DRED, "You Can't Ban Yourself!");
  855. if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_DRED, "You Can't Kick Higher Administrators!");
  856. else {
  857. new str[128];
  858. format(str, sizeof(str), "Administrator %s Has Banned %s Reason: %d!", VBName, VBName1, reason);
  859. SendClientMessageToAll(COLOR_DRED,str);
  860. Ban(targetid);
  861. }
  862. }
  863. else return SendClientMessage(playerid, COLOR_DRED, "You Need To Be A Administrator!");
  864. return 1;
  865. }
  866.  
  867.  
  868. CMD:banip(playerid, params[])
  869. {
  870. if(PlayerInfo[playerid][pAdmin] >= 3) {
  871. new
  872. type[ 128 ],
  873. string[ 128 ]
  874. ;
  875. if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]");
  876. else {
  877. format(string, sizeof(string),"banip %s", type);
  878. SendRconCommand(string);
  879. SendRconCommand("reloadbans");
  880. }
  881. return true;
  882. }
  883. return 1;
  884. }
  885.  
  886.  
  887. CMD:unbanip(playerid, params[])
  888. {
  889. new type[128],string[128];
  890. new VBName[MAX_PLAYER_NAME];
  891. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  892. if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /Unbanip [Players IP]");
  893. else {
  894. if(PlayerInfo[playerid][pAdmin] >= 3) {
  895. format(string, sizeof(string),"unbanip %s", type);
  896. SendRconCommand(string);
  897. SendRconCommand("reloadbans");
  898. format(string, sizeof(string), "Administrator: %s has unbanned IP %s", VBName, type);
  899. SendStaffMessage(-1,string);
  900. }
  901. else {
  902. return SendClientMessage(playerid, -1 ,"You dont have access!");
  903. }
  904. }
  905. return true;
  906. }
  907.  
  908.  
  909. CMD:clearchat(playerid,params[])
  910. {
  911. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_DRED, "ERROR: You must be level 1 to use this command!" );
  912. {
  913. new string[128], VBName[MAX_PLAYER_NAME];
  914. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  915. for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll(COLOR_PURPLE, " " );
  916. format(string,sizeof(string),"The Server Chat Has Been Cleared By Administrator %s", VBName);
  917. SendClientMessageToAll(COLOR_DRED, string);
  918. return 1;
  919. }
  920. }
  921.  
  922.  
  923. CMD:givemoney(playerid, params[])
  924. {
  925. if (PlayerInfo[playerid][pAdmin] >= 3) {
  926. new string[128], giveplayerid, money;
  927. new VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME];
  928. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  929. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  930. if(sscanf(params, "dd", giveplayerid, money)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /givemoney [playerid] [money]");
  931.  
  932. if(IsPlayerConnected(giveplayerid)) {
  933. GivePlayerMoney(giveplayerid, money);
  934. format(string, sizeof(string), "[ADMIN] %s has given %s $%d.", VBName, VBName1, money);
  935. SendStaffMessage(COLOR_DRED, string);
  936. }
  937. }
  938. return 1;
  939. }
  940.  
  941.  
  942. CMD:pos(playerid, params[])
  943. {
  944. if(PlayerInfo[playerid][pAdmin] >= 2) {
  945. new Float: pos[3], int;
  946. if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /pos [x coordinate] [y coordinate] [z coordinate] [interior]");
  947.  
  948. SendClientMessage(playerid, COLOR_PURPLE, "You have teleported!");
  949. SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  950. SetPlayerInterior(playerid, int);
  951. }
  952. return 1;
  953. }
  954.  
  955.  
  956. CMD:jetpack(playerid, params[])
  957. {
  958. if(PlayerInfo[playerid][pAdmin] >= 2) {
  959. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  960. new string[128];
  961. new VBName[MAX_PLAYER_NAME];
  962. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  963. format(string, sizeof(string), "[ADMIN] %s gave themself a jetpack.", VBName);
  964. SendStaffMessage(COLOR_DRED, string);
  965. return 1;
  966. }
  967. return 1;
  968. }
  969.  
  970.  
  971. CMD:setarmour(playerid, params[])
  972. {
  973. new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
  974. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  975. GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
  976. if(sscanf(params, "dd", playa, health)) {
  977. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /armour [playerid] [armor]");
  978. return 1;
  979. }
  980. if (PlayerInfo[playerid][pAdmin] >= 3) {
  981. if(IsPlayerConnected(playa)) {
  982. if(playa != INVALID_PLAYER_ID) {
  983. SetPlayerArmour(playa, health);
  984. format(string, sizeof(string), "[ADMIN] %s set %s's armour to %d.", VBName, VBName1, health);
  985. SendStaffMessage(COLOR_DRED, string);
  986. }
  987. }
  988. }
  989. return 1;
  990. }
  991.  
  992.  
  993. CMD:sethealth(playerid, params[])
  994. {
  995. new string[128], playa, health, VBName [MAX_PLAYER_NAME], VBName1 [MAX_PLAYER_NAME];
  996. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  997. GetPlayerName(playa, VBName1, MAX_PLAYER_NAME);
  998. if(sscanf(params, "dd", playa, health)) {
  999. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /health [playerid] [Health]");
  1000. return 1;
  1001. }
  1002. if (PlayerInfo[playerid][pAdmin] >= 3) {
  1003. if(IsPlayerConnected(playa)) {
  1004. if(playa != INVALID_PLAYER_ID) {
  1005. SetPlayerHealth(playa, health);
  1006. format(string, sizeof(string), "[ADMIN] %s set %s's health to %d.", VBName, VBName1, health);
  1007. SendStaffMessage(COLOR_DRED, string);
  1008. }
  1009. }
  1010. }
  1011. return 1;
  1012. }
  1013.  
  1014.  
  1015. CMD:car(playerid, params[])
  1016. {
  1017. if (PlayerInfo[playerid][pAdmin] >= 2) {
  1018.  
  1019. new
  1020. iVehicle,
  1021. iColors[2];
  1022.  
  1023. if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
  1024. SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /veh [Car ID] [Colour 1] [Colour 2]");
  1025. }
  1026. else if(!(400 <= iVehicle <= 611)) {
  1027. SendClientMessage(playerid, COLOR_PURPLE, "No Such Vehicle Model (400 - 611)");
  1028. }
  1029. else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
  1030. SendClientMessage(playerid, COLOR_PURPLE, "No Such Colour (0 - 255)");
  1031. }
  1032.  
  1033. new
  1034. Float: fVehPos[4];
  1035.  
  1036. GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
  1037. GetPlayerFacingAngle(playerid, fVehPos[3]);
  1038. CreateVehicle(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
  1039. return SendClientMessage(playerid, COLOR_PURPLE, "Your Vehicle Has Spawned!");
  1040. }
  1041. return 1;
  1042. }
  1043.  
  1044.  
  1045. CMD:cnn(playerid, params[])
  1046. {
  1047. if(PlayerInfo[playerid][pAdmin] >= 1) {
  1048. if(!isnull(params)) {
  1049.  
  1050. new
  1051. szMessage[128];
  1052. new VBName [MAX_PLAYER_NAME];
  1053. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1054. format(szMessage, sizeof(szMessage), "~b~%s: ~w~%s",VBName, params);
  1055. foreach(Player, i) GameTextForPlayer(i, szMessage, 5000, 6);
  1056. }
  1057. else SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /cnn [message]. ~n~ = new line, ~r~ = red, ~g~ = green, ~b~ = blue, ~w~ = white, ~y~ = yellow.");
  1058. }
  1059. else SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
  1060. return 1;
  1061. }
  1062.  
  1063. CMD:admins(playerid)
  1064. {
  1065. new string[128];
  1066. SendClientMessage(playerid,COLOR_GGREEN,"---------ONLINE ADMINS---------");
  1067. for(new i = 0; i < MAX_PLAYERS; i++)
  1068. {
  1069. if(PlayerInfo[i][pAdmin] > 0)
  1070. {
  1071. format(string,sizeof(string), "%s - Level %d admin", GetPlayerNameEx(i), PlayerInfo[i][pAdmin]);
  1072. SendClientMessageToAll(COLOR_GGREEN, string);
  1073. }
  1074. }
  1075. return 1;
  1076. }
  1077.  
  1078.  
  1079.  
  1080. CMD:ask(playerid, params[])
  1081. {
  1082. if(isnull(params)) return SendClientMessage(playerid, COLOR_DRED, "USAGE: /ask [Question]");
  1083. new string[120];
  1084. new VBName[MAX_PLAYER_NAME];
  1085. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1086. format(string, sizeof(string), "%s Has Asked %s", VBName, params);
  1087. SendStaffMessage(COLOR_ORANGE, string);
  1088. return 1;
  1089. }
  1090.  
  1091.  
  1092.  
  1093. CMD:mute(playerid, params[])
  1094. {
  1095. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1096. new string[128], giveplayerid;
  1097. new VBName [MAX_PLAYER_NAME];
  1098. new VBName1 [MAX_PLAYER_NAME];
  1099. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1100. GetPlayerName(giveplayerid, VBName, MAX_PLAYER_NAME);
  1101. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /mute [playerid]");
  1102.  
  1103. if(IsPlayerConnected(giveplayerid)) {
  1104. if(giveplayerid == playerid) {
  1105. SendClientMessage(playerid, COLOR_PURPLE, "You can not use this command on yourself!");
  1106. return 1;
  1107. }
  1108.  
  1109. if(PlayerInfo[giveplayerid][pMuted] == 0) {
  1110. if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) {
  1111. format(string, sizeof(string), "%s just tried to /mute you.",VBName);
  1112. SendClientMessage(giveplayerid, COLOR_PURPLE, string);
  1113. SendClientMessage(playerid, COLOR_PURPLE, "You can't perform this action on an equal or higher level administrator.");
  1114. return 1;
  1115. }
  1116. PlayerInfo[giveplayerid][pMuted] = 1;
  1117. format(string, sizeof(string), "[ADMIN] %s was silenced by %s.",VBName1,VBName);
  1118. SendStaffMessage(COLOR_PURPLE,string);
  1119. }
  1120. else {
  1121. PlayerInfo[giveplayerid][pMuted] = 0;
  1122. format(string, sizeof(string), "[ADMIN] %s was unsilenced by %s.",VBName1,VBName);
  1123. SendStaffMessage(COLOR_PURPLE,string);
  1124. }
  1125. }
  1126. }
  1127. else {
  1128. SendClientMessage(playerid, COLOR_DRED, "You are not authorized to use that command!");
  1129. }
  1130. return 1;
  1131. }
  1132.  
  1133.  
  1134. CMD:slap(playerid, params[])
  1135. {
  1136. if (PlayerInfo[playerid][pAdmin] >= 2) {
  1137. new string[128], giveplayerid;
  1138. new VBName [MAX_PLAYER_NAME];
  1139. new VBName1 [MAX_PLAYER_NAME];
  1140. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1141. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  1142. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /slap [playerid]");
  1143.  
  1144. new Float:shealth;
  1145. new Float:slx, Float:sly, Float:slz;
  1146.  
  1147. if(IsPlayerConnected(giveplayerid)) {
  1148.  
  1149. GetPlayerHealth(giveplayerid, shealth);
  1150. SetPlayerHealth(giveplayerid, shealth-5);
  1151. GetPlayerPos(giveplayerid, slx, sly, slz);
  1152. SetPlayerPos(giveplayerid, slx, sly, slz+5);
  1153. PlayerPlaySound(giveplayerid, 1130, slx, sly, slz+5);
  1154. format(string, sizeof(string), "[ADMIN] %s was slapped by %s",VBName1, VBName);
  1155. SendStaffMessage(COLOR_PURPLE,string);
  1156.  
  1157. }
  1158. }
  1159. else {
  1160. SendClientMessage(playerid, COLOR_PURPLE, "You are not authorized to use that command!");
  1161. }
  1162. return 1;
  1163. }
  1164.  
  1165.  
  1166. CMD:ah(playerid, params[])
  1167. {
  1168. if(PlayerInfo[playerid][pAdmin] >= 1) {
  1169. SendClientMessage(playerid, COLOR_GGREEN,"LEVEL 1 Administrator: /a /kick /freeze /unfreeze /cnn /ip");
  1170. }
  1171. if(PlayerInfo[playerid][pAdmin] >= 2) {
  1172. SendClientMessage(playerid, COLOR_DRED,"LEVEL 2 Administrator: /clearchat /teleports /pos /slap /jetpack");
  1173. }
  1174. if(PlayerInfo[playerid][pAdmin] >= 3) {
  1175. SendClientMessage(playerid, COLOR_DRED,"LEVEL 3 Administrator: /banip /unbanip /givemoney /health /armour /get /goto ");
  1176. }
  1177. if(PlayerInfo[playerid][pAdmin] >= 4) {
  1178. SendClientMessage(playerid, COLOR_DRED,"LEVEL 4 Administrator: /setlevel");
  1179. }
  1180. return 1;
  1181. }
  1182.  
  1183.  
  1184. CMD:freeze(playerid, params[])
  1185. {
  1186. if(PlayerInfo[playerid][pAdmin] >= 1) {
  1187. new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
  1188. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1189. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  1190. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /freeze [playerid]");
  1191. TogglePlayerControllable(giveplayerid, 0);
  1192. format(string, sizeof(string),"Administrator %s Has Frozen %s", VBName, VBName1);
  1193. SendStaffMessage(COLOR_DRED, string);
  1194. return 1;
  1195. }
  1196. return 1;
  1197. }
  1198.  
  1199.  
  1200. CMD:unfreeze(playerid, params[])
  1201. {
  1202. if(PlayerInfo[playerid][pAdmin] >= 1) {
  1203. new string[128], VBName[MAX_PLAYER_NAME], VBName1[MAX_PLAYER_NAME], giveplayerid;
  1204. GetPlayerName(playerid, VBName, MAX_PLAYER_NAME);
  1205. GetPlayerName(giveplayerid, VBName1, MAX_PLAYER_NAME);
  1206. if(sscanf(params, "d", giveplayerid)) return SendClientMessage(playerid, COLOR_PURPLE, "USAGE: /unfreeze [playerid]");
  1207. TogglePlayerControllable(giveplayerid, 1);
  1208. format(string, sizeof(string),"Administrator %s Has Unfrozen %s", VBName, VBName1);
  1209. SendStaffMessage(COLOR_DRED, string);
  1210. return 1;
  1211. }
  1212. return 1;
  1213. }
  1214.  
  1215. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1216. {
  1217.  
  1218. if (dialogid == 1)
  1219. {
  1220. new name[MAX_PLAYER_NAME], file[256], string[128];
  1221. GetPlayerName(playerid, name, sizeof(name));
  1222. format(file, sizeof(file), SERVER_USER_FILE, name);
  1223. if(!response) return Kick(playerid);
  1224. if (!strlen(inputtext)) return
  1225. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Your account is not registered", "Password:", "Register", "Leave");
  1226. dini_Create(file);
  1227. dini_IntSet(file, "Password", udb_hash(inputtext));
  1228. dini_IntSet(file, "Admin",PlayerInfo[playerid][pAdmin] = 0);
  1229. dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
  1230. dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
  1231. dini_IntSet(file, "Kills",PlayerInfo[playerid][pKills] = 0);
  1232. dini_IntSet(file, "Deaths",PlayerInfo[playerid][pDeaths] = 0);
  1233. dini_IntSet(file, "Muted",PlayerInfo[playerid][pMuted] = 0);
  1234. format(string, 128, "[SYSTEM]: You succesfully registered the nickname %s with password %s, you have been auto logged in.", name, inputtext);
  1235. SendClientMessage(playerid, COLOR_YELLOW, string);
  1236. gPlayerLogged[playerid] = 1;
  1237. }
  1238.  
  1239.  
  1240. if (dialogid == 2)
  1241. {
  1242. new name[MAX_PLAYER_NAME], file[256];
  1243. GetPlayerName(playerid, name, sizeof(name));
  1244. format(file, sizeof(file), SERVER_USER_FILE, name);
  1245. if(!response) return Kick(playerid);
  1246. if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is Registered", "Password:", "Login", "Leave");
  1247. new tmp;
  1248. tmp = dini_Int(file, "Password");
  1249. if(udb_hash(inputtext) != tmp) {
  1250. SendClientMessage(playerid,COLOR_RED, "Wrong Password.");
  1251. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account is Registered", "Password", "Login", "Leave");
  1252. }
  1253. else
  1254. {
  1255. gPlayerLogged[playerid] = 1;
  1256. PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin");
  1257. PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
  1258. PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
  1259. PlayerInfo[playerid][pMuted] = dini_Int(file, "Muted");
  1260. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  1261. GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
  1262. SendClientMessage(playerid, COLOR_RED, "[SYSTEM]: Successfully logged in!");
  1263. }
  1264. }
  1265.  
  1266. }
  1267.  
  1268. SetPlayerTeamFromClass(playerid, classid)
  1269. {
  1270. ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0,0,0,0,0,0);
  1271. if (classid == 0 ||classid == 1 ||classid == 2 ||classid == 3)
  1272. {
  1273. gTeam[playerid] = TEAM_GROVE;
  1274. }
  1275. else if(classid == 4 ||classid == 5 ||classid == 6)
  1276. {
  1277. gTeam[playerid] = TEAM_AZTECAS;
  1278. }
  1279. else if(classid == 7 ||classid == 8 ||classid == 9)
  1280. {
  1281. gTeam[playerid] = TEAM_COPS;
  1282. }
  1283. else if(classid == 10 ||classid == 11 ||classid == 12 ||classid == 13)
  1284. {
  1285. gTeam[playerid] = TEAM_BALLAS;
  1286. }
  1287. else if(classid == 14 ||classid == 15 ||classid == 16)
  1288. {
  1289. gTeam[playerid] = TEAM_VAGOS;
  1290. }
  1291. else if(classid == 17 ||classid == 18 ||classid == 19)
  1292. {
  1293. gTeam[playerid] = TEAM_BIKERS;
  1294. }
  1295. else if(classid == 20 ||classid == 21)
  1296. {
  1297. gTeam[playerid] = TEAM_SKATERS;
  1298. }
  1299. else if(classid == 22 ||classid == 23 ||classid == 24 ||classid == 25)
  1300. {
  1301. gTeam[playerid] = TEAM_RED;
  1302. }
  1303. }
Advertisement
Add Comment
Please, Sign In to add comment