Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <YSI\y_ini.inc>
- #include <ZCMD>
- #include <sscanf2>
- #include <a_mysql>
- #include <easydb>
- #include <easydialog>
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define SERVER_NAME "Main Roleplay"
- #define PASSWORD_SALT "334t!t>D<QW**@!)#$>C_)_AAgddh"
- #define MAX_LOGIN_ATTEMPTS (3)
- #define MIN_PASSWORD_LENGTH (5)
- #define MAX_PASSWORD_LENGTH (45)
- #define ENABLE_CONSOLE_MESSAGES
- #define COL_WHITE "{FFFFFF}"
- #define COL_LIGHTBLUE "{00CED1}"
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_ORANGE "{FFA500}"
- #define COLOR_RED 0xFF0000AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_CYAN 0x00FFFFFF
- #define COLOR_PDRAD 0x297CCFFF
- new Engine[MAX_VEHICLES];
- new Lights[MAX_VEHICLES];
- enum pInfo
- {
- pSQLID,
- pPass,
- pCash,
- pAdmin,
- pTester,
- pFaction,
- pLeader,
- pDeveloper,
- pKills,
- pDeaths,
- DT,
- DTT,
- ADT
- }
- enum fInfo
- {
- fLeader,
- fRank,
- fCar,
- fRanks,
- fGov,
- fDuty
- }
- enum aInfo
- {
- aDuty,
- aLevel
- }
- enum cInfo
- {
- cLocked,
- cOwner,
- cSpawned,
- cAlarm,
- cColor,
- cEngine,
- cLights,
- Avariat
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new FactionInfo[MAX_PLAYERS][fInfo];
- new CarInfo[MAX_PLAYERS][cInfo];
- new incercari[MAX_PLAYERS];
- forward dttimer(playerid);
- forward recuperare(playerid);
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- forward OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth);
- new Text:spawntextdraw;
- main()
- {
- print("\n----------------------------------");
- print(" MAIN ROLEPLAY NETWORK 0.1 [BETA] ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Main-RP 0.1[BETA]");
- spawntextdraw = TextDrawCreate(10.0, 240.0, "[BETA] Trebuie sa apesi pe 'Spawn' sa te spawnezi!");
- TextDrawFont(spawntextdraw, 2);
- TextDrawColor(spawntextdraw, 0xFFFFFFFF);
- DisableInteriorEnterExits();
- EnableStuntBonusForAll(0);
- DB::Init("main-rp database");
- DB::VerifyTable("Utilizatori", "ID", false,
- "Nume", STRING,
- "Parola", STRING,
- "IP", STRING,
- "Kills", INTEGER,
- "Deaths", INTEGER,
- "Cash", INTEGER,
- "Developer", INTEGER,
- "Admin", INTEGER,
- "Tester", INTEGER,
- "Lider", STRING,
- "Rank", STRING,
- "Factiune", STRING,
- "Viata", FLOAT);
- new eqpdpickup[2];
- new eqmcpickup[2];
- new eqnpickup[2];
- new vestiare[3];
- eqpdpickup[0] = CreatePickup(1318, 0, -1390.0115,2638.8416,55.9844, 0);
- eqpdpickup[1] = CreatePickup(1318, 0, 1866.3854,1217.4387,18.0986, 0);
- eqmcpickup[0] = CreatePickup(1318, 0, -1514.5566,2520.1011,55.9629, 0);
- eqmcpickup[1] = CreatePickup(1318, 0, 642.9769,-172.3768,1001.2758, 0);
- eqnpickup[0] = CreatePickup(1318, 0, -1531.0065,2591.9971,55.8359, 0);
- eqnpickup[1] = CreatePickup(1318, 0, 248.6405,1783.9126,701.0859, 0);
- vestiare[0] = CreatePickup(1318, 0, 643.6490,-165.0781,1001.2758, 0);
- vestiare[1] = CreatePickup(1318, 0, 1884.0470,1232.3463,18.0986, 0);
- vestiare[2] = CreatePickup(1318, 0, 256.0069,1778.2255,701.0859, 0);
- Create3DTextLabel("{FFFFFF}El Quebrados Sheriff's Departament", -1, -1390.0115, 2638.8416, 55.9844, 50.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 1866.3854,1217.4387,18.0986, 20.00, 0, 0);
- Create3DTextLabel("{FFFFFF}El Quebrados Medical Center", -1, -1514.5566,2520.1011,55.9629, 20.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 642.9769,-172.3768,1001.2758, 20.00, 0, 0);
- Create3DTextLabel("{FFFFFF}El Quebrados News", -1, -1531.0065,2591.9971,55.8359, 20.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Iesire[EXIT]", -1, 248.6405,1783.9126,701.0859, 20.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Vestiar", -1, 256.0069,1778.2255,701.0859, 5.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Vestiar", -1, 1884.0470,1232.3463,18.0986, 5.00, 0, 0);
- Create3DTextLabel("{FFFFFF}Vestiar", -1, 643.6490,-165.0781,1001.2758, 5.00, 0, 0);
- ManualVehicleEngineAndLights();
- return 1;
- }
- public OnGameModeExit()
- {
- DB::Exit();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- incercari[playerid] = 0;
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- DB::Fetch("Utilizatori", _, _, _, "`Nume` = '%q'", nume);
- if (fetch_rows_count() > 0)
- {
- PlayerInfo[playerid][pSQLID] = fetch_row_id();
- fetch_string("Password", PlayerInfo[playerid][pPass], 64);
- PlayerInfo[playerid][pKills] = fetch_int("Kills");
- PlayerInfo[playerid][pDeaths] = fetch_int("Deaths");
- PlayerInfo[playerid][pCash] = fetch_int("Bani");
- PlayerInfo[playerid][pDeveloper] = fetch_int("Developer");
- PlayerInfo[playerid][pTester] = fetch_int("Tester");
- PlayerInfo[playerid][pAdmin] = fetch_int("Admin");
- PlayerInfo[playerid][pLeader] = fetch_int("Lider");
- FactionInfo[playerid][fRank] = fetch_int("Rank");
- 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");
- }
- else
- {
- PlayerInfo[playerid][pSQLID] = -1;
- PlayerInfo[playerid][pPass] = EOS;
- PlayerInfo[playerid][pKills] = 0;
- PlayerInfo[playerid][pDeaths] = 0;
- PlayerInfo[playerid][pCash] = 0;
- PlayerInfo[playerid][pDeveloper] = 0;
- PlayerInfo[playerid][pTester] = 0;
- PlayerInfo[playerid][pAdmin] = 0;
- PlayerInfo[playerid][pLeader] = 0;
- FactionInfo[playerid][fRank] = 0;
- 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");
- }
- fetcher_close();
- RemoveBuildingForPlayer(playerid, 8489, 1932.7813, 1177.3984, 39.9219, 0.25);
- RemoveBuildingForPlayer(playerid, 8700, 1932.7813, 1177.3984, 39.9219, 0.25);
- RemoveBuildingForPlayer(playerid, 9121, 1944.8047, 1183.9141, 18.9531, 0.25);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
- "Kills", INTEGER, PlayerInfo[playerid][pKills],
- "Deaths", INTEGER, PlayerInfo[playerid][pDeaths],
- "Developer", INTEGER, PlayerInfo[playerid][pDeveloper],
- "Bani", INTEGER, GetPlayerMoney(playerid),
- "Admin", INTEGER, PlayerInfo[playerid][pAdmin],
- "Tester", INTEGER, PlayerInfo[playerid][pTester],
- "Factiune", INTEGER, PlayerInfo[playerid][pFaction],
- "Rank", INTEGER, FactionInfo[playerid][fRank],
- "Lider", INTEGER, PlayerInfo[playerid][pLeader]);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawHideForPlayer(playerid, spawntextdraw);
- if(PlayerInfo[playerid][ADT] == 1)
- {
- SetPlayerPos(playerid, 670.1275,-185.6758,1001.9141);
- SendClientMessage(playerid, -1, "{FFFFFF}TE RECUPEREZI...");
- TogglePlayerControllable(playerid, false);
- SetTimer("recuperare", 6000, false);
- PlayerInfo[playerid][ADT] = 0;
- }
- else
- {
- SetPlayerPos(playerid, -1534.6560,2645.2664,55.8359);
- }
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(!success) SendClientMessage(playerid, COLOR_PURPLE, ""SERVER_NAME": {FFFFFF}Comanda necunoscuta. Foloseste [/help] pentru comenzi.");
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[playerid][pDeaths]++; // increase player's deaths count
- if (killerid != INVALID_PLAYER_ID)
- PlayerInfo[killerid][pKills]++; // increase killer's kills count if the id is of a connected player
- PlayerInfo[playerid][ADT] = 1;
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- Engine[vehicleid] = 0;
- Lights[vehicleid] = 0;
- return 1;
- }
- public OnVehicleDamageStatusUpdate(vehicleid, playerid)
- {
- new viata = GetVehicleHealth(vehicleid);
- new vehicle = GetPlayerVehicleID(playerid);
- if(viata < 310)
- {
- new lights, alarm, doors, bonnet, boot, objective, engine;
- SetVehicleParamsForPlayer(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
- SendClientMessage(playerid, COLOR_RED, "Vehiculul tau este avariat. Nu mai functioneaza.");
- CarInfo[vehicle][Avariat] = 1;
- }
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- /*if(strfind(text, "?", true) != -1)
- {
- new msg[128];
- format(msg, sizeof(msg), "{FFFFFF}%s intreaba: %s", nume, text);
- ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
- }
- if(strfind(text, "!", true) != -1)
- {
- new msg[128];
- format(msg, sizeof(msg), "{FFFFFF}%s striga: %s", nume, text);
- ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
- }*/
- new msg[128];
- format(msg, sizeof(msg), "{FFFFFF}%s spune: %s", nume, text);
- ProxDetector(50.0, playerid, msg, -1,-1,-1,-1,-1);
- return 0;
- }
- CMD:acceptdeath(playerid, params[]) {
- if(PlayerInfo[playerid][DT] != 1)
- return SendClientMessage(playerid, -1, "Nu esti in deathtimer!");
- if(PlayerInfo[playerid][DTT] != 1) return SendClientMessage(playerid, -1, "Nu au trecut 120 secunde!");
- SetPlayerPos(playerid,317.2694,54.9657,3.3750);
- SendClientMessage(playerid, COLOR_PURPLE, " ?: {FFFFFF}Un medic care nu era la datorie te-a gasit si te-a dus la el acasa.");
- SendClientMessage(playerid, COLOR_PURPLE, " ?: {FFFFFF}Acolo ti-a oferit primul ajutor iar acum te simti bine!");
- TogglePlayerControllable(playerid, 1);
- PlayerInfo[playerid][DT] = 0;
- PlayerInfo[playerid][ADT] = 1;
- return 1;
- }
- CMD:me(playerid, params[]) {
- 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.
- GetPlayerName(playerid, pname, sizeof(pname));
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /me [text]");
- format(string, sizeof(string), "%s %s", pname, text);
- ProxDetector(50.00,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- CMD:do(playerid, params[]) {
- 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.
- GetPlayerName(playerid, pname, sizeof(pname));
- if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /do [text]");
- format(string, sizeof(string), "%s (( %s ))", text, pname);
- ProxDetector(50.00,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- return 1;
- }
- CMD:changepass(playerid, params[])
- {
- new password[64];
- if (sscanf(params, "s[64]", password))
- return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /changepass [parola noua]");
- // check password's length
- new len = strlen(password);
- if (len > MAX_PASSWORD_LENGTH || len < MIN_PASSWORD_LENGTH)
- {
- new str[150];
- format(str, sizeof (str), "Parola invalida. Caractele sunt intre %i si %i.", MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH);
- return SendClientMessage(playerid, 0xFFFFFFFF, str);
- }
- // hashing the password
- SHA256_PassHash(password, PASSWORD_SALT, PlayerInfo[playerid][pPass], 64);
- // update player's password
- DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
- "Parola", STRING, PlayerInfo[playerid][pPass]);
- return SendClientMessage(playerid, 0xFFFFFFFF, "Parola schimbata!");
- }
- CMD:fkick(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 6)//Replace this with your player variable
- {
- new targetid;//establishes a person on the server to use the command on
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_CYAN, "/fackick [id]");//tells you how to use the command if you use it incorrectly
- if(targetid != INVALID_PLAYER_ID)//checks if the id you type in is an id that is not connected to the server
- {
- PlayerInfo[targetid][pFaction] = 0; //kicks the player from his faction
- FactionInfo[targetid][fRank] = 0;//sets his rank to 0
- PlayerInfo[targetid][pLeader] = 0;// revokes his leadership status
- 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.
- }
- }
- else//if they arent an admin then it will send them they message below telling them they may not use the command
- {
- SendClientMessage(playerid, COLOR_CYAN, "Nu esti autorizat.");
- }
- return 1;
- }
- CMD:setleader(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 6)
- {
- new targetid, facid;
- 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
- if(targetid != INVALID_PLAYER_ID)
- {
- PlayerInfo[targetid][pFaction] = facid;
- PlayerInfo[targetid][fRank] = 1;
- PlayerInfo[targetid][pLeader] = facid;
- if(facid == 1)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQPD!");
- }
- else if(facid == 2)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQFD!");
- }
- else if(facid == 3)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca primar!");
- }
- else if(facid == 4)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider EQN!");
- }
- else if(facid == 5)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG1!");
- }
- else if(facid == 6)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG2!");
- }
- else if(facid == 7)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG3!");
- }
- else if(facid == 8)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider GANG4!");
- }
- else if(facid == 9)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE1!");
- }
- else if(facid == 10)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE2!");
- }
- else if(facid == 11)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE3!");
- }
- else if(facid == 12)
- {
- SendClientMessage(targetid, COLOR_CYAN, "Ai fost promovat de un admin ca lider MAFIE4!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_CYAN, "Nu esti autorizat.");
- }
- return 1;
- }
- CMD:finvite(playerid, params[])
- {
- if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)
- {
- new tarid, facid;
- new string[128];
- if(sscanf(params, "u", tarid)) return SendClientMessage(playerid, COLOR_CYAN, "> !: /invite [playerid]");
- facid = PlayerInfo[playerid][pFaction];
- SetPVarInt(tarid, "invitefac", facid);
- format(string, sizeof(string), "Ai fost invitat in factiunea cu id-ul %s. Pentru a te alatura, /acceptfaction.", PlayerInfo[playerid][pFaction]);
- SendClientMessage(tarid, COLOR_CYAN, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_CYAN, "Nu ai autoritate necesara.");
- }
- return 1;
- }
- CMD:acceptinvite(playerid, params[])
- {
- new facid, string[128];
- facid = GetPVarInt(playerid, "invitefac");
- PlayerInfo[playerid][pFaction] = facid;
- if(PlayerInfo[playerid][pFaction] == 1)
- {
- FactionInfo[playerid][fRank] = 14;
- }
- else if(PlayerInfo[playerid][pFaction] == 2)
- {
- FactionInfo[playerid][fRank] = 15;
- }
- else if(PlayerInfo[playerid][pFaction] == 3)
- {
- FactionInfo[playerid][fRank] = 2;
- }
- format(string, sizeof(string), "> Ai acceptat invitatia factiunii %d.", facid);//tells the player they have accepted the faction invite
- SendClientMessage(playerid, COLOR_CYAN, string);//shows the above message in the color of CYAN
- DeletePVar(playerid, "invitefac");//deletes the saved invite
- return 1;
- }
- CMD:uninvite(playerid,params[])
- {
- if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)
- {
- new targetid;
- 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.
- if(targetid != INVALID_PLAYER_ID)
- {
- PlayerInfo[targetid][pFaction] = 0;
- PlayerInfo[targetid][fRank] = 0;
- PlayerInfo[targetid][pLeader] = 0;
- 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.
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_CYAN, "Nu esti in factiune/Nu ai rankul necesar!");
- }
- return 1;
- }
- CMD:giverank(playerid, params[])
- {
- if(PlayerInfo[playerid][pLeader] > 0 || FactionInfo[playerid][fRank] == 2)//checks if the player is high enough rank
- {
- 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.
- if(sscanf(params, "ui", targetid, rank)) return SendClientMessage(playerid, COLOR_CYAN, "Usage: /giverank [playerid][rank]");//checks if the command was typed correctly
- 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.
- 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.
- if(PlayerInfo[playerid][pFaction] == 1)
- {
- if(rank < 2 || rank > 17)
- {
- SendClientMessage(playerid, COLOR_CYAN,"Rank-urile trebuie sa fie de la 2 la 16");
- SendClientMessage(playerid, COLOR_CYAN,"Rank 15 reprezinta membru academie, iar 16 suspendat.");
- return 1;
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 2)
- {
- if(rank < 2 || rank > 17)
- {
- SendClientMessage(playerid, COLOR_CYAN,"Rank-urile trebuie sa fie de la 2 la 17.");
- SendClientMessage(playerid, COLOR_CYAN,"Rank 16 reprezinta un membru academie, iar 17 suspendat.");
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 3)
- {
- if(rank < 2 || rank > 2)
- {
- SendClientMessage(playerid, COLOR_CYAN,"Nu detii dreptul de a da rank-uri.");
- SendClientMessage(playerid, COLOR_CYAN,"Rank 2 este intotdeauna un administrator.");
- }
- }
- PlayerInfo[targetid][fRank] = rank;//sets the players rank to the rank you choose
- format(string, sizeof(string), "Rank-ul tau a fost setat la %d!", rank);
- SendClientMessage(targetid, COLOR_GREEN, string);//states that the players rank was changed
- }
- else //if the player is not the correct rank it will display this message below
- {
- SendClientMessage(playerid, COLOR_CYAN, "Nu esti intr-o factiune / nu ai rank-ul necesar.");
- }
- return 1;
- }
- CMD:f(playerid, params[]) return cmd_faction(playerid, params);
- CMD:faction(playerid, params[])
- {
- 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.
- GetPlayerName(playerid, pname, sizeof(pname));//gets the name of the player using /radio
- 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
- if(PlayerInfo[playerid][pFaction] == 1)//checks if the player is in the first faction
- {
- if(PlayerInfo[playerid][pLeader] == 1)
- {
- format(string, sizeof(string), "(( Chief of Police %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);//calls a stock below that checks who the /r should be sent to
- }
- else if(FactionInfo[playerid][fRank] == 2)
- {
- format(string, sizeof(string), "(( ACOP %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 3)
- {
- format(string, sizeof(string), "(( DCOP %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 4)
- {
- format(string, sizeof(string), "(( Lieutenant %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 5)
- {
- format(string, sizeof(string), "(( Captain %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 6)
- {
- format(string, sizeof(string), "(( Commander %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 7)
- {
- format(string, sizeof(string), "(( SGT II %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 8)
- {
- format(string, sizeof(string), "(( SGT I %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 9)
- {
- format(string, sizeof(string), "(( DIII %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 10)
- {
- format(string, sizeof(string), "(( DII %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 11)
- {
- format(string, sizeof(string), "(( DI %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 12)
- {
- format(string, sizeof(string), "(( LIO %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 13)
- {
- format(string, sizeof(string), "(( PO III %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 14)
- {
- format(string, sizeof(string), "(( PO II %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 15)
- {
- format(string, sizeof(string), "(( PO I %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 16)
- {
- format(string, sizeof(string), "(( A. Student %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 17)
- {
- format(string, sizeof(string), "(( Suspendat %s: %s ))", pname, text);
- SendPDMessage(COLOR_CYAN, string);
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 2)
- {
- if(FactionInfo[playerid][fRank] == 1)
- {
- format(string, sizeof(string), "(( Comissioner %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 2)
- {
- format(string, sizeof(string), "(( Deputy Commissioner %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 3)
- {
- format(string, sizeof(string), "(( Division Chief %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 4)
- {
- format(string, sizeof(string), "(( Battalion Chief %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 5)
- {
- format(string, sizeof(string), "(( Captain %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 6)
- {
- format(string, sizeof(string), "(( Chief of Medicine %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 7)
- {
- format(string, sizeof(string), "(( Lieutenant %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 8)
- {
- format(string, sizeof(string), "(( Lead Paramedic %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 9)
- {
- format(string, sizeof(string), "(( Attending Physician %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 10)
- {
- format(string, sizeof(string), "(( EMT %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 11)
- {
- format(string, sizeof(string), "(( Paramedic %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 12)
- {
- format(string, sizeof(string), "(( First Responder %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 13)
- {
- format(string, sizeof(string), "(( Firefighter II %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 14)
- {
- format(string, sizeof(string), "(( Firefighter I %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 15)
- {
- format(string, sizeof(string), "(( PF %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 16)
- {
- format(string, sizeof(string), "(( Academy Student %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 17)
- {
- format(string, sizeof(string), "(( Suspendat %s: %s ))", pname, text);
- SendFDMessage(COLOR_CYAN, string);
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 3)
- {
- if(FactionInfo[playerid][fRank] == 1)
- {
- format(string, sizeof(string), "(( Governor %s: %s ))", pname, text);
- SendGOVMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 2)
- {
- format(string, sizeof(string), "(( Parlamentar %s: %s ))", pname, text);
- SendGOVMessage(COLOR_CYAN, string);
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 4)
- {
- if(FactionInfo[playerid][fRank] == 1)
- {
- format(string, sizeof(string), "(( Network Chief %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 2)
- {
- format(string, sizeof(string), "(( General Director %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 3)
- {
- format(string, sizeof(string), "(( Director %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 4)
- {
- format(string, sizeof(string), "(( Publisher %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 5)
- {
- format(string, sizeof(string), "(( Network IT'st %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- else if(FactionInfo[playerid][fRank] == 6)
- {
- format(string, sizeof(string), "(( Newspaper Deep %s: %s ))", pname, text);
- SendNEWSMessage(COLOR_CYAN, string);
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 0)//if the player is not in a faction it will not send him any messages
- {
- return 1;
- }
- return 1;
- }
- CMD:credite(playerid, params[]) {
- SendClientMessage(playerid, -1, "{FFFFFF}Oferim respect tuturor script-urilor ce ne-au ajutat, asa ca o sa lasam jos tot ce am 'imprumutat'.");
- SendClientMessage(playerid, -1, "{FF0000}*~ {FFFFFF}ObjectMap - sistem de mapping pe server, editat putin de noi. #Drebin");
- SendClientMessage(playerid, -1, "{FFFFFF}Tot ce nu apare mai sus, este creeat de catre noi, fara 'imprumuturi'");
- return 1;
- }
- CMD:help(playerid, params[]) {
- SendClientMessage(playerid, -1, "{FFFFFF}[ROLEPLAY]: /ame, /me, /do, /shout");
- SendClientMessage(playerid, -1, "{FFFFFF}[MASINI:GENERAL]: /engine, /seatbelt, /lights, /alarm, /p(hone)car");
- SendClientMessage(playerid, -1, "{FFFFFF}[TELEFON]: /phone, /call, /sms, /contacts");
- SendClientMessage(playerid, -1, "{FFFFFF}[SCRIPT-WISE]: /tie, /maskon, /myclothes");
- SendClientMessage(playerid, -1, "{FFFFFF}[CONT]: /stats, /changepassword");
- SendClientMessage(playerid, -1, "{FFFFFF}[ITEME]: /bag, /wallet");
- SendClientMessage(playerid, -1, "{FFFFFF}[ARME]: /toaca, /reload, /giveweapon, /acceptweapon");
- SendClientMessage(playerid, -1, "{FFFFFF}[ANIMURI]: /animlist");
- SendClientMessage(playerid, -1, "{FFFFFF}[CURIER]: /incepe, /livreaza");
- SendClientMessage(playerid, -1, "{FFFFFF}[HCURIER]: /incepe, /prinde, /livreaza");
- SendClientMessage(playerid, -1, "{FFFFFF}[NEWSPAPER]: /incepe, /arunca");
- SendClientMessage(playerid, -1, "{FFFFFF}[DROGURI]: /duse, /dgive, /dplant");
- if(PlayerInfo[playerid][pFaction] == 1)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /taser, /cuff, /uncuff, /freeze[DOAR PRIN RP]");
- SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /radio, /d(epartamental), /gov(doar rank inalt)");
- SendClientMessage(playerid, -1, "{FFFFFF}[EQPD]: /jail, /unjail, /law, /units, /su, /mdc");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- SendClientMessage(playerid, -1, "{FFFFFF}// Esti politist, te ocupi cu protejarea satului.");
- }
- else if(PlayerInfo[playerid][pFaction] == 2)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /heal, /cure, /hpc, /ghinsurance, /r");
- SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /entergarage, /exitgarage, /gov(doar rank inalt)");
- SendClientMessage(playerid, -1, "{FFFFFF}[EQMS]: /d(epartamental)");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- SendClientMessage(playerid, -1, "{FFFFFF}// Esti medic, te ocupi cu salvarea oamenilor, prin roleplay + comenzi.");
- }
- else if(PlayerInfo[playerid][pFaction] == 3)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[GOVERNOR]: /government, /su, /departamental");
- SendClientMessage(playerid, -1, "{FFFFFF}[GOVERNOR]: /t(axa)s(omari)");
- SendClientMessage(playerid, -1, "{FFFFFF}// Esti primar, nu exista foarte multe comenzi, rolezi in general.");
- SendClientMessage(playerid, -1, "{FFFFFF}// Te ocupi de satul El Quebrados, si nu ai membrii in factiune.");
- }
- else if(PlayerInfo[playerid][pFaction] == 4)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[EQN]: /news, /live");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- SendClientMessage(playerid, -1, "{FFFFFF}// Esti reporter. Te ocupi cu reportaje la TV/radio etc.[/news] si cu dezvaluiri in direct la TV [/live]");
- SendClientMessage(playerid, -1, "{FFFFFF}// Live este asemanator cu news la structura, dar live se foloseste la reportaje, NUMAI la TV.");
- }
- else if(PlayerInfo[playerid][pFaction] == 5)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[GANG1]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
- }
- else if(PlayerInfo[playerid][pFaction] == 6)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[GANG2]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
- }
- else if(PlayerInfo[playerid][pFaction] == 7)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[GANG3]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
- }
- else if(PlayerInfo[playerid][pFaction] == 8)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[GANG4]: /tie, /buymats, /creategun, /buydrugs, /buyseeds");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- SendClientMessage(playerid, -1, "{FFFFFF}// Armele si drogurile procurate de gangsteri sunt de slaba calitate IC.");
- }
- else if(PlayerInfo[playerid][pFaction] == 9)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE1]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- }
- else if(PlayerInfo[playerid][pFaction] == 10)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE2]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- }
- else if(PlayerInfo[playerid][pFaction] == 11)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE3]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- }
- else if(PlayerInfo[playerid][pFaction] == 12)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[MAFIE4]: /tie, /mask, /buymats, /creategun, /buyseeds, /buydrugs, /buyweapon");
- SendClientMessage(playerid, -1, "{FFFFFF}[FOFI]: /f, /fchat(rank inalt)");
- 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.");
- }
- if(PlayerInfo[playerid][pLeader] == 1) // lider guvernamentale
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 2)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 3)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /gov, /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 4) // san news
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 5) // gang/mafie
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 6)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 7)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 8)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 9)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 10)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 11)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- else if(PlayerInfo[playerid][pLeader] == 12)
- {
- SendClientMessage(playerid, -1, "{FFFFFF}[OLEADER]: /fchat, /invite, /kick");
- }
- return 1;
- }
- CMD:engine(playerid, params[]) {
- if(GetPlayerState(playerid) == 2)
- {
- new vehicle = GetPlayerVehicleID(playerid);
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- new string[128];
- if(CarInfo[vehicle][Avariat] != 1)
- {
- if(Engine[vehicle] == 0)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
- Engine[vehicle] = 1;
- SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
- format(string, sizeof(string), "%s intoarce cheia si porneste motorul masinii.", nume);
- ProxDetector(20.00, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else if(Engine[vehicle] == 1)
- {
- new engine, lights, alarm, doors, bonnet, boot, objective;
- GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
- Engine[vehicle] = 0;
- SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
- format(string, sizeof(string), "%s intoarce cheia si opreste motorul masinii.", nume);
- ProxDetector(20.00, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Vehiculul este avariat.");
- }
- }
- else return SendClientMessage(playerid, -1, "{FFFFFF}Nu esti intr-o masina.");
- return 1;
- }
- CMD:news(playerid, params[])
- {
- new msg[128];
- if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti in EQN!");
- if(FactionInfo[playerid][fDuty] != 1) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti duty.");
- if(isnull(params)) return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}/news [TEXT]");
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- format(msg, sizeof(msg), "{99FF66}[EQN] %s: %s", nume, params);
- SendClientMessageToAll(COLOR_PURPLE, msg);
- return 1;
- }
- CMD:live(playerid, params[])
- {
- new msg[128];
- if(PlayerInfo[playerid][pFaction] != 4) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti in EQN!");
- if(FactionInfo[playerid][fDuty] != 1) return SendClientMessage(playerid, 0xFFFFFF, " !: {FFFFFF}Nu esti duty.");
- if(isnull(params)) return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}/live [TEXT]");
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- format(msg, sizeof(msg), "{99FF66}[TV BROADCAST] %s: %s", nume, params);
- SendClientMessageToAll(COLOR_PURPLE, msg);
- return 1;
- }
- CMD:seteaza(playerid, params[])
- {
- new PlayerName[24];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- if(!strcmp(PlayerName, "Henry_Baldwin", false))
- {
- PlayerInfo[playerid][pDeveloper] = 1;
- PlayerInfo[playerid][pAdmin] = 6;
- PlayerInfo[playerid][pTester] = 1;
- SendClientMessage(playerid, -1, "Ti-ai primit functia.");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, -1, "Numai ImTouchk# are acces la aceasta comanda!");
- }
- return 1;
- }
- CMD:duty(playerid, params[])
- {
- if(PlayerInfo[playerid][pFaction] == 2)
- {
- if(IsPlayerInRangeOfPoint(playerid, 20.00, 643.6490,-165.0781,1001.2758))
- {
- if(FactionInfo[playerid][fDuty] == 0)
- {
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- new string[128];
- FactionInfo[playerid][fDuty] = 1;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
- SendFDMessage(COLOR_PURPLE, string);
- }
- else if(FactionInfo[playerid][fDuty] == 1)
- {
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- new string[128];
- FactionInfo[playerid][fDuty] = 0;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
- SendFDMessage(COLOR_PURPLE, string);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Nu esti in vestiar!");
- SetPlayerCheckpoint(playerid, 643.6490,-165.0781,1001.2758);
- }
- }
- else if(PlayerInfo[playerid][pFaction] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 20.00, 1884.0470,1232.3463,18.0986))
- {
- if(FactionInfo[playerid][fDuty] == 0)
- {
- new nume[MAX_PLAYER_NAME];
- new string[128];
- FactionInfo[playerid][fDuty] = 1;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
- SendPDMessage(COLOR_PURPLE, string);
- }
- else if(FactionInfo[playerid][fDuty] == 1)
- {
- new nume[MAX_PLAYER_NAME];
- new string[128];
- FactionInfo[playerid][fDuty] = 0;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
- SendPDMessage(COLOR_PURPLE, string);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Nu esti in vestiar!");
- SetPlayerCheckpoint(playerid, 1884.0470,1232.3463,18.0986);
- }
- }
- else if(FactionInfo[playerid][pFaction] == 4)
- {
- if(IsPlayerInRangeOfPoint(playerid, 20.00, 256.0069,1778.2255,701.0859))
- {
- if(FactionInfo[playerid][fDuty] == 0)
- {
- new nume[MAX_PLAYER_NAME];
- new string[128];
- FactionInfo[playerid][fDuty] = 1;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Acum esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum disponibil!", nume);
- SendNEWSMessage(COLOR_PURPLE, string);
- }
- else if(FactionInfo[playerid][fDuty] == 1)
- {
- new nume[MAX_PLAYER_NAME];
- new string[128];
- FactionInfo[playerid][fDuty] = 0;
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Nu mai esti la datorie.");
- format(string, sizeof(string), "!: {FFFFFF}%s este acum indisponibil!", nume);
- SendNEWSMessage(COLOR_PURPLE, string);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Nu esti in vestiar!");
- SetPlayerCheckpoint(playerid, 256.0069,1778.2255,701.0859);
- }
- }
- else
- {
- return SendClientMessage(playerid, -1, "Nu esti intr-o factiune care dispune de /duty.");
- }
- return 1;
- }
- CMD:enter(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 20.00, -1390.0115,2638.8416,55.9844))
- {
- SetPlayerPos(playerid, 1866.3854,1217.4387,18.0986);
- SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados Sheriff's Departament");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 20.00, -1514.5566,2520.1011,55.9629))
- {
- SetPlayerPos(playerid, 642.9769,-172.3768,1001.2758);
- SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados Medical Center");
- }
- else if(IsPlayerInRangeOfPoint(playerid, 20.00, -1531.0065,2591.9971,55.8359))
- {
- SetPlayerPos(playerid, 248.6405,1783.9126,701.0859);
- SendClientMessage(playerid, -1, "{FFFFFF}El Quebrados News");
- }
- return 1;
- }
- CMD:exit(playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 20.00, 1866.3854,1217.4387,18.0986))
- {
- SetPlayerPos(playerid, -1390.0115,2638.8416,55.9844);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 20.00, 642.9769,-172.3768,1001.2758))
- {
- SetPlayerPos(playerid, -1514.5566,2520.1011,55.9629);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 20.00, 248.6405,1783.9126,701.0859))
- {
- SetPlayerPos(playerid, -1531.0065,2591.9971,55.8359);
- }
- return 1;
- }
- CMD:up(playerid, params[])
- {
- if(PlayerInfo[playerid][pDeveloper] != 1) return SendClientMessage(playerid, -1, "{FFFFFF}Nu esti developer!");
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerPos(playerid, X, Y, Z + 2);
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- new levels;
- new Nam[MAX_PLAYER_NAME];
- new pname[MAX_PLAYER_NAME];
- new str[128];
- new ID;
- if(PlayerInfo[playerid][pDeveloper] != 1)return SendClientMessage(playerid, COLOR_PURPLE, " !: {FFFFFF}Nu esti developer.");
- 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
- if(levels > 6) return SendClientMessage(playerid,COLOR_PURPLE," E!: {FFFFFF}Poti seta numai un nivel de la 1 la 6.");//Available levels
- if(!IsPlayerConnected(ID))return SendClientMessage(playerid,COLOR_PURPLE," E!: {FFFFFF}Utilizatorul selectat nu este conectat.");//Detect if the id/partofname is connected
- 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
- GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//define the playerid name
- GetPlayerName(ID,pname,MAX_PLAYER_NAME);//define the other person name
- if(levels == 0)
- {
- format(str, sizeof(str)," !: {FFFFFF}%s ti-a setat nivelul de administrator la %d.",Nam,levels);
- SendClientMessage(ID,COLOR_PURPLE,str);
- format(str, sizeof(str)," !: {FFFFFF}I-ai setat lui %s nivelul de administrator la %d!",pname,levels);
- SendClientMessage(playerid,COLOR_PURPLE,str);
- PlayerInfo[ID][pAdmin] = levels;//this sets the player level
- return 1;
- }
- format(str, sizeof(str)," !: {FFFFFF}%s ti-a setat nivelul de administrator %d!",Nam,levels);
- SendClientMessage(ID,COLOR_PURPLE,str);
- format(str, sizeof(str)," !: {FFFFFF}I-ai setat lui %s nivelul de administrator la %d!",pname,levels);
- SendClientMessage(playerid,COLOR_PURPLE,str);
- PlayerInfo[ID][pAdmin] = levels;
- return 1;
- }
- CMD:aduty(playerid,params[])
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(PlayerInfo[playerid][aDuty] == 0)
- {
- new playerName[MAX_PLAYER_NAME];
- new stringulet[128];
- SetPlayerColor(playerid, 0xFFA500);
- GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
- PlayerInfo[playerid][aDuty] = 1;
- format(stringulet, sizeof(stringulet), "{336633}[ADMIN] %s este acum duty!", playerName);
- SendAdminMessage(0xFFFFFFF, stringulet);
- }
- else if(PlayerInfo[playerid][aDuty] == 1)
- {
- new playerName[MAX_PLAYER_NAME];
- new stringuletu[128];
- SetPlayerColor(playerid, COLOR_PURPLE);
- GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
- PlayerInfo[playerid][aDuty] = 0;
- format(stringuletu, sizeof(stringuletu), "{336633}[ADMIN] %s este acum duty!", playerName);
- SendAdminMessage(0xFFFFFFF, stringuletu);
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "Nu esti administrator.");
- }
- return 1;
- }
- CMD:sethp(playerid, params[])
- {
- new ID;
- new str[128];
- new health;
- new Nam[MAX_PLAYER_NAME];
- new pname[MAX_PLAYER_NAME];
- if(sscanf(params,"ui",ID,Float:health)) return SendClientMessage(playerid, 0xFF9900AA, "FOLOSESTE: /setadmin [Nume sau ID] [HP]");
- if(Float:health < 0 || Float:health > 120) return SendClientMessage(playerid, 0xFF9900AA, "Viata trebuie sa fie intre 0 si 120.");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFF9900AA, "Utilizatorul selectat nu este conectat.");
- GetPlayerName(ID,pname,MAX_PLAYER_NAME);
- GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
- format(str, sizeof(str), "{FFFFFF}%s {FF0000}ti-a setat viata la {FFFFFF}%d.",Nam,health);
- SendClientMessage(ID, COLOR_PURPLE, str);
- format(str, sizeof(str), "{FF0000}I-ai setat lui {FFFFFF}%s {FF0000}viata la {FFFFFF}%d{FF0000}.",pname,health);
- SendClientMessage(playerid, COLOR_PURPLE,str);
- SetPlayerHealth(ID, health);
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- 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
- {
- ClearAnimations(playerid);//if they are a civillian and aren't a passenger it will put them out
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");//will send them a message telling them only police can access this vehicle
- }
- if(IsEQNVan(vehicleid) && PlayerInfo[playerid][pFaction] != 4 && !ispassenger)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");
- }
- if(IsEQMSCar(vehicleid) && PlayerInfo[playerid][pFaction] != 2 && !ispassenger)
- {
- ClearAnimations(playerid);
- SendClientMessage(playerid, COLOR_PURPLE, "!: {FFFFFF}Factiune invalida.");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
- {
- new vehicle = GetPlayerVehicleID(playerid);
- if(Engine[vehicle] == 0)
- {
- SendClientMessage(playerid, -1, "Motorul este oprit. Foloseste /engine pentru a-l porni.");
- }
- else if(Engine[vehicle] == 1)
- {
- SendClientMessage(playerid, -1, "Motorul este pornit.");
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- /*public OnPlayerHealthChange(playerid, Float:newhealth, Float:oldhealth)
- {
- if(newhealth > 20)
- {
- TogglePlayerControllable(playerid,0);
- new Text3D:label = Create3DTextLabel("(( JUCATORUL ESTE RANIT. IN-CHARACTER ESTE PE JOS. ))", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
- SendClientMessage(playerid, 0xff00000, "Ai intrat in DEATH-TIMER! Peste 120 secunde vei putea folosii /deathtimer.");
- SetTimerEx("dttimer", 120000, false, "i", playerid);
- PlayerInfo[playerid][DT] = 1;
- PlayerInfo[playerid][DTT] = 1;
- }
- return 1;
- }*/
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- new Float:health;
- GetPlayerHealth(playerid, health);
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(health <= 30)
- {
- SetPlayerHealth(playerid, 100);
- TogglePlayerControllable(playerid, false);
- SendClientMessage(playerid, COLOR_PURPLE, "Esti ranit. /acceptdeath in 120 secunde.");
- SetPlayerChatBubble(playerid, "Acest jucator este ranit!", -1, 20.00, -1);
- SetTimerEx("dttimer", 120000, false, "i", playerid);
- PlayerInfo[playerid][DT] = 1;
- PlayerInfo[playerid][DTT] = 1;
- }
- }
- return 1;
- }
- public dttimer(playerid)
- {
- SendClientMessage(playerid, 0xff00000, "Au trecut 120 secunde. Acum poti da /acceptdeath.");
- PlayerInfo[playerid][DTT] = 0;
- }
- public recuperare(playerid)
- {
- TogglePlayerControllable(playerid, true);
- SendClientMessage(playerid, -1, "{FFFFFF}Acum esti bine!");
- SetPlayerHealth(playerid, 100);
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- return 1;
- }
- forward BanExPublic(playerid, reason[]);
- public BanExPublic(playerid, reason[])
- {
- BanEx(playerid, reason);
- }
- stock BanExWithMessage(playerid, color, message[], reason[])
- {
- SendClientMessage(playerid, color, message);
- SetTimerEx("BanExPublic", 1000, false, "ds", playerid, reason);
- }
- stock SendPDMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pFaction] == 1)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock SendAdminMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock SendFDMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pFaction] == 2)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock SendGOVMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pFaction] == 3)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock SendNEWSMessage(col, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][pFaction] == 4)
- SendClientMessage(i, col, string);
- }
- return 1;
- }
- stock IsEQPCar(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 523,427,528,596,598,597,599,601,497,430: return 1; //checks if the vehicle id is a faction restricted vehicle
- }
- return 0;
- }
- stock IsEQNVan(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 582: return 1;
- }
- return 0;
- }
- stock IsEQMSCar(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 482,416: return 1;
- }
- return 0;
- }
- Dialog:DIALOG_LOGIN(playerid, response, listitem, inputtext[])
- {
- if (!response)
- return Kick(playerid);
- new password[64];
- SHA256_PassHash(inputtext, PASSWORD_SALT, password, sizeof (password));
- if (strcmp(PlayerInfo[playerid][pPass], password))
- {
- incercari[playerid]++;
- new str[150];
- format(str, sizeof (str), "Parola incorecta. Au mai ramas %i/%i incercari.", incercari[playerid], MAX_LOGIN_ATTEMPTS);
- SendClientMessage(playerid, 0xFFFFFFFF, str);
- if (incercari[playerid] >= MAX_LOGIN_ATTEMPTS)
- return Kick(playerid);
- 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");
- }
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, MAX_PLAYER_NAME);
- new str[150];
- format(str, sizeof (str), "----- {FF6633}%s {FFFFFF}-----", nume);
- SendClientMessage(playerid, 0xFFFFFFFF, str);
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- new ip[18];
- GetPlayerIp(playerid, ip, sizeof (ip));
- DB::Update("Utilizatori", PlayerInfo[playerid][pSQLID], 1,
- "IP", STRING, ip);
- return 1;
- }
- Dialog:DIALOG_REGISTER(playerid, response, listitem, inputtext[])
- {
- if (!response)
- return Kick(playerid);
- if (!inputtext[0] || inputtext[0] == ' ')
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Parola nu se potriveste, nu poate fi lasata goala.");
- 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");
- }
- new len = strlen(inputtext);
- if (len > MAX_PASSWORD_LENGTH || len < MIN_PASSWORD_LENGTH)
- {
- new str[150];
- format(str, sizeof (str), "Parola trebuie sa fie intre %i si %i caractere.", MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH);
- SendClientMessage(playerid, 0xFFFFFFFF, str);
- 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");
- }
- SHA256_PassHash(inputtext, PASSWORD_SALT, PlayerInfo[playerid][pPass], 64);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, MAX_PLAYER_NAME);
- new str[150];
- format(str, sizeof (str), "----- {FF3366}%s {FFFFFF}-----", name);
- SendClientMessage(playerid, 0xFFFFFFFF, str);
- new ip[18];
- GetPlayerIp(playerid, ip, sizeof (ip));
- DB::CreateRow("Utilizatori",
- "Nume", STRING, name,
- "Parola", STRING, PlayerInfo[playerid][pPass],
- "IP", STRING, ip,
- "Admin", INTEGER, PlayerInfo[playerid][pAdmin],
- "Tester", INTEGER, PlayerInfo[playerid][pTester],
- "Developer", STRING, PlayerInfo[playerid][pDeveloper]);
- DB::Fetch("Utilizatori", _, _, _, "`Nume` = '%q'", name);
- PlayerInfo[playerid][pSQLID] = fetch_row_id();
- fetcher_close();
- return 1;
- }
Add Comment
Please, Sign In to add comment