Guest User

help

a guest
Oct 9th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.72 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #include <YSI\y_ini.inc>
  7. #include <ZCMD>
  8. #include <sscanf2>
  9. #include <a_mysql>
  10. #include <easydb>
  11. #include <easydialog>
  12.  
  13. #define DIALOG_REGISTER 1
  14. #define DIALOG_LOGIN 2
  15. #define SERVER_NAME "Main Roleplay"
  16.  
  17. #define PASSWORD_SALT "334t!t>D<QW**@!)#$>C_)_AAgddh"
  18. #define MAX_LOGIN_ATTEMPTS (3)
  19. #define MIN_PASSWORD_LENGTH (5)
  20. #define MAX_PASSWORD_LENGTH (45)
  21.  
  22. #define ENABLE_CONSOLE_MESSAGES
  23.  
  24. #define COL_WHITE "{FFFFFF}"
  25. #define COL_LIGHTBLUE "{00CED1}"
  26. #define COLOR_PURPLE 0xC2A2DAAA
  27. #define COLOR_ORANGE "{FFA500}"
  28. #define COLOR_RED 0xFF0000AA
  29. #define COLOR_GREEN 0x33AA33AA
  30. #define COLOR_CYAN 0x00FFFFFF
  31. #define COLOR_PDRAD 0x297CCFFF
  32.  
  33. new Engine[MAX_VEHICLES];
  34. new Lights[MAX_VEHICLES];
  35.  
  36. enum pInfo
  37. {
  38. pSQLID,
  39. pPass,
  40. pCash,
  41. pAdmin,
  42. pTester,
  43. pFaction,
  44. pLeader,
  45. pDeveloper,
  46. pKills,
  47. pDeaths,
  48. DT,
  49. DTT,
  50. ADT
  51. }
  52. enum fInfo
  53. {
  54. fLeader,
  55. fRank,
  56. fCar,
  57. fRanks,
  58. fGov,
  59. fDuty
  60. }
  61. enum aInfo
  62. {
  63. aDuty,
  64. aLevel
  65. }
  66. enum cInfo
  67. {
  68. cLocked,
  69. cOwner,
  70. cSpawned,
  71. cAlarm,
  72. cColor,
  73. cEngine,
  74. cLights,
  75. Avariat
  76. }
  77.  
  78. new PlayerInfo[MAX_PLAYERS][pInfo];
  79. new FactionInfo[MAX_PLAYERS][fInfo];
  80. new CarInfo[MAX_PLAYERS][cInfo];
  81. new incercari[MAX_PLAYERS];
  82.  
  83. forward dttimer(playerid);
  84. forward recuperare(playerid);
  85. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  86. forward OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth);
  87.  
  88. new Text:spawntextdraw;
  89.  
  90. main()
  91. {
  92. print("\n----------------------------------");
  93. print(" MAIN ROLEPLAY NETWORK 0.1 [BETA] ");
  94. print("----------------------------------\n");
  95. }
  96. public OnGameModeInit()
  97. {
  98. SetGameModeText("Main-RP 0.1[BETA]");
  99. spawntextdraw = TextDrawCreate(10.0, 240.0, "[BETA] Trebuie sa apesi pe 'Spawn' sa te spawnezi!");
  100. TextDrawFont(spawntextdraw, 2);
  101. TextDrawColor(spawntextdraw, 0xFFFFFFFF);
  102. DisableInteriorEnterExits();
  103. EnableStuntBonusForAll(0);
  104. DB::Init("main-rp database");
  105. DB::VerifyTable("Utilizatori", "ID", false,
  106. "Nume", STRING,
  107. "Parola", STRING,
  108. "IP", STRING,
  109. "Kills", INTEGER,
  110. "Deaths", INTEGER,
  111. "Cash", INTEGER,
  112. "Developer", INTEGER,
  113. "Admin", INTEGER,
  114. "Tester", INTEGER,
  115. "Lider", STRING,
  116. "Rank", STRING,
  117. "Factiune", STRING,
  118. "Viata", FLOAT);
  119. new eqpdpickup[2];
  120. new eqmcpickup[2];
  121. new eqnpickup[2];
  122. new vestiare[3];
  123. eqpdpickup[0] = CreatePickup(1318, 0, -1390.0115,2638.8416,55.9844, 0);
  124. eqpdpickup[1] = CreatePickup(1318, 0, 1866.3854,1217.4387,18.0986, 0);
  125. eqmcpickup[0] = CreatePickup(1318, 0, -1514.5566,2520.1011,55.9629, 0);
  126. eqmcpickup[1] = CreatePickup(1318, 0, 642.9769,-172.3768,1001.2758, 0);
  127. eqnpickup[0] = CreatePickup(1318, 0, -1531.0065,2591.9971,55.8359, 0);
  128. eqnpickup[1] = CreatePickup(1318, 0, 248.6405,1783.9126,701.0859, 0);
  129. vestiare[0] = CreatePickup(1318, 0, 643.6490,-165.0781,1001.2758, 0);
  130. vestiare[1] = CreatePickup(1318, 0, 1884.0470,1232.3463,18.0986, 0);
  131. vestiare[2] = CreatePickup(1318, 0, 256.0069,1778.2255,701.0859, 0);
  132. Create3DTextLabel("{FFFFFF}El Quebrados Sheriff's Departament", -1, -1390.0115, 2638.8416, 55.9844, 50.00, 0, 0);
  133. Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 1866.3854,1217.4387,18.0986, 20.00, 0, 0);
  134. Create3DTextLabel("{FFFFFF}El Quebrados Medical Center", -1, -1514.5566,2520.1011,55.9629, 20.00, 0, 0);
  135. Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 642.9769,-172.3768,1001.2758, 20.00, 0, 0);
  136. Create3DTextLabel("{FFFFFF}El Quebrados News", -1, -1531.0065,2591.9971,55.8359, 20.00, 0, 0);
  137. Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 248.6405,1783.9126,701.0859, 20.00, 0, 0);
  138. Create3DTextLabel("{FFFFFF}Vestiar", -1, 256.0069,1778.2255,701.0859, 5.00, 0, 0);
  139. Create3DTextLabel("{FFFFFF}Vestiar", -1, 1884.0470,1232.3463,18.0986, 5.00, 0, 0);
  140. Create3DTextLabel("{FFFFFF}Vestiar", -1, 643.6490,-165.0781,1001.2758, 5.00, 0, 0);
  141. ManualVehicleEngineAndLights();
  142. return 1;
  143. }
  144.  
  145. public OnGameModeExit()
  146. {
  147. DB::Exit();
  148. return 1;
  149. }
  150.  
  151. public OnPlayerRequestClass(playerid, classid)
  152. {
  153. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
  154. return 1;
  155. }
  156.  
  157. public OnPlayerConnect(playerid)
  158. {
  159. incercari[playerid] = 0;
  160. new nume[MAX_PLAYER_NAME];
  161. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  162.  
  163. DB::Fetch("Utilizatori", _, _, _, "`Nume` = '%q'", nume);
  164. if (fetch_rows_count() > 0)
  165. {
  166. PlayerInfo[playerid][pSQLID] = fetch_row_id();
  167. fetch_string("Password", PlayerInfo[playerid][pPass], 64);
  168. PlayerInfo[playerid][pKills] = fetch_int("Kills");
  169. PlayerInfo[playerid][pDeaths] = fetch_int("Deaths");
  170. PlayerInfo[playerid][pCash] = fetch_int("Bani");
  171. PlayerInfo[playerid][pDeveloper] = fetch_int("Developer");
  172. PlayerInfo[playerid][pTester] = fetch_int("Tester");
  173. PlayerInfo[playerid][pAdmin] = fetch_int("Admin");
  174. PlayerInfo[playerid][pLeader] = fetch_int("Lider");
  175. FactionInfo[playerid][fRank] = fetch_int("Rank");
  176.  
  177. Dialog_Show(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FF6633}MAIN-ROLEPLAY", "{FFFFFF}Bine ai revenit pe server. Te rog introdu-ti parola mai jos pentru a te loga.", "JOIN", "IESI");
  178. }
  179. else
  180. {
  181. PlayerInfo[playerid][pSQLID] = -1;
  182. PlayerInfo[playerid][pPass] = EOS;
  183. PlayerInfo[playerid][pKills] = 0;
  184. PlayerInfo[playerid][pDeaths] = 0;
  185. PlayerInfo[playerid][pCash] = 0;
  186. PlayerInfo[playerid][pDeveloper] = 0;
  187. PlayerInfo[playerid][pTester] = 0;
  188. PlayerInfo[playerid][pAdmin] = 0;
  189. PlayerInfo[playerid][pLeader] = 0;
  190. FactionInfo[playerid][fRank] = 0;
  191. Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{FF6633}MAIN-ROLEPLAY", "{FFFFFF}Bine ai venit pe server! Te rog introdu-ti parola mai jos pentru a continua.", "JOIN", "IESI");
  192. }
  193. fetcher_close();
  194.  
  195. RemoveBuildingForPlayer(playerid, 8489, 1932.7813, 1177.3984, 39.9219, 0.25);
  196. RemoveBuildingForPlayer(playerid, 8700, 1932.7813, 1177.3984, 39.9219, 0.25);
  197. RemoveBuildingForPlayer(playerid, 9121, 1944.8047, 1183.9141, 18.9531, 0.25);
  198. return 1;
  199. }
  200.  
  201. public OnPlayerDisconnect(playerid, reason)
  202. {
  203. DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
  204. "Kills", INTEGER, PlayerInfo[playerid][pKills],
  205. "Deaths", INTEGER, PlayerInfo[playerid][pDeaths],
  206. "Developer", INTEGER, PlayerInfo[playerid][pDeveloper],
  207. "Bani", INTEGER, GetPlayerMoney(playerid),
  208. "Admin", INTEGER, PlayerInfo[playerid][pAdmin],
  209. "Tester", INTEGER, PlayerInfo[playerid][pTester],
  210. "Factiune", INTEGER, PlayerInfo[playerid][pFaction],
  211. "Rank", INTEGER, FactionInfo[playerid][fRank],
  212. "Lider", INTEGER, PlayerInfo[playerid][pLeader]);
  213.  
  214. return 1;
  215. }
  216.  
  217. public OnPlayerSpawn(playerid)
  218. {
  219. TextDrawHideForPlayer(playerid, spawntextdraw);
  220. if(PlayerInfo[playerid][ADT] == 1)
  221. {
  222. SetPlayerPos(playerid, 670.1275,-185.6758,1001.9141);
  223. SendClientMessage(playerid, -1, "{FFFFFF}TE RECUPEREZI...");
  224. TogglePlayerControllable(playerid, false);
  225. SetTimer("recuperare", 6000, false);
  226. PlayerInfo[playerid][ADT] = 0;
  227. }
  228. else
  229. {
  230. SetPlayerPos(playerid, -1534.6560,2645.2664,55.8359);
  231. }
  232. return 1;
  233. }
  234.  
  235. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  236. {
  237. if(!success) SendClientMessage(playerid, COLOR_PURPLE, ""SERVER_NAME": {FFFFFF}Comanda necunoscuta. Foloseste [/help] pentru comenzi.");
  238. return 1;
  239. }
  240.  
  241. public OnPlayerDeath(playerid, killerid, reason)
  242. {
  243. PlayerInfo[playerid][pDeaths]++; // increase player's deaths count
  244.  
  245. if (killerid != INVALID_PLAYER_ID)
  246. PlayerInfo[killerid][pKills]++; // increase killer's kills count if the id is of a connected player
  247.  
  248. PlayerInfo[playerid][ADT] = 1;
  249. return 1;
  250. }
  251.  
  252. public OnVehicleSpawn(vehicleid)
  253. {
  254. Engine[vehicleid] = 0;
  255. Lights[vehicleid] = 0;
  256. return 1;
  257. }
  258.  
  259. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  260. {
  261. new viata = GetVehicleHealth(vehicleid);
  262. new vehicle = GetPlayerVehicleID(playerid);
  263. if(viata < 310)
  264. {
  265. new lights, alarm, doors, bonnet, boot, objective, engine;
  266. SetVehicleParamsForPlayer(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
  267. SendClientMessage(playerid, COLOR_RED, "Vehiculul tau este avariat. Nu mai functioneaza.");
  268. CarInfo[vehicle][Avariat] = 1;
  269. }
  270. return 1;
  271. }
  272. public OnVehicleDeath(vehicleid, killerid)
  273. {
  274. return 1;
  275. }
  276.  
  277. public OnPlayerText(playerid, text[])
  278. {
  279. new nume[MAX_PLAYER_NAME];
  280. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  281. /*if(strfind(text, "?", true) != -1)
  282. {
  283. new msg[128];
  284. format(msg, sizeof(msg), "{FFFFFF}%s intreaba: %s", nume, text);
  285. ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
  286. }
  287. if(strfind(text, "!", true) != -1)
  288. {
  289. new msg[128];
  290. format(msg, sizeof(msg), "{FFFFFF}%s striga: %s", nume, text);
  291. ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
  292. }*/
  293. new msg[128];
  294. format(msg, sizeof(msg), "{FFFFFF}%s spune: %s", nume, text);
  295. ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
  296. return 0;
  297. }
  298.  
  299. CMD:acceptdeath(playerid, params[]) {
  300. if(PlayerInfo[playerid][DT] != 1)
  301. return SendClientMessage(playerid, -1, "Nu esti in deathtimer!");
  302. if(PlayerInfo[playerid][DTT] != 1) return SendClientMessage(playerid, -1, "Nu au trecut 120 secunde!");
  303. SetPlayerPos(playerid,317.2694,54.9657,3.3750);
  304. SendClientMessage(playerid, COLOR_PURPLE, " ?: {FFFFFF}Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");
  305. SendClientMessage(playerid, COLOR_PURPLE, " ?: {FFFFFF}Acolo ti-a oferit primul ajutor iar acum te simti bine!");
  306. TogglePlayerControllable(playerid, 1);
  307. PlayerInfo[playerid][DT] = 0;
  308. PlayerInfo[playerid][ADT] = 1;
  309. return 1;
  310. }
  311.  
  312. CMD:me(playerid, params[]) {
  313. new string[128], text[128], pname[MAX_PLAYER_NAME+1];//establishes a few things needed to tell the players name, rank, and the text he has written.
  314. GetPlayerName(playerid, pname, sizeof(pname));
  315. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /me [text]");
  316. format(string, sizeof(string), "%s %s", pname, text);
  317. ProxDetector(50.00,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  318. return 1;
  319. }
  320.  
  321. CMD:do(playerid, params[]) {
  322. new string[128], text[128], pname[MAX_PLAYER_NAME+1];//establishes a few things needed to tell the players name, rank, and the text he has written.
  323. GetPlayerName(playerid, pname, sizeof(pname));
  324. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /do [text]");
  325. format(string, sizeof(string), "%s (( %s ))", text, pname);
  326. ProxDetector(50.00,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  327. return 1;
  328. }
  329.  
  330. CMD:changepass(playerid, params[])
  331. {
  332. new password[64];
  333. if (sscanf(params, "s[64]", password))
  334. return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /changepass [parola noua]");
  335.  
  336. // check password's length
  337. new len = strlen(password);
  338. if (len > MAX_PASSWORD_LENGTH || len < MIN_PASSWORD_LENGTH)
  339. {
  340. new str[150];
  341. format(str, sizeof (str), "Parola invalida. Caractele sunt intre %i si %i.", MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH);
  342. return SendClientMessage(playerid, 0xFFFFFFFF, str);
  343. }
  344.  
  345. // hashing the password
  346. SHA256_PassHash(password, PASSWORD_SALT, PlayerInfo[playerid][pPass], 64);
  347.  
  348. // update player's password
  349. DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
  350. "Parola", STRING, PlayerInfo[playerid][pPass]);
  351.  
  352. return SendClientMessage(playerid, 0xFFFFFFFF, "Parola schimbata!");
  353. }
  354.  
  355. CMD:fkick(playerid,params[])
  356. {
  357. if(PlayerInfo[playerid][pAdmin] >= 6)//Replace this with your player variable
  358. {
  359. new targetid;//establishes a person on the server to use the command on
  360. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_CYAN, "/fackick [id]");//tells you how to use the command if you use it incorrectly
  361. if(targetid != INVALID_PLAYER_ID)//checks if the id you type in is an id that is not connected to the server
  362. {
  363. PlayerInfo[targetid][pFaction] = 0; //kicks the player from his faction
  364. FactionInfo[targetid][fRank] = 0;//sets his rank to 0
  365. PlayerInfo[targetid][pLeader] = 0;// revokes his leadership status
  366. SendClientMessage(targetid,COLOR_CYAN,"Ai fost dat afara din factiunea ta, de catre un administrator!");//tells them they have been kicked out of their faction by an admin.
  367. }
  368. }
  369. else//if they arent an admin then it will send them they message below telling them they may not use the command
  370. {
  371. SendClientMessage(playerid, COLOR_CYAN, "Nu esti autorizat.");
  372. }
  373. return 1;
  374. }
  375.  
  376. CMD:setleader(playerid, params[])
  377. {
  378. if(PlayerInfo[playerid][pAdmin] >= 6)
  379. {
  380. new targetid, facid;
  381. if(sscanf(params,"ui",targetid, facid)) return SendClientMessage(playerid, COLOR_CYAN,"/setleader [id] [factiune]");//if the command is misused it will tell them the correct way to use it
  382. if(targetid != INVALID_PLAYER_ID)
  383. {
  384. PlayerInfo[targetid][pFaction] = facid;
  385. PlayerInfo[targetid][fRank] = 1;
  386. PlayerInfo[targetid][pLeader] = facid;
  387. if(facid == 1)
  388. {
  389. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQPD!");
  390. }
  391. else if(facid == 2)
  392. {
  393. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQFD!");
  394. }
  395. else if(facid == 3)
  396. {
  397. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca primar!");
  398. }
  399. else if(facid == 4)
  400. {
  401. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQN!");
  402. }
  403. else if(facid == 5)
  404. {
  405. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG1!");
  406. }
  407. else if(facid == 6)
  408. {
  409. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG2!");
  410. }
  411. else if(facid == 7)
  412. {
  413. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG3!");
  414. }
  415. else if(facid == 8)
  416. {
  417. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG4!");
  418. }
  419. else if(facid == 9)
  420. {
  421. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE1!");
  422. }
  423. else if(facid == 10)
  424. {
  425. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE2!");
  426. }
  427. else if(facid == 11)
  428. {
  429. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE3!");
  430. }
  431. else if(facid == 12)
  432. {
  433. SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE4!");
  434. }
  435. }
  436. else
  437. {
  438. SendClientMessage(playerid, COLOR_CYAN, "Nu esti autorizat.");
  439. }
  440. return 1;
  441. }
  442.  
  443. CMD:finvite(playerid, params[])
  444. {
  445. if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)
  446. {
  447. new tarid, facid;
  448. new string[128];
  449. if(sscanf(params, "u", tarid)) return SendClientMessage(playerid, COLOR_CYAN, "> !: /invite [playerid]");
  450. facid = PlayerInfo[playerid][pFaction];
  451. SetPVarInt(tarid, "invitefac", facid);
  452. format(string, sizeof(string), "Ai fost invitat in factiunea cu id-ul %s. Pentru a te alatura, /acceptfaction.", PlayerInfo[playerid][pFaction]);
  453. SendClientMessage(tarid, COLOR_CYAN, string);
  454. }
  455. else
  456. {
  457. SendClientMessage(playerid, COLOR_CYAN, "Nu ai autoritate necesara.");
  458. }
  459. return 1;
  460. }
  461. CMD:acceptinvite(playerid, params[])
  462. {
  463.  
  464. new facid, string[128];
  465. facid = GetPVarInt(playerid, "invitefac");
  466. PlayerInfo[playerid][pFaction] = facid;
  467. if(PlayerInfo[playerid][pFaction] == 1)
  468. {
  469. FactionInfo[playerid][fRank] = 14;
  470. }
  471. else if(PlayerInfo[playerid][pFaction] == 2)
  472. {
  473. FactionInfo[playerid][fRank] = 15;
  474. }
  475. else if(PlayerInfo[playerid][pFaction] == 3)
  476. {
  477. FactionInfo[playerid][fRank] = 2;
  478. }
  479. format(string, sizeof(string), "> Ai acceptat invitatia factiunii %d.", facid);//tells the player they have accepted the faction invite
  480. SendClientMessage(playerid, COLOR_CYAN, string);//shows the above message in the color of CYAN
  481. DeletePVar(playerid, "invitefac");//deletes the saved invite
  482. return 1;
  483. }
  484. CMD:uninvite(playerid,params[])
  485. {
  486. if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)
  487. {
  488. new targetid;
  489. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_CYAN, "/copuninvite [id]");//if the command is not typed correctly it will display how to do it the right way.
  490. if(targetid != INVALID_PLAYER_ID)
  491. {
  492. PlayerInfo[targetid][pFaction] = 0;
  493. PlayerInfo[targetid][fRank] = 0;
  494. PlayerInfo[targetid][pLeader] = 0;
  495. SendClientMessage(targetid,COLOR_CYAN,"Ai fost scos din factiune.");//states you've been kicked from the faction to the player the command is used on.
  496. }
  497. }
  498. else
  499. {
  500. SendClientMessage(playerid, COLOR_CYAN, "Nu esti in factiune/Nu ai rankul necesar!");
  501. }
  502. return 1;
  503. }
  504.  
  505. CMD:giverank(playerid, params[])
  506. {
  507. if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)//checks if the player is high enough rank
  508. {
  509. new targetid, rank, string[128];//establishes a player to use the command on, the rank you want to set, and some words to tell the players the actions used on them.
  510. if(sscanf(params, "ui", targetid, rank)) return SendClientMessage(playerid, COLOR_CYAN, "Usage: /giverank [playerid][rank]");//checks if the command was typed correctly
  511. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_CYAN, "Playerul nu este conectat.");//if the player id typed is not connected it will state that to you.
  512. if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) return SendClientMessage(playerid, COLOR_CYAN, "Playerul selectat nu este in factiunea ta!");//if the player is not in the same faction it will not let him set the rank.
  513. if(PlayerInfo[playerid][pFaction] == 1)
  514. {
  515. if(rank < 2 || rank > 17)
  516. {
  517. SendClientMessage(playerid, COLOR_CYAN,"Rank-urile trebuie sa fie de la 2 la 16");
  518. SendClientMessage(playerid, COLOR_CYAN,"Rank 15 reprezinta membru academie, iar 16 suspendat.");
  519. return 1;
  520. }
  521. }
  522. else if(PlayerInfo[playerid][pFaction] == 2)
  523. {
  524. if(rank < 2 || rank > 17)
  525. {
  526. SendClientMessage(playerid, COLOR_CYAN,"Rank-urile trebuie sa fie de la 2 la 17.");
  527. SendClientMessage(playerid, COLOR_CYAN,"Rank 16 reprezinta un membru academie, iar 17 suspendat.");
  528. }
  529. }
  530. else if(PlayerInfo[playerid][pFaction] == 3)
  531. {
  532. if(rank < 2 || rank > 2)
  533. {
  534. SendClientMessage(playerid, COLOR_CYAN,"Nu detii dreptul de a da rank-uri.");
  535. SendClientMessage(playerid, COLOR_CYAN,"Rank 2 este intotdeauna un administrator.");
  536. }
  537. }
  538. PlayerInfo[targetid][fRank] = rank;//sets the players rank to the rank you choose
  539. format(string, sizeof(string), "Rank-ul tau a fost setat la %d!", rank);
  540. SendClientMessage(targetid, COLOR_GREEN, string);//states that the players rank was changed
  541. }
  542. else //if the player is not the correct rank it will display this message below
  543. {
  544. SendClientMessage(playerid, COLOR_CYAN, "Nu esti intr-o factiune / nu ai rank-ul necesar.");
  545. }
  546. return 1;
  547. }
  548.  
  549. CMD:f(playerid, params[]) return cmd_faction(playerid, params);
  550. CMD:faction(playerid, params[])
  551. {
  552. new string[128], text[128], pname[MAX_PLAYER_NAME+1];//establishes a few things needed to tell the players name, rank, and the text he has written.
  553. GetPlayerName(playerid, pname, sizeof(pname));//gets the name of the player using /radio
  554. if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /f [text]");//if /r is not used correctly it will tell you the correct way to use it
  555. if(PlayerInfo[playerid][pFaction] == 1)//checks if the player is in the first faction
  556. {
  557. if(PlayerInfo[playerid][pLeader] == 1)
  558. {
  559. format(string, sizeof(string), "(( Chief of Police %s: %s ))", pname, text);
  560. SendPDMessage(COLOR_CYAN, string);//calls a stock below that checks who the /r should be sent to
  561. }
  562. else if(FactionInfo[playerid][fRank] == 2)
  563. {
  564. format(string, sizeof(string), "(( ACOP %s: %s ))", pname, text);
  565. SendPDMessage(COLOR_CYAN, string);
  566. }
  567. else if(FactionInfo[playerid][fRank] == 3)
  568. {
  569. format(string, sizeof(string), "(( DCOP %s: %s ))", pname, text);
  570. SendPDMessage(COLOR_CYAN, string);
  571. }
  572. else if(FactionInfo[playerid][fRank] == 4)
  573. {
  574. format(string, sizeof(string), "(( Lieutenant %s: %s ))", pname, text);
  575. SendPDMessage(COLOR_CYAN, string);
  576. }
  577. else if(FactionInfo[playerid][fRank] == 5)
  578. {
  579. format(string, sizeof(string), "(( Captain %s: %s ))", pname, text);
  580. SendPDMessage(COLOR_CYAN, string);
  581. }
  582. else if(FactionInfo[playerid][fRank] == 6)
  583. {
  584. format(string, sizeof(string), "(( Commander %s: %s ))", pname, text);
  585. SendPDMessage(COLOR_CYAN, string);
  586. }
  587. else if(FactionInfo[playerid][fRank] == 7)
  588. {
  589. format(string, sizeof(string), "(( SGT II %s: %s ))", pname, text);
  590. SendPDMessage(COLOR_CYAN, string);
  591. }
  592. else if(FactionInfo[playerid][fRank] == 8)
  593. {
  594. format(string, sizeof(string), "(( SGT I %s: %s ))", pname, text);
  595. SendPDMessage(COLOR_CYAN, string);
  596. }
  597. else if(FactionInfo[playerid][fRank] == 9)
  598. {
  599. format(string, sizeof(string), "(( DIII %s: %s ))", pname, text);
  600. SendPDMessage(COLOR_CYAN, string);
  601. }
  602. else if(FactionInfo[playerid][fRank] == 10)
  603. {
  604. format(string, sizeof(string), "(( DII %s: %s ))", pname, text);
  605. SendPDMessage(COLOR_CYAN, string);
  606. }
  607. else if(FactionInfo[playerid][fRank] == 11)
  608. {
  609. format(string, sizeof(string), "(( DI %s: %s ))", pname, text);
  610. SendPDMessage(COLOR_CYAN, string);
  611. }
  612. else if(FactionInfo[playerid][fRank] == 12)
  613. {
  614. format(string, sizeof(string), "(( LIO %s: %s ))", pname, text);
  615. SendPDMessage(COLOR_CYAN, string);
  616. }
  617. else if(FactionInfo[playerid][fRank] == 13)
  618. {
  619. format(string, sizeof(string), "(( PO III %s: %s ))", pname, text);
  620. SendPDMessage(COLOR_CYAN, string);
  621. }
  622. else if(FactionInfo[playerid][fRank] == 14)
  623. {
  624. format(string, sizeof(string), "(( PO II %s: %s ))", pname, text);
  625. SendPDMessage(COLOR_CYAN, string);
  626. }
  627. else if(FactionInfo[playerid][fRank] == 15)
  628. {
  629. format(string, sizeof(string), "(( PO I %s: %s ))", pname, text);
  630. SendPDMessage(COLOR_CYAN, string);
  631. }
  632. else if(FactionInfo[playerid][fRank] == 16)
  633. {
  634. format(string, sizeof(string), "(( A. Student %s: %s ))", pname, text);
  635. SendPDMessage(COLOR_CYAN, string);
  636. }
  637. else if(FactionInfo[playerid][fRank] == 17)
  638. {
  639. format(string, sizeof(string), "(( Suspendat %s: %s ))", pname, text);
  640. SendPDMessage(COLOR_CYAN, string);
  641. }
  642. }
  643. else if(PlayerInfo[playerid][pFaction] == 2)
  644. {
  645. if(FactionInfo[playerid][fRank] == 1)
  646. {
  647. format(string, sizeof(string), "(( Comissioner %s: %s ))", pname, text);
  648. SendFDMessage(COLOR_CYAN, string);
  649. }
  650. else if(FactionInfo[playerid][fRank] == 2)
  651. {
  652. format(string, sizeof(string), "(( Deputy Commissioner %s: %s ))", pname, text);
  653. SendFDMessage(COLOR_CYAN, string);
  654. }
  655. else if(FactionInfo[playerid][fRank] == 3)
  656. {
  657. format(string, sizeof(string), "(( Division Chief %s: %s ))", pname, text);
  658. SendFDMessage(COLOR_CYAN, string);
  659. }
  660. else if(FactionInfo[playerid][fRank] == 4)
  661. {
  662. format(string, sizeof(string), "(( Battalion Chief %s: %s ))", pname, text);
  663. SendFDMessage(COLOR_CYAN, string);
  664. }
  665. else if(FactionInfo[playerid][fRank] == 5)
  666. {
  667. format(string, sizeof(string), "(( Captain %s: %s ))", pname, text);
  668. SendFDMessage(COLOR_CYAN, string);
  669. }
  670. else if(FactionInfo[playerid][fRank] == 6)
  671. {
  672. format(string, sizeof(string), "(( Chief of Medicine %s: %s ))", pname, text);
  673. SendFDMessage(COLOR_CYAN, string);
  674. }
  675. else if(FactionInfo[playerid][fRank] == 7)
  676. {
  677. format(string, sizeof(string), "(( Lieutenant %s: %s ))", pname, text);
  678. SendFDMessage(COLOR_CYAN, string);
  679. }
  680. else if(FactionInfo[playerid][fRank] == 8)
  681. {
  682. format(string, sizeof(string), "(( Lead Paramedic %s: %s ))", pname, text);
  683. SendFDMessage(COLOR_CYAN, string);
  684. }
  685. else if(FactionInfo[playerid][fRank] == 9)
  686. {
  687. format(string, sizeof(string), "(( Attending Physician %s: %s ))", pname, text);
  688. SendFDMessage(COLOR_CYAN, string);
  689. }
  690. else if(FactionInfo[playerid][fRank] == 10)
  691. {
  692. format(string, sizeof(string), "(( EMT %s: %s ))", pname, text);
  693. SendFDMessage(COLOR_CYAN, string);
  694. }
  695. else if(FactionInfo[playerid][fRank] == 11)
  696. {
  697. format(string, sizeof(string), "(( Paramedic %s: %s ))", pname, text);
  698. SendFDMessage(COLOR_CYAN, string);
  699. }
  700. else if(FactionInfo[playerid][fRank] == 12)
  701. {
  702. format(string, sizeof(string), "(( First Responder %s: %s ))", pname, text);
  703. SendFDMessage(COLOR_CYAN, string);
  704. }
  705. else if(FactionInfo[playerid][fRank] == 13)
  706. {
  707. format(string, sizeof(string), "(( Firefighter II %s: %s ))", pname, text);
  708. SendFDMessage(COLOR_CYAN, string);
  709. }
  710. else if(FactionInfo[playerid][fRank] == 14)
  711. {
  712. format(string, sizeof(string), "(( Firefighter I %s: %s ))", pname, text);
  713. SendFDMessage(COLOR_CYAN, string);
  714. }
  715. else if(FactionInfo[playerid][fRank] == 15)
  716. {
  717. format(string, sizeof(string), "(( PF %s: %s ))", pname, text);
  718. SendFDMessage(COLOR_CYAN, string);
  719. }
  720. else if(FactionInfo[playerid][fRank] == 16)
  721. {
  722. format(string, sizeof(string), "(( Academy Student %s: %s ))", pname, text);
  723. SendFDMessage(COLOR_CYAN, string);
  724. }
  725. else if(FactionInfo[playerid][fRank] == 17)
  726. {
  727. format(string, sizeof(string), "(( Suspendat %s: %s ))", pname, text);
  728. SendFDMessage(COLOR_CYAN, string);
  729. }
  730. }
  731. else if(PlayerInfo[playerid][pFaction] == 3)
  732. {
  733. if(FactionInfo[playerid][fRank] == 1)
  734. {
  735. format(string, sizeof(string), "(( Governor %s: %s ))", pname, text);
  736. SendGOVMessage(COLOR_CYAN, string);
  737. }
  738. else if(FactionInfo[playerid][fRank] == 2)
  739. {
  740. format(string, sizeof(string), "(( Parlamentar %s: %s ))", pname, text);
  741. SendGOVMessage(COLOR_CYAN, string);
  742. }
  743. }
  744. else if(PlayerInfo[playerid][pFaction] == 4)
  745. {
  746. if(FactionInfo[playerid][fRank] == 1)
  747. {
  748. format(string, sizeof(string), "(( Network Chief %s: %s ))", pname, text);
  749. SendNEWSMessage(COLOR_CYAN, string);
  750. }
  751. else if(FactionInfo[playerid][fRank] == 2)
  752. {
  753. format(string, sizeof(string), "(( General Director %s: %s ))", pname, text);
  754. SendNEWSMessage(COLOR_CYAN, string);
  755. }
  756. else if(FactionInfo[playerid][fRank] == 3)
  757. {
  758. format(string, sizeof(string), "(( Director %s: %s ))", pname, text);
  759. SendNEWSMessage(COLOR_CYAN, string);
  760. }
  761. else if(FactionInfo[playerid][fRank] == 4)
  762. {
  763. format(string, sizeof(string), "(( Publisher %s: %s ))", pname, text);
  764. SendNEWSMessage(COLOR_CYAN, string);
  765. }
  766. else if(FactionInfo[playerid][fRank] == 5)
  767. {
  768. format(string, sizeof(string), "(( Network IT'st %s: %s ))", pname, text);
  769. SendNEWSMessage(COLOR_CYAN, string);
  770. }
  771. else if(FactionInfo[playerid][fRank] == 6)
  772. {
  773. format(string, sizeof(string), "(( Newspaper Deep %s: %s ))", pname, text);
  774. SendNEWSMessage(COLOR_CYAN, string);
  775. }
  776. }
  777. else if(PlayerInfo[playerid][pFaction] == 0)//if the player is not in a faction it will not send him any messages
  778. {
  779. return 1;
  780. }
  781. return 1;
  782. }
  783.  
  784. CMD:credite(playerid, params[]) {
  785. SendClientMessage(playerid, -1, "{FFFFFF}Oferim respect tuturor script-urilor ce ne-au ajutat, asa ca o sa lasam jos tot ce am 'imprumutat'.");
  786. SendClientMessage(playerid, -1, "{FF0000}*~ {FFFFFF}ObjectMap - sistem de mapping pe server, editat putin de noi. #Drebin");
  787. SendClientMessage(playerid, -1, "{FFFFFF}Tot ce nu apare mai sus, este creeat de catre noi, fara 'imprumuturi'");
  788. return 1;
  789. }
  790.  
  791. CMD:help(playerid, params[]) {
  792. SendClientMessage(playerid, -1, "{FFFFFF}[ROLEPLAY]: /ame, /me, /do, /shout");
  793. SendClientMessage(playerid, -1, "{FFFFFF}[MASINI:GENERAL]: /engine, /seatbelt, /lights, /alarm, /p(hone)car");
  794. SendClientMessage(playerid, -1, "{FFFFFF}[TELEFON]: /phone, /call, /sms, /contacts");
  795. SendClientMessage(playerid, -1, "{FFFFFF}[SCRIPT-WISE]: /tie, /maskon, /myclothes");
  796. SendClientMessage(playerid, -1, "{FFFFFF}[CONT]: /stats, /changepassword");
  797. SendClientMessage(playerid, -1, "{FFFFFF}[ITEME]: /bag, /wallet");
  798. SendClientMessage(playerid, -1, "{FFFFFF}[ARME]: /toaca, /reload, /giveweapon, /acceptweapon");
  799. SendClientMessage(playerid, -1, "{FFFFFF}[ANIMURI]: /animlist");
  800. SendClientMessage(playerid, -1, "{FFFFFF}[CURIER]: /incepe, /livreaza");
  801. SendClientMessage(playerid, -1, "{FFFFFF}[HCURIER]: /incepe, /prinde, /livreaza");
  802. SendClientMessage(playerid, -1, "{FFFFFF}[NEWSPAPER]: /incepe, /arunca");
  803. SendClientMessage(playerid, -1, "{FFFFFF}[DROGURI]: /duse, /dgive, /dplant");
  804. if(PlayerInfo[playerid][pFaction] == 1)
  805. {
  806. SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /taser, /cuff, /uncuff, /freeze[DOAR PRIN RP]");
  807. SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /radio, /d(epartamental), /gov(doar rank inalt)");
  808. SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /jail, /unjail, /law, /units, /su, /mdc");
  809. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  810. SendClientMessage(playerid, -1, "{FFFFFF}// Esti politist, te ocupi cu protejarea satului.");
  811. }
  812. else if(PlayerInfo[playerid][pFaction] == 2)
  813. {
  814. SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /heal, /cure, /hpc, /ghinsurance, /r");
  815. SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /entergarage, /exitgarage, /gov(doar rank inalt)");
  816. SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /d(epartamental)");
  817. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  818. SendClientMessage(playerid, -1, "{FFFFFF}// Esti medic, te ocupi cu salvarea oamenilor, prin roleplay + comenzi.");
  819. }
  820. else if(PlayerInfo[playerid][pFaction] == 3)
  821. {
  822. SendClientMessage(playerid, -1, "{FFFFFF}[GOVERNOR]: /government, /su, /departamental");
  823. SendClientMessage(playerid, -1, "{FFFFFF}[GOVERNOR]: /t(axa)s(omari)");
  824. SendClientMessage(playerid, -1, "{FFFFFF}// Esti primar, nu exista foarte multe comenzi, rolezi in general.");
  825. SendClientMessage(playerid, -1, "{FFFFFF}// Te ocupi de satul El Quebrados, si nu ai membrii in factiune.");
  826. }
  827. else if(PlayerInfo[playerid][pFaction] == 4)
  828. {
  829. SendClientMessage(playerid, -1, "{FFFFFF}[EQN]: /news, /live");
  830. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  831. SendClientMessage(playerid, -1, "{FFFFFF}// Esti reporter. Te ocupi cu reportaje la TV/radio etc.[/news] si cu dezvaluiri in direct la TV [/live]");
  832. SendClientMessage(playerid, -1, "{FFFFFF}// Live este asemanator cu news la structura, dar live se foloseste la reportaje, NUMAI la TV.");
  833. }
  834. else if(PlayerInfo[playerid][pFaction] == 5)
  835. {
  836. SendClientMessage(playerid, -1, "{FFFFFF}[GANG1]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
  837. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  838. SendClientMessage(playerid, -1, "{FFFFFF}// Gang-ul este o grupare imensa. Numai insiderii se ocupa de arme/droguri, outsiderii se pot ocupa DOAR de materialel si actiuni IC.");
  839. SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
  840. }
  841. else if(PlayerInfo[playerid][pFaction] == 6)
  842. {
  843. SendClientMessage(playerid, -1, "{FFFFFF}[GANG2]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
  844. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  845. SendClientMessage(playerid, -1, "{FFFFFF}// Gang-ul este o grupare imensa. Numai insiderii se ocupa de arme/droguri, outsiderii se pot ocupa DOAR de materialel si actiuni IC.");
  846. SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
  847. }
  848. else if(PlayerInfo[playerid][pFaction] == 7)
  849. {
  850. SendClientMessage(playerid, -1, "{FFFFFF}[GANG3]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
  851. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  852. SendClientMessage(playerid, -1, "{FFFFFF}// Gang-ul este o grupare imensa. Numai insiderii se ocupa de arme/droguri, outsiderii se pot ocupa DOAR de materialel si actiuni IC.");
  853. SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
  854. }
  855. else if(PlayerInfo[playerid][pFaction] == 8)
  856. {
  857. SendClientMessage(playerid, -1, "{FFFFFF}[GANG4]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
  858. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  859. SendClientMessage(playerid, -1, "{FFFFFF}// Gang-ul este o grupare imensa. Numai insiderii se ocupa de arme/droguri, outsiderii se pot ocupa DOAR de materialel si actiuni IC.");
  860. SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
  861. }
  862. else if(PlayerInfo[playerid][pFaction] == 9)
  863. {
  864. SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE1]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
  865. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  866. SendClientMessage(playerid, -1, "{FFFFFF}// Mafia este o grupare restransa cu putere innalta. Insiderii pot creea/cumpara droguri/arme, iar outsiderii pot doar creea materiale si sa participe la actiuni IC.");
  867. }
  868. else if(PlayerInfo[playerid][pFaction] == 10)
  869. {
  870. SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE2]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
  871. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  872. SendClientMessage(playerid, -1, "{FFFFFF}// Mafia este o grupare restransa cu putere innalta. Insiderii pot creea/cumpara droguri/arme, iar outsiderii pot doar creea materiale si sa participe la actiuni IC.");
  873. }
  874. else if(PlayerInfo[playerid][pFaction] == 11)
  875. {
  876. SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE3]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
  877. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  878. SendClientMessage(playerid, -1, "{FFFFFF}// Mafia este o grupare restransa cu putere innalta. Insiderii pot creea/cumpara droguri/arme, iar outsiderii pot doar creea materiale si sa participe la actiuni IC.");
  879. }
  880. else if(PlayerInfo[playerid][pFaction] == 12)
  881. {
  882. SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE4]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
  883. SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
  884. SendClientMessage(playerid, -1, "{FFFFFF}// Mafia este o grupare restransa cu putere innalta. Insiderii pot creea/cumpara droguri/arme, iar outsiderii pot doar creea materiale si sa participe la actiuni IC.");
  885. }
  886. if(PlayerInfo[playerid][pLeader] == 1) // lider guvernamentale
  887. {
  888. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
  889. }
  890. else if(PlayerInfo[playerid][pLeader] == 2)
  891. {
  892. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
  893. }
  894. else if(PlayerInfo[playerid][pLeader] == 3)
  895. {
  896. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
  897. }
  898. else if(PlayerInfo[playerid][pLeader] == 4) // san news
  899. {
  900. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  901. }
  902. else if(PlayerInfo[playerid][pLeader] == 5) // gang/mafie
  903. {
  904. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  905. }
  906. else if(PlayerInfo[playerid][pLeader] == 6)
  907. {
  908. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  909. }
  910. else if(PlayerInfo[playerid][pLeader] == 7)
  911. {
  912. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  913. }
  914. else if(PlayerInfo[playerid][pLeader] == 8)
  915. {
  916. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  917. }
  918. else if(PlayerInfo[playerid][pLeader] == 9)
  919. {
  920. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  921. }
  922. else if(PlayerInfo[playerid][pLeader] == 10)
  923. {
  924. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  925. }
  926. else if(PlayerInfo[playerid][pLeader] == 11)
  927. {
  928. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  929. }
  930. else if(PlayerInfo[playerid][pLeader] == 12)
  931. {
  932. SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
  933. }
  934. return 1;
  935. }
  936.  
  937. CMD:engine(playerid, params[]) {
  938. if(GetPlayerState(playerid) == 2)
  939. {
  940. new vehicle = GetPlayerVehicleID(playerid);
  941. new nume[MAX_PLAYER_NAME];
  942. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  943. new string[128];
  944. if(CarInfo[vehicle][Avariat] != 1)
  945. {
  946. if(Engine[vehicle] == 0)
  947. {
  948. new engine, lights, alarm, doors, bonnet, boot, objective;
  949. GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
  950. Engine[vehicle] = 1;
  951. SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
  952. format(string, sizeof(string), "%s intoarce cheia si porneste motorul masinii.", nume);
  953. ProxDetector(20.00, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  954. }
  955. else if(Engine[vehicle] == 1)
  956. {
  957. new engine, lights, alarm, doors, bonnet, boot, objective;
  958. GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
  959. Engine[vehicle] = 0;
  960. SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
  961. format(string, sizeof(string), "%s intoarce cheia si opreste motorul masinii.", nume);
  962. ProxDetector(20.00, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  963. }
  964. }
  965. else
  966. {
  967. SendClientMessage(playerid, -1, "Vehiculul este avariat.");
  968. }
  969. }
  970. else return SendClientMessage(playerid, -1, "{FFFFFF}Nu esti intr-o masina.");
  971. return 1;
  972. }
  973.  
  974. CMD:news(playerid, params[])
  975. {
  976. new msg[128];
  977. if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti in EQN!");
  978. if(FactionInfo[playerid][fDuty] != 1) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti duty.");
  979. if(isnull(params)) return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}/news [TEXT]");
  980. new nume[MAX_PLAYER_NAME];
  981. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  982. format(msg, sizeof(msg), "{99FF66}[EQN] %s: %s", nume, params);
  983. SendClientMessageToAll(COLOR_PURPLE, msg);
  984. return 1;
  985. }
  986.  
  987. CMD:live(playerid, params[])
  988. {
  989. new msg[128];
  990. if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti in EQN!");
  991. if(FactionInfo[playerid][fDuty] != 1) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti duty.");
  992. if(isnull(params)) return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}/live [TEXT]");
  993. new nume[MAX_PLAYER_NAME];
  994. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  995. format(msg, sizeof(msg), "{99FF66}[TV BROADCAST] %s: %s", nume, params);
  996. SendClientMessageToAll(COLOR_PURPLE, msg);
  997. return 1;
  998. }
  999.  
  1000. CMD:seteaza(playerid, params[])
  1001. {
  1002. new PlayerName[24];
  1003. GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  1004. if(!strcmp(PlayerName, "Henry_Baldwin", false))
  1005. {
  1006. PlayerInfo[playerid][pDeveloper] = 1;
  1007. PlayerInfo[playerid][pAdmin] = 6;
  1008. PlayerInfo[playerid][pTester] = 1;
  1009. SendClientMessage(playerid, -1, "Ti-ai primit functia.");
  1010. return 1;
  1011. }
  1012. else
  1013. {
  1014. SendClientMessage(playerid, -1, "Numai ImTouchk# are acces la aceasta comanda!");
  1015. }
  1016. return 1;
  1017. }
  1018.  
  1019. CMD:duty(playerid, params[])
  1020. {
  1021. if(PlayerInfo[playerid][pFaction] == 2)
  1022. {
  1023. if(IsPlayerInRangeOfPoint(playerid, 20.00, 643.6490,-165.0781,1001.2758))
  1024. {
  1025. if(FactionInfo[playerid][fDuty] == 0)
  1026. {
  1027. new nume[MAX_PLAYER_NAME];
  1028. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  1029. new string[128];
  1030. FactionInfo[playerid][fDuty] = 1;
  1031. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
  1032. format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
  1033. SendFDMessage(COLOR_PURPLE, string);
  1034. }
  1035. else if(FactionInfo[playerid][fDuty] == 1)
  1036. {
  1037. new nume[MAX_PLAYER_NAME];
  1038. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  1039. new string[128];
  1040. FactionInfo[playerid][fDuty] = 0;
  1041. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
  1042. format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
  1043. SendFDMessage(COLOR_PURPLE, string);
  1044. }
  1045. }
  1046. else
  1047. {
  1048. SendClientMessage(playerid, -1, "Nu esti in vestiar!");
  1049. SetPlayerCheckpoint(playerid, 643.6490,-165.0781,1001.2758);
  1050. }
  1051. }
  1052. else if(PlayerInfo[playerid][pFaction] == 1)
  1053. {
  1054. if(IsPlayerInRangeOfPoint(playerid, 20.00, 1884.0470,1232.3463,18.0986))
  1055. {
  1056. if(FactionInfo[playerid][fDuty] == 0)
  1057. {
  1058. new nume[MAX_PLAYER_NAME];
  1059. new string[128];
  1060. FactionInfo[playerid][fDuty] = 1;
  1061. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
  1062. format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
  1063. SendPDMessage(COLOR_PURPLE, string);
  1064. }
  1065. else if(FactionInfo[playerid][fDuty] == 1)
  1066. {
  1067. new nume[MAX_PLAYER_NAME];
  1068. new string[128];
  1069. FactionInfo[playerid][fDuty] = 0;
  1070. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
  1071. format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
  1072. SendPDMessage(COLOR_PURPLE, string);
  1073. }
  1074. }
  1075. else
  1076. {
  1077. SendClientMessage(playerid, -1, "Nu esti in vestiar!");
  1078. SetPlayerCheckpoint(playerid, 1884.0470,1232.3463,18.0986);
  1079. }
  1080. }
  1081. else if(FactionInfo[playerid][pFaction] == 4)
  1082. {
  1083. if(IsPlayerInRangeOfPoint(playerid, 20.00, 256.0069,1778.2255,701.0859))
  1084. {
  1085. if(FactionInfo[playerid][fDuty] == 0)
  1086. {
  1087. new nume[MAX_PLAYER_NAME];
  1088. new string[128];
  1089. FactionInfo[playerid][fDuty] = 1;
  1090. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
  1091. format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
  1092. SendNEWSMessage(COLOR_PURPLE, string);
  1093. }
  1094. else if(FactionInfo[playerid][fDuty] == 1)
  1095. {
  1096. new nume[MAX_PLAYER_NAME];
  1097. new string[128];
  1098. FactionInfo[playerid][fDuty] = 0;
  1099. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
  1100. format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
  1101. SendNEWSMessage(COLOR_PURPLE, string);
  1102. }
  1103. }
  1104. else
  1105. {
  1106. SendClientMessage(playerid, -1, "Nu esti in vestiar!");
  1107. SetPlayerCheckpoint(playerid, 256.0069,1778.2255,701.0859);
  1108. }
  1109. }
  1110. else
  1111. {
  1112. return SendClientMessage(playerid, -1, "Nu esti intr-o factiune care dispune de /duty.");
  1113. }
  1114. return 1;
  1115. }
  1116.  
  1117. CMD:enter(playerid, params[])
  1118. {
  1119. if(IsPlayerInRangeOfPoint(playerid, 20.00, -1390.0115,2638.8416,55.9844))
  1120. {
  1121. SetPlayerPos(playerid, 1866.3854,1217.4387,18.0986);
  1122. SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados Sheriff's Departament");
  1123. }
  1124. else if(IsPlayerInRangeOfPoint(playerid, 20.00, -1514.5566,2520.1011,55.9629))
  1125. {
  1126. SetPlayerPos(playerid, 642.9769,-172.3768,1001.2758);
  1127. SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados Medical Center");
  1128. }
  1129. else if(IsPlayerInRangeOfPoint(playerid, 20.00, -1531.0065,2591.9971,55.8359))
  1130. {
  1131. SetPlayerPos(playerid, 248.6405,1783.9126,701.0859);
  1132. SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados News");
  1133. }
  1134. return 1;
  1135. }
  1136.  
  1137. CMD:exit(playerid, params[])
  1138. {
  1139. if(IsPlayerInRangeOfPoint(playerid, 20.00, 1866.3854,1217.4387,18.0986))
  1140. {
  1141. SetPlayerPos(playerid, -1390.0115,2638.8416,55.9844);
  1142. }
  1143. else if(IsPlayerInRangeOfPoint(playerid, 20.00, 642.9769,-172.3768,1001.2758))
  1144. {
  1145. SetPlayerPos(playerid, -1514.5566,2520.1011,55.9629);
  1146. }
  1147. else if(IsPlayerInRangeOfPoint(playerid, 20.00, 248.6405,1783.9126,701.0859))
  1148. {
  1149. SetPlayerPos(playerid, -1531.0065,2591.9971,55.8359);
  1150. }
  1151. return 1;
  1152. }
  1153.  
  1154. CMD:up(playerid, params[])
  1155. {
  1156. if(PlayerInfo[playerid][pDeveloper] != 1) return SendClientMessage(playerid, -1, "{FFFFFF}Nu esti developer!");
  1157. new Float:X, Float:Y, Float:Z;
  1158. GetPlayerPos(playerid, X, Y, Z);
  1159. SetPlayerPos(playerid, X, Y, Z + 2);
  1160. return 1;
  1161. }
  1162. CMD:setadmin(playerid, params[])
  1163. {
  1164. new levels;
  1165. new Nam[MAX_PLAYER_NAME];
  1166. new pname[MAX_PLAYER_NAME];
  1167. new str[128];
  1168. new ID;
  1169. if(PlayerInfo[playerid][pDeveloper] != 1)return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}Nu esti developer.");
  1170. if(sscanf(params,"ui",ID,levels)) return SendClientMessage(playerid,COLOR_PURPLE, " FOLOSESTE: {FFFFFF}/setadmin [Nume sau ID] [Nivel(1-6)]");//it will show this if you dont use the format properly
  1171. if(levels > 6) return SendClientMessage(playerid,COLOR_PURPLE," E!: {FFFFFF}Poti seta numai un nivel de la 1 la 6.");//Available levels
  1172. if(!IsPlayerConnected(ID))return SendClientMessage(playerid,COLOR_PURPLE," E!: {FFFFFF}Utilizatorul selectat nu este conectat.");//Detect if the id/partofname is connected
  1173. if(PlayerInfo[ID][pAdmin] == levels) return SendClientMessage(playerid,COLOR_PURPLE, " E!: {FFFFFF}Persoana selectata are deja acest nivel!");//Detect if the guy is already the level you setted
  1174. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
  1175. GetPlayerName(ID,pname,MAX_PLAYER_NAME);//define the other person name
  1176. if(levels == 0)
  1177. {
  1178. format(str, sizeof(str)," !: {FFFFFF}%s ti-a setat nivelul de administrator la %d.",Nam,levels);
  1179. SendClientMessage(ID,COLOR_PURPLE,str);
  1180. format(str, sizeof(str)," !: {FFFFFF}I-ai setat lui %s nivelul de administrator la %d!",pname,levels);
  1181. SendClientMessage(playerid,COLOR_PURPLE,str);
  1182. PlayerInfo[ID][pAdmin] = levels;//this sets the player level
  1183. return 1;
  1184. }
  1185. format(str, sizeof(str)," !: {FFFFFF}%s ti-a setat nivelul de administrator %d!",Nam,levels);
  1186. SendClientMessage(ID,COLOR_PURPLE,str);
  1187. format(str, sizeof(str)," !: {FFFFFF}I-ai setat lui %s nivelul de administrator la %d!",pname,levels);
  1188. SendClientMessage(playerid,COLOR_PURPLE,str);
  1189. PlayerInfo[ID][pAdmin] = levels;
  1190. return 1;
  1191. }
  1192.  
  1193. CMD:aduty(playerid,params[])
  1194. {
  1195. if(PlayerInfo[playerid][pAdmin] >= 1)
  1196. {
  1197. if(PlayerInfo[playerid][aDuty] == 0)
  1198. {
  1199. new playerName[MAX_PLAYER_NAME];
  1200. new stringulet[128];
  1201. SetPlayerColor(playerid, 0xFFA500);
  1202. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1203. PlayerInfo[playerid][aDuty] = 1;
  1204. format(stringulet, sizeof(stringulet), "{336633}[ADMIN] %s este acum duty!", playerName);
  1205. SendAdminMessage(0xFFFFFFF, stringulet);
  1206. }
  1207. else if(PlayerInfo[playerid][aDuty] == 1)
  1208. {
  1209. new playerName[MAX_PLAYER_NAME];
  1210. new stringuletu[128];
  1211. SetPlayerColor(playerid, COLOR_PURPLE);
  1212. GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
  1213. PlayerInfo[playerid][aDuty] = 0;
  1214. format(stringuletu, sizeof(stringuletu), "{336633}[ADMIN] %s este acum duty!", playerName);
  1215. SendAdminMessage(0xFFFFFFF, stringuletu);
  1216. }
  1217. }
  1218. else
  1219. {
  1220. SendClientMessage(playerid, -1, "Nu esti administrator.");
  1221. }
  1222. return 1;
  1223. }
  1224.  
  1225. CMD:sethp(playerid, params[])
  1226. {
  1227. new ID;
  1228. new str[128];
  1229. new health;
  1230. new Nam[MAX_PLAYER_NAME];
  1231. new pname[MAX_PLAYER_NAME];
  1232. if(sscanf(params,"ui",ID,Float:health)) return SendClientMessage(playerid, 0xFF9900AA, "FOLOSESTE: /setadmin [Nume sau ID] [HP]");
  1233. if(Float:health < 0 || Float:health > 120) return SendClientMessage(playerid, 0xFF9900AA, "Viata trebuie sa fie intre 0 si 120.");
  1234. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF9900AA, "Utilizatorul selectat nu este conectat.");
  1235. GetPlayerName(ID,pname,MAX_PLAYER_NAME);
  1236. GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
  1237. format(str, sizeof(str), "{FFFFFF}%s {FF0000}ti-a setat viata la {FFFFFF}%d.",Nam,health);
  1238. SendClientMessage(ID, COLOR_PURPLE, str);
  1239. format(str, sizeof(str), "{FF0000}I-ai setat lui {FFFFFF}%s {FF0000}viata la {FFFFFF}%d{FF0000}.",pname,health);
  1240. SendClientMessage(playerid, COLOR_PURPLE,str);
  1241.  
  1242. SetPlayerHealth(ID, health);
  1243. return 1;
  1244. }
  1245.  
  1246. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1247. {
  1248. if(IsEQPCar(vehicleid) && PlayerInfo[playerid][pFaction] != 1 && !ispassenger) //checks if the car is a faction car,and checks if the player is not in a faction or is not a passenger
  1249. {
  1250. ClearAnimations(playerid);//if they are a civillian and aren't a passenger it will put them out
  1251. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");//will send them a message telling them only police can access this vehicle
  1252. }
  1253. if(IsEQNVan(vehicleid) && PlayerInfo[playerid][pFaction] != 4 && !ispassenger)
  1254. {
  1255. ClearAnimations(playerid);
  1256. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");
  1257. }
  1258. if(IsEQMSCar(vehicleid) && PlayerInfo[playerid][pFaction] != 2 && !ispassenger)
  1259. {
  1260. ClearAnimations(playerid);
  1261. SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");
  1262. }
  1263. return 1;
  1264. }
  1265.  
  1266. public OnPlayerExitVehicle(playerid, vehicleid)
  1267. {
  1268. return 1;
  1269. }
  1270.  
  1271. public OnPlayerStateChange(playerid, newstate, oldstate)
  1272. {
  1273. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
  1274. {
  1275. new vehicle = GetPlayerVehicleID(playerid);
  1276. if(Engine[vehicle] == 0)
  1277. {
  1278. SendClientMessage(playerid, -1, "Motorul este oprit. Foloseste /engine pentru a-l porni.");
  1279. }
  1280. else if(Engine[vehicle] == 1)
  1281. {
  1282. SendClientMessage(playerid, -1, "Motorul este pornit.");
  1283. }
  1284. }
  1285. return 1;
  1286. }
  1287.  
  1288. public OnPlayerEnterCheckpoint(playerid)
  1289. {
  1290. return 1;
  1291. }
  1292.  
  1293. public OnPlayerLeaveCheckpoint(playerid)
  1294. {
  1295. return 1;
  1296. }
  1297.  
  1298. public OnPlayerEnterRaceCheckpoint(playerid)
  1299. {
  1300. return 1;
  1301. }
  1302.  
  1303. public OnPlayerLeaveRaceCheckpoint(playerid)
  1304. {
  1305. return 1;
  1306. }
  1307.  
  1308. public OnRconCommand(cmd[])
  1309. {
  1310. return 1;
  1311. }
  1312.  
  1313. /*public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
  1314. {
  1315. if(newhealth > 20)
  1316. {
  1317. TogglePlayerControllable(playerid,0);
  1318. new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  1319. Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
  1320. SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
  1321. SetTimerEx("dttimer", 120000, false, "i", playerid);
  1322. PlayerInfo[playerid][DT] = 1;
  1323. PlayerInfo[playerid][DTT] = 1;
  1324. }
  1325. return 1;
  1326. }*/
  1327.  
  1328. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
  1329. {
  1330. new Float:health;
  1331. GetPlayerHealth(playerid, health);
  1332.  
  1333. if(issuerid != INVALID_PLAYER_ID)
  1334. {
  1335. if(health <= 30)
  1336. {
  1337. SetPlayerHealth(playerid, 100);
  1338. TogglePlayerControllable(playerid, false);
  1339.  
  1340. SendClientMessage(playerid, COLOR_PURPLE, "Esti ranit. /acceptdeath in 120 secunde.");
  1341. SetPlayerChatBubble(playerid, "Acest jucator este ranit!", -1, 20.00, -1);
  1342. SetTimerEx("dttimer", 120000, false, "i", playerid);
  1343. PlayerInfo[playerid][DT] = 1;
  1344. PlayerInfo[playerid][DTT] = 1;
  1345. }
  1346. }
  1347.  
  1348. return 1;
  1349. }
  1350.  
  1351. public dttimer(playerid)
  1352. {
  1353. SendClientMessage(playerid, 0xff00000, "Au trecut 120 secunde. Acum poti da /acceptdeath.");
  1354. PlayerInfo[playerid][DTT] = 0;
  1355. }
  1356.  
  1357. public recuperare(playerid)
  1358. {
  1359. TogglePlayerControllable(playerid, true);
  1360. SendClientMessage(playerid, -1, "{FFFFFF}Acum esti bine!");
  1361. SetPlayerHealth(playerid, 100);
  1362. }
  1363.  
  1364. public OnPlayerRequestSpawn(playerid)
  1365. {
  1366. return 1;
  1367. }
  1368.  
  1369. public OnObjectMoved(objectid)
  1370. {
  1371. return 1;
  1372. }
  1373.  
  1374. public OnPlayerObjectMoved(playerid, objectid)
  1375. {
  1376. return 1;
  1377. }
  1378.  
  1379. public OnPlayerPickUpPickup(playerid, pickupid)
  1380. {
  1381. return 1;
  1382. }
  1383.  
  1384. public OnVehicleMod(playerid, vehicleid, componentid)
  1385. {
  1386. return 1;
  1387. }
  1388.  
  1389. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1390. {
  1391. return 1;
  1392. }
  1393.  
  1394. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1395. {
  1396. return 1;
  1397. }
  1398.  
  1399. public OnPlayerSelectedMenuRow(playerid, row)
  1400. {
  1401. return 1;
  1402. }
  1403.  
  1404. public OnPlayerExitedMenu(playerid)
  1405. {
  1406. return 1;
  1407. }
  1408.  
  1409. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1410. {
  1411. return 1;
  1412. }
  1413.  
  1414. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1415. {
  1416. return 1;
  1417. }
  1418.  
  1419. public OnRconLoginAttempt(ip[], password[], success)
  1420. {
  1421. return 1;
  1422. }
  1423.  
  1424. public OnPlayerUpdate(playerid)
  1425. {
  1426. return 1;
  1427. }
  1428.  
  1429. public OnPlayerStreamIn(playerid, forplayerid)
  1430. {
  1431. return 1;
  1432. }
  1433.  
  1434. public OnPlayerStreamOut(playerid, forplayerid)
  1435. {
  1436. return 1;
  1437. }
  1438.  
  1439. public OnVehicleStreamIn(vehicleid, forplayerid)
  1440. {
  1441. return 1;
  1442. }
  1443.  
  1444. public OnVehicleStreamOut(vehicleid, forplayerid)
  1445. {
  1446. return 1;
  1447. }
  1448.  
  1449. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1450. {
  1451. return 1;
  1452. }
  1453.  
  1454. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1455. {
  1456. return 1;
  1457. }
  1458.  
  1459. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  1460. {
  1461. if(IsPlayerConnected(playerid))
  1462. {
  1463. new Float:posx, Float:posy, Float:posz;
  1464. new Float:oldposx, Float:oldposy, Float:oldposz;
  1465. new Float:tempposx, Float:tempposy, Float:tempposz;
  1466. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1467. for(new i = 0; i < MAX_PLAYERS; i++)
  1468. {
  1469. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  1470. {
  1471. GetPlayerPos(i, posx, posy, posz);
  1472. tempposx = (oldposx -posx);
  1473. tempposy = (oldposy -posy);
  1474. tempposz = (oldposz -posz);
  1475. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  1476. {
  1477. SendClientMessage(i, col1, string);
  1478. }
  1479. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  1480. {
  1481. SendClientMessage(i, col2, string);
  1482. }
  1483. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  1484. {
  1485. SendClientMessage(i, col3, string);
  1486. }
  1487. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  1488. {
  1489. SendClientMessage(i, col4, string);
  1490. }
  1491. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1492. {
  1493. SendClientMessage(i, col5, string);
  1494. }
  1495. }
  1496. else
  1497. {
  1498. SendClientMessage(i, col1, string);
  1499. }
  1500. }
  1501. }
  1502. return 1;
  1503. }
  1504.  
  1505. forward BanExPublic(playerid, reason[]);
  1506.  
  1507. public BanExPublic(playerid, reason[])
  1508. {
  1509. BanEx(playerid, reason);
  1510. }
  1511. stock BanExWithMessage(playerid, color, message[], reason[])
  1512. {
  1513. SendClientMessage(playerid, color, message);
  1514. SetTimerEx("BanExPublic", 1000, false, "ds", playerid, reason);
  1515. }
  1516.  
  1517. stock SendPDMessage(col, string[])
  1518. {
  1519. for(new i = 0; i < MAX_PLAYERS; i++)
  1520. {
  1521. if(PlayerInfo[i][pFaction] == 1)
  1522. SendClientMessage(i, col, string);
  1523. }
  1524. return 1;
  1525. }
  1526. stock SendAdminMessage(col, string[])
  1527. {
  1528. for(new i = 0; i < MAX_PLAYERS; i++)
  1529. {
  1530. if(PlayerInfo[i][pAdmin] >= 1)
  1531. SendClientMessage(i, col, string);
  1532. }
  1533. return 1;
  1534. }
  1535. stock SendFDMessage(col, string[])
  1536. {
  1537. for(new i = 0; i < MAX_PLAYERS; i++)
  1538. {
  1539. if(PlayerInfo[i][pFaction] == 2)
  1540. SendClientMessage(i, col, string);
  1541. }
  1542. return 1;
  1543. }
  1544. stock SendGOVMessage(col, string[])
  1545. {
  1546. for(new i = 0; i < MAX_PLAYERS; i++)
  1547. {
  1548. if(PlayerInfo[i][pFaction] == 3)
  1549. SendClientMessage(i, col, string);
  1550. }
  1551. return 1;
  1552. }
  1553. stock SendNEWSMessage(col, string[])
  1554. {
  1555. for(new i = 0; i < MAX_PLAYERS; i++)
  1556. {
  1557. if(PlayerInfo[i][pFaction] == 4)
  1558. SendClientMessage(i, col, string);
  1559. }
  1560. return 1;
  1561. }
  1562.  
  1563. stock IsEQPCar(vehicleid)
  1564. {
  1565. switch(GetVehicleModel(vehicleid))
  1566. {
  1567. case 523,427,528,596,598,597,599,601,497,430: return 1; //checks if the vehicle id is a faction restricted vehicle
  1568. }
  1569. return 0;
  1570. }
  1571.  
  1572. stock IsEQNVan(vehicleid)
  1573. {
  1574. switch(GetVehicleModel(vehicleid))
  1575. {
  1576. case 582: return 1;
  1577. }
  1578. return 0;
  1579. }
  1580.  
  1581. stock IsEQMSCar(vehicleid)
  1582. {
  1583. switch(GetVehicleModel(vehicleid))
  1584. {
  1585. case 482,416: return 1;
  1586. }
  1587. return 0;
  1588. }
  1589.  
  1590. Dialog:DIALOG_LOGIN(playerid, response, listitem, inputtext[])
  1591. {
  1592. if (!response)
  1593. return Kick(playerid);
  1594.  
  1595.  
  1596. new password[64];
  1597. SHA256_PassHash(inputtext, PASSWORD_SALT, password, sizeof (password));
  1598.  
  1599.  
  1600. if (strcmp(PlayerInfo[playerid][pPass], password))
  1601. {
  1602. incercari[playerid]++;
  1603.  
  1604. new str[150];
  1605. format(str, sizeof (str), "Parola incorecta. Au mai ramas %i/%i incercari.", incercari[playerid], MAX_LOGIN_ATTEMPTS);
  1606. SendClientMessage(playerid, 0xFFFFFFFF, str);
  1607.  
  1608. if (incercari[playerid] >= MAX_LOGIN_ATTEMPTS)
  1609. return Kick(playerid);
  1610.  
  1611. return Dialog_Show(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{FF6633}MAIN-ROLEPLAY", "{FFFFFF}Trebuie sa te loghezi pentru a continua sa te joci pe server. Introdu-ti mai jos parola.", "JOIN", "IESI");
  1612. }
  1613.  
  1614.  
  1615. new nume[MAX_PLAYER_NAME];
  1616. GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
  1617.  
  1618. new str[150];
  1619. format(str, sizeof (str), "----- {FF6633}%s {FFFFFF}-----", nume);
  1620. SendClientMessage(playerid, 0xFFFFFFFF, str);
  1621.  
  1622. ResetPlayerMoney(playerid);
  1623. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  1624.  
  1625. new ip[18];
  1626. GetPlayerIp(playerid, ip, sizeof (ip));
  1627.  
  1628. DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
  1629. "IP", STRING, ip);
  1630. return 1;
  1631. }
  1632.  
  1633. Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
  1634. {
  1635. if (!response)
  1636. return Kick(playerid);
  1637.  
  1638. if (!inputtext[0] || inputtext[0] == ' ')
  1639. {
  1640. SendClientMessage(playerid, 0xFFFFFFFF, "Parola nu se potriveste, nu poate fi lasata goala.");
  1641.  
  1642. return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{FF3366}MAIN-ROLEPLAY", "{FFFFFF}Bine ai venit pe "SERVER_NAME"!\nIntrodu-ti parola mai jos.", "CONTINUA", "IESI");
  1643. }
  1644.  
  1645. new len = strlen(inputtext);
  1646. if (len > MAX_PASSWORD_LENGTH || len < MIN_PASSWORD_LENGTH)
  1647. {
  1648. new str[150];
  1649. format(str, sizeof (str), "Parola trebuie sa fie intre %i si %i caractere.", MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH);
  1650. SendClientMessage(playerid, 0xFFFFFFFF, str);
  1651.  
  1652. return Dialog_Show(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{FF3366}MAIN-ROLEPLAY", "{FFFFFF}Bine ai venit pe "SERVER_NAME"!\nIntrodu-ti parola mai jos.", "CONTINUA", "IESI");
  1653. }
  1654.  
  1655. SHA256_PassHash(inputtext, PASSWORD_SALT, PlayerInfo[playerid][pPass], 64);
  1656.  
  1657. new name[MAX_PLAYER_NAME];
  1658. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  1659.  
  1660. new str[150];
  1661. format(str, sizeof (str), "----- {FF3366}%s {FFFFFF}-----", name);
  1662. SendClientMessage(playerid, 0xFFFFFFFF, str);
  1663.  
  1664. new ip[18];
  1665. GetPlayerIp(playerid, ip, sizeof (ip));
  1666.  
  1667. DB::CreateRow("Utilizatori",
  1668. "Nume", STRING, name,
  1669. "Parola", STRING, PlayerInfo[playerid][pPass],
  1670. "IP", STRING, ip,
  1671. "Admin", INTEGER, PlayerInfo[playerid][pAdmin],
  1672. "Tester", INTEGER, PlayerInfo[playerid][pTester],
  1673. "Developer", STRING, PlayerInfo[playerid][pDeveloper]);
  1674.  
  1675. DB::Fetch("Utilizatori", _, _, _, "`Nume` = '%q'", name);
  1676. PlayerInfo[playerid][pSQLID] = fetch_row_id();
  1677. fetcher_close();
  1678.  
  1679. return 1;
  1680. }
Add Comment
Please, Sign In to add comment