Advertisement
Guest User

Bruzer18

a guest
Apr 5th, 2009
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.16 KB | None | 0 0
  1. //------------------------------------------------------------------------------
  2.  
  3. // ...:::||| Sahara Desert Roleplay |||:::...
  4.  
  5. // Created by : Bruzer18
  6.  
  7. // Custom RP Script from Scratch.
  8. // Script's State : BETA - Not finished.
  9. //------------------------------------------------------------------------------
  10. /*
  11. NOTE TO USERS!
  12. Please read this, the /duty command and this script has a player to point function, so just search for it
  13. a nd take the code off that makes the comment line green, Enjoy!
  14. */
  15. //--------------
  16. #include <a_samp>
  17. #include <core>
  18. #include <float>
  19. #include <dudb>
  20. //--------------
  21. static gTeam[MAX_PLAYERS]; // Tracks the team assignment for each player
  22.  
  23.  
  24. // New Variables//
  25. new gPlayerClass[MAX_PLAYERS];
  26. new logged[MAX_PLAYERS];
  27. new adminlevel[MAX_PLAYERS];
  28. new money[MAX_PLAYERS];
  29. new gNews[MAX_PLAYERS];
  30. new playername[MAX_PLAYER_NAME];
  31. new realchat = 1;
  32. // Forward Variables.
  33. forward Float:GetDistanceBetweenPlayers(p1,p2);
  34. forward SetupPlayerForClassSelection(playerid);
  35. forward OOCNews(color,const string[]);
  36. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  37. forward OOCOff(color,const string[]);
  38. //Color Defines
  39. #define COLOR_GREY 0xAFAFAFAA
  40. #define COLOR_GREEN 0x33AA33AA
  41. #define COLOR_RED 0xAA3333AA
  42. #define COLOR_YELLOW 0xFFFF00AA
  43. #define COLOR_PINK 0xFF66FFAA
  44. #define COLOR_BLUE 0x0000BBAA
  45. #define COLOR_LIGHTBLUE 0x33CCFFAA
  46. #define COLOR_DARKRED 0x660000AA
  47. #define COLOR_ORANGE 0xFF9900AA
  48. #define COLOR_GROVE 0x00FF00FF
  49. #define COLOR_RED 0xAA3333AA
  50. #define COLOR_LIGHTRED 0xFF6347AA
  51. #define COLOR_LIGHTBLUE 0x33CCFFAA
  52. #define COLOR_LIGHTGREEN 0x9ACD32AA
  53. #define COLOR_YELLOW2 0xF5DEB3AA
  54. #define COLOR_WHITE 0xFFFFFFAA
  55. #define COLOR_FADE1 0xE6E6E6E6
  56. #define COLOR_FADE2 0xC8C8C8C8
  57. #define COLOR_FADE3 0xAAAAAAAA
  58. #define COLOR_FADE4 0x8C8C8C8C
  59. #define COLOR_FADE5 0x6E6E6E6E
  60. #define COLOR_PURPLE 0xC2A2DAAA
  61. #define COLOR_DBLUE 0x2641FEAA
  62. #define COLOR_NEWS 0x458E1DAA
  63. #define TEAM_GREEN_COLOR 0xFFFFFFAA
  64. #define TEAM_JOB_COLOR 0xFFB6C1AA
  65. #define TEAM_HIT_COLOR 0xFFFFFF00
  66. #define TEAM_BLUE_COLOR 0x8D8DFF00
  67. #define TEAM_RADIO_COLOR 0xF2D068FF
  68. #define COLOR_ADD 0x63FF60AA
  69. #define TEAM_GROVE_COLOR 0x00D900C8
  70. #define TEAM_VAGOS_COLOR 0xFFC801C8
  71. #define TEAM_BALLAS_COLOR 0xD900D3C8
  72. #define TEAM_AZTECAS_COLOR 0x01FCFFC8
  73. #define TEAM_CYAN_COLOR 0xFF8282AA
  74. #define TEAM_ORANGE_COLOR 0xFF830000
  75. #define TEAM_COR_COLOR 0x39393900
  76. #define TEAM_BAR_COLOR 0x00D90000
  77. #define TEAM_TAT_COLOR 0xBDCB9200
  78. #define TEAM_CUN_COLOR 0xD900D300
  79. #define COLOR_GRAD2 0xBFC0C2FF
  80. #define COLOR_FADE1 0xE6E6E6E6
  81. #define COLOR_FADE2 0xC8C8C8C8
  82. #define COLOR_FADE3 0xAAAAAAAA
  83. #define COLOR_FADE4 0x8C8C8C8C
  84. #define COLOR_FADE5 0x6E6E6E6E
  85. #define TEAM_STR_COLOR 0x01FCFF00
  86. //Locked Skins!
  87. #define Tim
  88. //Team Defines
  89. #define TEAM_PD 0
  90. #define TEAM_FBI 1
  91. #define TEAM_MEDIC 2
  92. #define TEAM_GunDealers 3
  93. #define TEAM_DrugDealers 4
  94. #define TEAM_Taxi 5
  95. #define TEAM_Mayor 6
  96. #define TEAM_Hitman 7
  97. #define TEAM_NEWS 8
  98. #define TEAM_DMV 9
  99. #define TEAM_MS 10
  100. // Teams etc.
  101. // Possible things to add : Lock cars for players.
  102. //------------------------------------------------------------------------------
  103.  
  104.  
  105.  
  106. main()
  107.  
  108. {
  109.  
  110. print("\n----------------------------------");
  111.  
  112. print(" SaharaDesertRoleplay-By Bruzer18\n");
  113.  
  114. print("----------------------------------\n");
  115.  
  116. }
  117.  
  118.  
  119.  
  120. //------------------------------------------------------------------------------
  121.  
  122.  
  123.  
  124. public OnGameModeInit()
  125.  
  126.  
  127. {
  128.  
  129. SetGameModeText("Sahara Desert Roleplay");
  130. SetTeamCount(10);
  131. ShowNameTags(1);
  132. ShowPlayerMarkers(0);
  133. SetWorldTime(18);
  134. // OnGameModeInit Code
  135. //=======================Skins==========================/
  136. AddPlayerClass(288,-1393.3452,2640.5430,55.9414,87.8658,0,0,0,0,0,0); // NewPoliceSpawn - Done
  137. AddPlayerClass(286,1527.3807,-1467.2283,9.5000,180.1942,0,0,0,0,0,0); // FBI sspawn - Done
  138. AddPlayerClass(276,-1515.0388,2521.4788,55.8559,359.5050,0,0,0,0,0,0); // New medic spawnzor. - DONE
  139. AddPlayerClass(66,-1465.4756,2610.4966,55.8359,183.7966,0,0,0,0,0,0); // Civilians - Done - El Quebadreos - 4
  140. AddPlayerClass(170,-252.3558,2599.2471,62.8582,269.6274,0,0,0,0,0,0); // Civilian 2- Done - LasPayasadas Spawnzor. - 5
  141. AddPlayerClass(61,-235.2902,2655.2957,62.6431,179.2515,0,0,0,0,0,0); // New New new Taxi Spawn. - Done
  142. AddPlayerClass(295,1476.4916,-1770.9729,18.7958,2.6588,0,0,0,0,0,0); // Mayor Spawn. - Not done
  143. AddPlayerClass(294,-431.3105,2238.4915,42.4297,180.5773,0,0,0,0,0,0); // Newhitman spawn - Done
  144. AddPlayerClass(227,1774.7866,-1310.0735,13.7023,91.5220,0,0,0,0,0,0); // News Spawn - Not done
  145. AddPlayerClass(283,-322.6225,2675.5945,63.6797,272.1808,0,0,0,0,0,0); // Otherpd- PD number 2. - Done
  146. AddPlayerClass(108,-1299.2592,2526.8677,88.4700,86.7574,0,0,0,0,0,0); // MS-13 NEW SPAWN GANGSTRA NISS ZOR - Done
  147. //========================= DMV ====================================//
  148. // Need to add!
  149. //----------------------------- LSPD --------------------------------------//
  150. AddStaticVehicleEx(523,-1411.1091,2659.0962,55.2545,90.4419,0,0, 30000); // Policecar1
  151. AddStaticVehicleEx(523,-1410.5569,2657.0508,55.2624,91.4589,0,0, 30000); // Policecar2
  152. AddStaticVehicleEx(523,-1409.9266,2654.6917,55.2602,86.9239,0,0, 30000); // Policecar3
  153. AddStaticVehicleEx(523,-1410.6949,2651.3867,55.2589,95.4991,0,0, 30000); // Policecar4
  154. AddStaticVehicleEx(598,-1399.2152,2659.7461,55.4351,91.2148,0,1, 30000); // Policecar5
  155. AddStaticVehicleEx(598,-1399.1454,2656.4504,55.4352,91.2148,0,1, 30000); // Policecar6
  156. AddStaticVehicleEx(598,-1399.4120,2653.3772,55.4330,91.2148,0,1, 30000); // Policecar7
  157. AddStaticVehicleEx(598,-1399.3422,2650.0913,55.4330,91.2148,0,1, 30000); // Policecar8
  158. AddStaticVehicleEx(598,-1399.2764,2646.9919,55.4330,91.2148,0,1, 30000); // Policecar9
  159. AddStaticVehicleEx(598,-1399.2085,2643.7832,55.4331,91.2148,0,1, 30000); // Policecar10
  160. AddStaticVehicleEx(599,-1400.1302,2637.6816,55.8801,90.3100,0,1, 30000); // Policecar11
  161. AddStaticVehicleEx(599,-1400.0814,2628.6323,55.8798,90.3100,0,1, 30000); // Policecar12
  162. //-------------------------- FBI ---------------------------------------------//
  163. AddStaticVehicleEx(490,-528.4824,2604.0898,53.5409,270.9850,0,0, 30000); // FbiCar13
  164. AddStaticVehicleEx(490,-528.6441,2609.3335,53.5419,268.8361,0,0, 30000); // FbiCar14
  165. AddStaticVehicleEx(490,-528.9174,2614.4636,53.5417,269.1524,0,0, 30000); // FbiCar15
  166. AddStaticVehicleEx(490,-528.6020,2619.5801,53.5423,268.9906,0,0, 30000); // FbiCar16
  167. AddStaticVehicleEx(490,-529.2902,2579.1995,53.5423,269.0871,0,0, 30000); // FbiCar17
  168. AddStaticVehicleEx(490,-528.7330,2574.0530,53.5435,269.2231,0,0, 30000); // FbiCar18
  169. AddStaticVehicleEx(490,-528.8759,2569.0752,53.5417,271.2657,0,0, 30000); // FbiCar19
  170. AddStaticVehicleEx(490,-529.4525,2563.9207,53.5428,269.9338,0,0, 30000); // FbiCar20
  171. AddStaticVehicleEx(601,-540.1744,2551.5132,53.1729,267.5495,1,1, 30000); // FbiCar21
  172. AddStaticVehicleEx(601,-540.5685,2558.5129,53.1735,267.6572,1,1, 30000); // FbiCar22
  173. AddStaticVehicleEx(528,-539.0366,2568.2280,53.4592,268.7965,0,0, 30000); // FbiCar23
  174. AddStaticVehicleEx(528,-539.8325,2578.3586,53.4570,267.0146,0,0, 30000); // FbiCar24
  175. //-------------------------- Ambulance --------------------------------------//
  176. AddStaticVehicleEx(416,-1497.3162,2526.6487,55.8366,359.3360,1,3, 30000); // Ambulance25.
  177. AddStaticVehicleEx(416,-1503.3296,2526.7188,55.7959,359.3360,1,3, 30000); // Ambulance26
  178. AddStaticVehicleEx(416,-1509.3666,2526.6494,55.7550,359.3360,1,3, 30000); // Ambulance27
  179. //-------------------------- Firemans Car -----------------------------------//
  180. AddStaticVehicleEx(407,-1528.0355,2525.2686,56.0084,359.3404,3,1, 30000); // Firecar28
  181. AddStaticVehicleEx(407,-1522.3387,2525.5190,55.9534,359.6186,3,1, 30000); // Firecar29
  182. //-------------------------- Hitmens car -----------------------------------//
  183. AddStaticVehicle(466,-399.1115,2252.5276,42.0695,286.0395,0,1); // Hitman car 1
  184. AddStaticVehicle(466,-372.4579,2234.0366,42.2259,104.1763,0,1); // Hitman car 2
  185. AddStaticVehicle(466,-391.0760,2221.4490,42.1714,284.1979,0,1); // Hitman car 3
  186. //------------------------- Random Cars --------------------------------------//
  187. AddStaticVehicle(492,-1287.0267,2513.8567,86.8602,0.3305,6,6); //
  188. AddStaticVehicle(445,-1317.6320,2528.5605,87.5045,178.7644,6,6); //
  189. AddStaticVehicle(467,-1333.2609,2527.4119,86.8274,178.2959,6,6); //
  190. AddStaticVehicle(466,-1312.5665,2553.6953,87.1588,119.2086,6,6); //
  191. AddStaticVehicle(528,-274.8153,2655.9656,62.6800,266.8616,0,0); //
  192. AddStaticVehicle(598,-301.4103,2685.7856,62.3990,0.8923,102,1); //
  193. AddStaticVehicle(599,-278.2669,2665.7261,62.7955,87.0967,119,119); //
  194. AddStaticVehicle(598,-285.2113,2666.5386,62.3726,90.6353,119,119); //
  195. AddStaticVehicle(598,-320.6234,2685.0706,62.4049,135.5070,102,102); //
  196. AddStaticVehicle(598,-319.1672,2680.7256,62.3759,127.0067,102,102); //
  197. AddStaticVehicle(598,-397.4390,2719.3088,61.9013,52.6765,102,102); //
  198. AddStaticVehicle(413,-324.0685,2658.9619,63.5290,89.6692,0,0); //
  199. AddStaticVehicle(420,-201.3834,2641.7266,62.9679,258.7786,4,4); //
  200. AddStaticVehicle(440,-209.4124,2642.4355,63.1904,270.3766,4,4); //
  201. AddStaticVehicle(420,-216.8323,2642.7295,62.7390,92.2922,4,4); //
  202. AddStaticVehicle(420,-223.8579,2642.6421,62.6548,101.9817,4,4); //
  203. AddStaticVehicle(440,-230.9708,2642.1746,62.8915,97.7684,4,4); //
  204. AddStaticVehicle(559,-726.3906,2744.9546,46.8775,183.6546,0,0); //
  205. AddStaticVehicle(459,-733.0714,2744.8555,47.2798,179.6990,0,0); //
  206. AddStaticVehicle(576,-723.2308,2738.3599,47.6038,201.3414,28,28); //
  207. AddStaticVehicle(535,-745.5001,2749.9595,47.0131,358.5888,50,70); //
  208. //------------------------------------------------------------------------//
  209. //Pickupz//
  210. AddStaticPickup(1277, 2, 1568.7919,-1691.1198,5.8906); // Icon for police.
  211. return 1;
  212.  
  213. }
  214.  
  215.  
  216.  
  217. //------------------------------------------------------------------------------
  218. public OnPlayerConnect(playerid)
  219. {
  220. SendClientMessage(playerid, COLOR_WHITE, "***************************************************");
  221. SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Sahara Desert Roleplay, Enjoy your stay!");
  222. SendClientMessage(playerid, COLOR_YELLOW, " ");
  223. SendClientMessage(playerid, COLOR_YELLOW, "This Script was made by Bruzer18!.");
  224. SendClientMessage(playerid, COLOR_YELLOW, "Please /login if you have an account, if not /register.");
  225. SendClientMessage(playerid, COLOR_YELLOW, "You will be kicked if you spawn without logging in!.");
  226. SendClientMessage(playerid, COLOR_WHITE, "****************************************************");
  227. logged[playerid] = 0;
  228. SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive
  229. return 1;
  230. }
  231. //------------------------------------------------------------------------------
  232. /*PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
  233. {
  234. new Float:oldpos[3], Float:temppos[3];
  235. GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
  236. temppos[0] = (oldpos[0] -X);
  237. temppos[1] = (oldpos[1] -Y);
  238. temppos[2] = (oldpos[2] -Z);
  239. if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  240. {
  241. return true;
  242. }
  243. return false;
  244. }
  245. */
  246. public Float:GetDistanceBetweenPlayers(p1,p2)
  247. {
  248. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  249. if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
  250. {
  251. return -1.00;
  252. }
  253. GetPlayerPos(p1,x1,y1,z1);
  254. GetPlayerPos(p2,x2,y2,z2);
  255. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  256. }
  257. //------------------------------------------------------------------------------
  258.  
  259.  
  260. public OnPlayerSpawn(playerid)
  261.  
  262. {
  263. // Custom Faction locked skins.
  264. // Tutorial : How to use the locked skins.
  265. // Add the skin ID you want to be locked ( EX : 286 ) Then Put the name of the user that may only use it.
  266. // Then just fill in the line. Enjoy - Bruzer18
  267. if((GetPlayerSkin(playerid) == 286))
  268. {
  269. new name[256];
  270. GetPlayerName(playerid, name, sizeof(name));
  271. if(strcmp(name,"Bruzer18",true) == 0)
  272. {
  273. }
  274. else
  275. {
  276. GameTextForPlayer(playerid,"~r~Your not the~n~Faction~n~Leader",4000,1);
  277. ForceClassSelection(playerid);
  278. SetPlayerHealth(playerid,0.0);
  279. }
  280. return 1;
  281. }
  282. if(logged[playerid] == 0)
  283. {
  284. SendClientMessage(playerid, COLOR_RED, "You failed to log in before spawning, You have been kicked");
  285. SendClientMessage(playerid,COLOR_BLUE, "Next time login before spawning - Thanks!");
  286. Kick(playerid);
  287. }
  288. SetPlayerInterior(playerid,0);
  289. if(gTeam[playerid] == TEAM_PD) {
  290. SendClientMessage(playerid,COLOR_BLUE, "Type /duty to go on duty ! </duty>!");
  291. SetPlayerColor(playerid,COLOR_GREEN); // Green
  292. }
  293. else if(gTeam[playerid] == TEAM_FBI) {
  294. SetPlayerColor(playerid,COLOR_RED); // Red
  295. }
  296. else if(gTeam[playerid] == TEAM_MEDIC) {
  297. SetPlayerColor(playerid,COLOR_YELLOW); // Yellow
  298. }
  299. else if(gTeam[playerid] == TEAM_GunDealers) {
  300. SendClientMessage(playerid, COLOR_BLUE, "Your now a Civilian of El Quebadros, Use </skin> to pick a new skin.");
  301. SetPlayerColor(playerid,COLOR_PINK); // Pink
  302. }
  303. else if(gTeam[playerid] == TEAM_DrugDealers) {
  304. SendClientMessage(playerid, COLOR_BLUE, "Your now a Civilian of Las Payasadas, Use </skin> to pick a new skin.");
  305. SetPlayerColor(playerid,COLOR_BLUE); // Blue
  306. }
  307. else if(gTeam[playerid] == TEAM_Taxi) {
  308. SetPlayerColor(playerid,COLOR_LIGHTBLUE); // Light Blue
  309. }
  310. else if(gTeam[playerid] == TEAM_Mayor) {
  311. SetPlayerColor(playerid,COLOR_DARKRED); // Dark Red
  312. }
  313. else if(gTeam[playerid] == TEAM_Hitman) {
  314. SetPlayerColor(playerid,COLOR_ORANGE); // Orange
  315. }
  316. else if(gTeam[playerid] == TEAM_NEWS) {
  317. SendClientMessage(playerid,COLOR_BLUE, "Feel free to type /news to announce the local news.");
  318. SetPlayerColor(playerid,COLOR_GREY); // Greyzor?
  319. }
  320. else if(gTeam[playerid] == TEAM_DMV) {
  321. SendClientMessage(playerid, COLOR_YELLOW, "Use /duty to get on duty at any time! ");
  322. SetPlayerColor(playerid,COLOR_GREY); // COLOR_DARKRED // TEAM_MS-13
  323. if(gTeam[playerid] == TEAM_MS) {
  324. SetPlayerColor(playerid,COLOR_GREEN); // Green
  325. }
  326.  
  327. }
  328. return 1;
  329.  
  330. }
  331.  
  332. //#define TEAM_ 9
  333. //TEAM_NEWS 8
  334. //-----------------------------------------------------------------------------
  335. public SetupPlayerForClassSelection(playerid)
  336.  
  337. {
  338. SetPlayerInterior(playerid,0);
  339. SetPlayerPos(playerid,-1657.5237,1207.6644,13.6719);
  340. SetPlayerFacingAngle(playerid,357.6906);
  341. SetPlayerCameraPos(playerid, -1657.4678,1211.2292,13.6781);
  342. SetPlayerCameraLookAt(playerid,-1657.5237,1207.6644,13.6719);
  343. }
  344.  
  345.  
  346.  
  347. //------------------------------------------------------------------------------
  348.  
  349.  
  350.  
  351. public OnPlayerRequestClass(playerid, classid)
  352.  
  353. {
  354. SetPlayerClass(playerid, classid);
  355. SetupPlayerForClassSelection(playerid);
  356. gPlayerClass[playerid] = classid;
  357. switch (classid) {
  358. case 0:
  359. {
  360. GameTextForPlayer(playerid, "~g~Police Department", 5000, 3);
  361. }
  362. case 1:
  363. {
  364. GameTextForPlayer(playerid, "~g~FBI", 5000, 3);
  365. }
  366. case 2:
  367. {
  368. GameTextForPlayer(playerid, "~g~Medics", 5000, 3);
  369. }
  370. case 3:
  371. {
  372. GameTextForPlayer(playerid, "~g~Civilians Of ElQuebadros", 5000, 3);
  373. }
  374. case 4:
  375. {
  376. GameTextForPlayer(playerid, "~g~Civilians Of LasPayasadas", 5000, 3);
  377. }
  378. case 5:
  379. {
  380. GameTextForPlayer(playerid, "~g~Taxi", 5000, 3);
  381. }
  382. case 6:
  383. {
  384. GameTextForPlayer(playerid, "~g~Mayor", 5000, 3);
  385. }
  386. case 7:
  387. {
  388. GameTextForPlayer(playerid, "~g~Hitman", 5000, 3);
  389. }
  390. case 8:
  391. {
  392. GameTextForPlayer(playerid, "~g~News", 5000, 3);
  393.  
  394. }
  395. case 9:
  396. {
  397. GameTextForPlayer(playerid, "~g~HighWay Patrol", 5000, 3);
  398. }
  399. case 10:
  400. {
  401. GameTextForPlayer(playerid, "~g~MS-13", 5000, 3);
  402. }
  403. }
  404.  
  405. return 1;
  406.  
  407. }
  408. //------------------------------------------------------------------------------
  409. public OnPlayerCommandText(playerid, cmdtext[])
  410. {
  411. new cmd[256],tmp[256], tmp2[256];
  412. new idx;
  413. new string[256];
  414. cmd = strtok(cmdtext, idx);
  415. new sendername;
  416. new giveplayerid;
  417. //=========================//
  418. if(strcmp(cmd, "/hitmaninvite", true) == 0)
  419. {
  420. if(IsPlayerConnected(playerid))
  421. {
  422. tmp = strtok(cmdtext, idx);
  423. if(!strlen(tmp))
  424. {
  425. SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /hitmaninvite [playerid/PartOfName]");
  426. return 1;
  427. }
  428. if(gTeam[playerid] == 7 || gTeam[playerid] == 7)
  429. {
  430. if(IsPlayerConnected(giveplayerid))
  431. {
  432. if(giveplayerid != INVALID_PLAYER_ID)
  433. {
  434. SetPlayerTeam(playerid, 7);
  435. }
  436. }
  437. }
  438. else
  439. {
  440. format(string, sizeof(string), " %d is not an active player.", giveplayerid);
  441. SendClientMessage(playerid, COLOR_GREY, string);
  442. }
  443. }
  444. return 1;
  445. }
  446. //=================================//
  447. if (strcmp("/duty", cmdtext, true, 10) == 0)
  448. {
  449. // if (PlayerToPoint(2, playerid,1568.7919,-1691.1198,5.8906))
  450. // {
  451. if(gTeam[playerid] == 0 || gTeam[playerid] == 9)
  452. {
  453. SetPlayerHealth(playerid, 100);
  454. SetPlayerArmour(playerid, 100);
  455. GivePlayerWeapon(playerid, 24, 500);
  456. GivePlayerWeapon(playerid, 3, 1);
  457. GivePlayerWeapon(playerid, 25, 20);
  458. }
  459. else
  460. {
  461. SendClientMessage(playerid, COLOR_RED, " Your not a Police Officer! ");
  462. return 1;
  463. }
  464. return 0;
  465. }
  466. // }
  467. //----------------------//
  468. if (strcmp("/skin", cmdtext, true, 10) == 0)
  469. {
  470. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  471. {
  472. SendClientMessage(playerid, COLOR_LIGHTBLUE,"_______Skin List _____");
  473. SendClientMessage(playerid, COLOR_GREY," 1.Normal 2.Irish Guy ");
  474. SendClientMessage(playerid, COLOR_GREY," 3.BusinessMan 4.BikerMan ");
  475. SendClientMessage(playerid, COLOR_GREY," 5.Girl1 6.Girl2 ");
  476. SendClientMessage(playerid, COLOR_LIGHTBLUE,"Type the name <EX: /normal> ");
  477. }
  478. else
  479. {
  480. SendClientMessage(playerid, COLOR_RED, " Your not a civilian or El Quebadros or Las Payasadas! ");
  481. return 1;
  482. }
  483. }
  484. //================================//
  485. if (strcmp("/normal", cmdtext, true, 10) == 0)
  486. {
  487. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  488. {
  489. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Normal Skin! ");
  490. SetPlayerSkin(playerid, 60);
  491. return 1;
  492. }
  493. }
  494. //-===================//
  495. if (strcmp("/irishguy", cmdtext, true, 10) == 0)
  496. {
  497. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  498. {
  499. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Irish Guy Skin! ");
  500. SetPlayerSkin(playerid, 101);
  501. return 1;
  502. }
  503. }
  504. if (strcmp("/businessman", cmdtext, true, 10) == 0)
  505. {
  506. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  507. {
  508. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Business Man Skin! ");
  509. SetPlayerSkin(playerid, 147);
  510. return 1;
  511. }
  512. }
  513. if (strcmp("/bikerman", cmdtext, true, 10) == 0)
  514. {
  515. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  516. {
  517. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Biker guy skin! ");
  518. SetPlayerSkin(playerid, 179);
  519. return 1;
  520. }
  521. }
  522. if (strcmp("/girl1", cmdtext, true, 10) == 0)
  523. {
  524. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  525. {
  526. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Girl 1 Skin! ");
  527. SetPlayerSkin(playerid, 192);
  528. return 1;
  529. }
  530. }
  531. if (strcmp("/girl2", cmdtext, true, 10) == 0)
  532. {
  533. if(gTeam[playerid] == 4 || gTeam[playerid] == 5)
  534. {
  535. SendClientMessage(playerid, COLOR_YELLOW, "You picked the Girl 2 Skin! ");
  536. SetPlayerSkin(playerid, 193);
  537. return 1;
  538. }
  539. }
  540. //============//
  541. if(strcmp(cmd, "/news", true) == 0)
  542. {
  543. if(gTeam[playerid] == 8)
  544. {
  545. new length = strlen(cmdtext);
  546. while ((idx < length) && (cmdtext[idx] <= ' '))
  547. {
  548. idx++;
  549. }
  550. new offset = idx;
  551. new result[64];
  552. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  553. {
  554. result[idx - offset] = cmdtext[idx];
  555. idx++;
  556. }
  557. result[idx - offset] = EOS;
  558. if(!strlen(result))
  559. {
  560. SendClientMessage(playerid, COLOR_GREY, "USAGE: /news [newstext]");
  561. return 1;
  562. }
  563. format(string, sizeof(string), "[ABC News] %s: %s",sendername, result);
  564. OOCNews(COLOR_NEWS,string);
  565. return 1;
  566. }
  567. }
  568. //========Kill===================//
  569. if(strcmp(cmd, "/kill", true) == 0)
  570. {
  571. SetPlayerHealth(playerid, 0);
  572. SendClientMessage(playerid,COLOR_RED, " You've killed yourself, Enjoy it!.");
  573. return 1;
  574. }
  575. //-==---------------------------------//
  576. if(strcmp(cmd, "/adminarmourup", true) == 0)
  577. {
  578. if(IsPlayerAdmin(playerid)) // This checks if the players an rcon admin.
  579. {
  580. SetPlayerArmour(playerid, 999);
  581. SetPlayerHealth(playerid, 999);
  582. GivePlayerWeapon(playerid, 24, 100);
  583. GivePlayerWeapon(playerid, 26, 10660);
  584. GivePlayerWeapon(playerid, 38, 10660);
  585. GivePlayerWeapon(playerid, 31, 10660);
  586. GivePlayerWeapon(playerid, 34, 10660);
  587. GivePlayerWeapon(playerid, 16, 10660);
  588. return 1;
  589. }
  590. }
  591. //==============================//
  592. if(strcmp(cmd, "/forums", true) == 0)
  593. {
  594. SendClientMessage(playerid,COLOR_YELLOW, "SaharaDesert Roleplay - V1.0 Made by Bruzer18.");
  595. SendClientMessage(playerid,COLOR_YELLOW, "Forums link : .......");
  596. return 1;
  597. }
  598. //----------------------------------[ooc]-----------------------------------------------
  599. // Broken - needs to be fixed..
  600. //===================================//
  601. if(strcmp(cmd, "/commands", true) == 0)
  602. {
  603. SendClientMessage(playerid,COLOR_ORANGE, "|__________COMMANDS__________|");
  604. SendClientMessage(playerid,COLOR_ORANGE, " Commands: /forums /kill /ooc /skin .");
  605. SendClientMessage(playerid,COLOR_ORANGE, " Police Help : /duty");
  606. if(adminlevel[playerid] != 3)
  607. {
  608. SendClientMessage(playerid,COLOR_ORANGE, " /aheal /kick");
  609. return 1;
  610. }
  611. return 1;
  612. }
  613. // register//
  614. GetPlayerName(playerid, playername, sizeof(playername));
  615. if(strcmp(cmd, "/register", true) == 0)
  616. {
  617. tmp = strtok(cmdtext, idx);
  618. if(!strlen(tmp))
  619. {
  620. SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /register (password)");
  621. }
  622. else
  623. {
  624. if (!dini_Exists(udb_encode(playername)))
  625. {
  626. dini_Create(udb_encode(playername));
  627. dini_IntSet(udb_encode(playername), "password", udb_hash(tmp));
  628. dini_IntSet(udb_encode(playername), "adminlevel", 0);
  629. dini_IntSet(udb_encode(playername), "money", 0);
  630. format(string, sizeof(string), "Account %s created! You can now login with /login %s", playername, tmp);
  631. SendClientMessage(playerid, COLOR_YELLOW, string);
  632. GivePlayerMoney(playerid, 4000);
  633. SendClientMessage(playerid, COLOR_YELLOW, "You received 4000 for registering, enjoy your stay! ");
  634. }
  635. else
  636. {
  637. format(string, sizeof(string), "%s is already registered.", playername,tmp);
  638. SendClientMessage(playerid, COLOR_RED, string);
  639. }
  640. }
  641. return 1;
  642. }
  643.  
  644.  
  645. if(strcmp(cmd, "/login", true) == 0)
  646. {
  647. if(logged[playerid] == 1)
  648. {
  649. SendClientMessage(playerid, COLOR_RED, "You are already logged in!");
  650. return 1;
  651. }
  652. tmp = strtok(cmdtext, idx);
  653. if(!strlen(tmp))
  654. {
  655. SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /login [password]");
  656. }
  657. else
  658. {
  659. if (dini_Exists(udb_encode(playername)))
  660. {
  661. tmp2 = dini_Get(udb_encode(playername), "password");
  662. if (udb_hash(tmp) != strval(tmp2))
  663. {
  664. SendClientMessage(playerid, COLOR_RED, "Wrong/Invalid Password!");
  665. }
  666. else
  667. {
  668. logged[playerid] = 1;
  669. money[playerid] = dini_Int(udb_encode(playername), "money");
  670. adminlevel[playerid] = dini_Int(udb_encode(playername), "adminlevel");
  671. format(string, sizeof(string), "%s, you are now logged in . You have admin level %d and have %d dollars.", playername, adminlevel[playerid], money[playerid]);
  672. SendClientMessage(playerid, COLOR_GREEN, string);
  673. GivePlayerMoney(playerid, money[playerid]);
  674. }
  675. }
  676. else
  677. {
  678. format(string, sizeof(string), "You are not registerid Type /register [password] to create an account!", playername);
  679. SendClientMessage(playerid, COLOR_RED, string);
  680. }
  681. }
  682. return 1;
  683. }
  684.  
  685. if(strcmp(cmd, "/makemeadmin", true) == 0)
  686. {
  687. if(IsPlayerAdmin(playerid))
  688. {
  689. if(logged[playerid] == 1)
  690. {
  691. if(adminlevel[playerid] != 3)
  692. {
  693. adminlevel[playerid] = 5;
  694. SendClientMessage(playerid, COLOR_GREEN, "You are now at the max admin level!!");
  695. }
  696. else
  697. {
  698. SendClientMessage(playerid, COLOR_RED, "You are already the top admin!");
  699. }
  700. }
  701. else
  702. {
  703. SendClientMessage(playerid, COLOR_RED, "Please, first login: /login [password]");
  704. }
  705. }
  706. else
  707. {
  708. SendClientMessage(playerid, COLOR_RED, "You must first login with rcon! (/rcon login [rcon-pass])");
  709. }
  710. return 1;
  711. }
  712. //=============//
  713.  
  714. //=------
  715. return 0;
  716. }
  717.  
  718. //============================================================================//
  719. public OnPlayerDisconnect(playerid, reason)
  720. {
  721. money[playerid] = GetPlayerMoney(playerid);
  722. dini_IntSet(udb_encode(playername), "money", money[playerid]);
  723. dini_IntSet(udb_encode(playername), "adminlevel", adminlevel[playerid]);
  724. logged[playerid] = 0;
  725. return 1;
  726. }
  727. //--------------------------------------------------------------------//
  728.  
  729. //==============================================================================
  730. public OOCNews(color,const string[])
  731. {
  732. for(new i = 0; i < MAX_PLAYERS; i++)
  733. {
  734. if(IsPlayerConnected(i))
  735. {
  736. if(!gNews[i])
  737. {
  738. SendClientMessage(i, color, string);
  739. }
  740. }
  741. }
  742. }
  743.  
  744. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  745. {
  746. new Float:posx, Float:posy, Float:posz;
  747. new Float:oldposx, Float:oldposy, Float:oldposz;
  748. new Float:tempposx, Float:tempposy, Float:tempposz;
  749. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  750. //radi = 2.0; //Trigger Radius
  751. for(new i = 0; i <= MAX_PLAYERS; i++)
  752. {
  753. if(IsPlayerConnected(i) == 1)
  754. {
  755. {
  756. GetPlayerPos(i, posx, posy, posz);
  757. tempposx = (oldposx -posx);
  758. tempposy = (oldposy -posy);
  759. tempposz = (oldposz -posz);
  760. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  761. {
  762. SendClientMessage(i, col1, string);
  763. }
  764. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  765. {
  766. SendClientMessage(i, col2, string);
  767. }
  768. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  769. {
  770. SendClientMessage(i, col3, string);
  771. }
  772. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  773. {
  774. SendClientMessage(i, col4, string);
  775. }
  776. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  777. {
  778. SendClientMessage(i, col5, string);
  779. }
  780. }
  781. }
  782. }
  783. return 1;
  784. }
  785. //--------------------------- ---------------------------------------------------
  786. public OnPlayerText(playerid, text[])
  787. {
  788. new sendername[MAX_PLAYER_NAME];
  789. new string[256];
  790. //=====================//
  791. if (realchat)
  792. {
  793. GetPlayerName(playerid, sendername, sizeof(sendername));
  794. format(string, sizeof(string), "%s Says: %s", sendername, text);
  795. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  796. return 0;
  797. }// Not connected.
  798. return 1;
  799. }
  800. //====================================//
  801.  
  802.  
  803. SetPlayerClass(playerid, classid) {
  804.  
  805. if(classid == 0) {
  806.  
  807. gTeam[playerid] = TEAM_PD;
  808.  
  809. } else if(classid == 1) {
  810.  
  811. gTeam[playerid] = TEAM_FBI;
  812.  
  813. } else if(classid == 2) {
  814.  
  815. gTeam[playerid] = TEAM_MEDIC;
  816.  
  817. } else if(classid == 3) {
  818.  
  819. gTeam[playerid] = TEAM_GunDealers;
  820.  
  821. } else if(classid == 4) {
  822.  
  823. gTeam[playerid] = TEAM_DrugDealers;
  824.  
  825. } else if(classid == 5) {
  826.  
  827. gTeam[playerid] = TEAM_Taxi;
  828.  
  829. } else if(classid == 6) {
  830.  
  831. gTeam[playerid] = TEAM_Mayor;
  832.  
  833. } else if(classid == 7) {
  834.  
  835. gTeam[playerid] = TEAM_Hitman;
  836. } else if(classid == 8) {
  837.  
  838. gTeam[playerid] = TEAM_NEWS;
  839. } else if(classid == 9) {
  840.  
  841. gTeam[playerid] = TEAM_MS;
  842. } else if(classid == 10) {
  843.  
  844. }
  845.  
  846. }
  847. //------------------------------------------------------------------------------
  848.  
  849. //=---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement