Guest User

help PLS

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