Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Credits */
- // //
- // Codding by Punct. //
- // Mapping by Punct. and Compact //
- // //
- /* Like a boss */
- #include <a_samp>
- #include <core>
- #include <float>
- #include <streamer>
- #include <Dini>
- #include <curse>
- #include <sscanf2>
- #include <a_mysql>
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
- #define SQL_HOST "localhost"
- #define SQL_USER "root"
- #define SQL_DB "truck"
- #define SQL_PASS ""
- #define D_Login 0
- #define D_Register 1
- #define STATS 2
- #define MIS 3
- #define CURSA 4
- #define JOB 5
- #define DIALOG_ANUNT 6
- #define DIALOG_START 7
- #define DIALOG_BENZINA 8
- #define MAX_MESSAGES 20
- #define SCM SendClientMessage
- #define KEY_HORN 2
- #define MAX_ZONE_NAME 28 // Numarul de zone
- #define MAX_HOUSES 200
- #define c_alb 0xFFFFFFFF
- #define c_albb "{FFFFFF}"
- #define c_rosu "{F81414}"
- #define c_verde "{00FF22}"
- #define c_gri "{B1BBBE}"
- #define c_p "{F48651}" // culoare - portocaliu
- #define c_a "{67BDFC}" // culoare - albastru
- #define RWTime 60000*10
- #pragma tabsize 0
- forward OnAccountCheck(playerid);
- forward OnAccountLoad(playerid);
- forward SAM(color, string[]);
- forward KickPublic(playerid);
- forward SendMSG();
- forward Inchide_vama_LSLV(playerid);
- forward Inchide_vama_LVLS(playerid);
- forward SpeedoMeter();
- forward CruiseControl(playerid);
- forward SeteazaTimp(playerid);
- forward Zones_Update();
- forward LoadHouse(houseid);
- forward SaveHouse(houseid);
- forward LoadSeif(seifid);
- forward SaveSeif(seifid);
- forward OnPropUpdate(update, num);
- forward LoadProperty();
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward RWeather();
- forward AscundeTD();
- native WP_Hash(buffer[], len, const str[]);
- static
- mysql, //This variable will be used to manage our database
- Name[MAX_PLAYERS][24], //We will use this variable to store player's name.
- IP[MAX_PLAYERS][16] //We will use this variable to store player's ip.
- ;
- enum _PINFO
- {
- pID,
- pPassword[129],
- pLevel,
- pCash,
- pAdmin,
- pKills,
- pDeaths,
- pHouseKey,
- pSpawn
- }
- new PlayerInfo[MAX_PLAYERS][_PINFO];
- enum _HINFO
- {
- hID,
- hLevel,
- hPrice,
- bool:hOwned, //NO = False, YES = True
- hOwner[MAX_PLAYER_NAME],
- Float:hEnterX,
- Float:hEnterY,
- Float:hEnterZ,
- Float:hExitX,
- Float:hExitY,
- Float:hExitZ,
- hInt,
- hVir,
- hDescriere[MAX_PLAYER_NAME]
- //hVecModel,
- //Float:hVecX,
- //Float:hVecY,
- //Float:hVecZ,
- //Float:hVecA
- };
- new HouseInfo[MAX_HOUSES][_HINFO];
- //new HouseCar[MAX_HOUSES];
- new Text3D:HouseLabel[sizeof(HouseInfo)];
- new HousePickup[sizeof(HouseInfo)];
- enum _SINFO
- {
- sID,
- sMoney,
- sPass[50],
- Float:sEnterX,
- Float:sEnterY,
- Float:sEnterZ
- };
- new SeifInfo[MAX_PLAYERS][_SINFO];
- new Text3D:SeifLabel[sizeof(SeifInfo)];
- new SeifPickup[sizeof(SeifInfo)];
- new TrySeifLog[sizeof(SeifInfo)][MAX_PLAYERS];
- enum _MISIUNE
- {
- mMarfa[30],
- mLoadp[40],
- mUnloadp[40],
- Float:mLoadp_x,
- Float:mLoadp_y,
- Float:mLoadp_z,
- Float:mUnLoadp_x,
- Float:mUnLoadp_y,
- Float:mUnLoadp_z,
- mDistanta,
- mCastig
- }
- new MisiuneInfo[MAX_PLAYERS][_MISIUNE];
- new RandomMsg[][] =
- {
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Textdraw-urile pot fi ascunse folosind {67BDFC}'{F48651}/textdraw{F48651}'{FFFFFF}.",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Daca ai ramas pe drumuri poti folosi {67BDFC}'{67BDFC}/job{67BDFC}'{FFFFFF}.",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Te-ai saturat de misiunile random? Cumpara o {F48651}licenta {FFFFFF}[{67BDFC}'{F48651}/licenta{67BDFC}'{FFFFFF}].",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Serverul este in versiunea beta, deci orice bug va rugam sa il raportati {F48651}administratorilor{FFFFFF}.",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Momentan spawn-urile s-au facut in orasele {F48651}LosSantos{FFFFFF} si {F48651}LasVenturas{FFFFFF}.",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Pentru a activa {F48651}CruiseControl{FFFFFF} apasa tasta {F48651}2{FFFFFF}.",
- "{FFFFFF}[{67BDFC}Sfat{FFFFFF}] Daca ai uitat informatiile despre cursa si ai ascuns TextDraw-ul foloseste {67BDFC}'{F48651}/cursa{67BDFC}'{FFFFFF}."
- };
- new RandomW[][] =
- {
- "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
- "{67BDFC}Anunt Meteo {F48651}Cer senin, ceata{FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Moderat",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat, ceata {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Moderat",
- "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
- "{67BDFC}Anunt Meteo {F48651}Ploi {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Moderat{FFFFFF}| {F48651}Nori: Innorat",
- "{67BDFC}Anunt Meteo {F48651}Furtuna {FFFFFF}| {F48651}Vizibilitate: Scazuta {FFFFFF}| {F48651}Vand: Puternic {FFFFFF}| {F48651}Nori: Innorat",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
- "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
- "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
- "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
- "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
- "{67BDFC}Anunt Meteo {F48651}Innorat {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Da",
- "{67BDFC}Anunt Meteo {F48651}Ploi {FFFFFF}| {F48651}Vizibilitate: Medie {FFFFFF}| {F48651}Vand: Moderat{FFFFFF}| {F48651}Nori: Innorat",
- "{67BDFC}Anunt Meteo {F48651}Cer senin {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Nu {FFFFFF}| {F48651}Nori: Aproape 0",
- "{67BDFC}Anunt Meteo {F48651}Cer moderat {FFFFFF}| {F48651}Vizibilitate: Ridicata {FFFFFF}| {F48651}Vand: Slab {FFFFFF}| {F48651}Nori: Putini",
- "{67BDFC}Anunt Meteo {F48651}Furtuna de nisip{FFFFFF}| {F48651}Vizibilitate: Minima {FFFFFF}| {F48651}Vand: Puternic {FFFFFF}| {F48651}Nori: Innorat"
- };
- enum SAZONE_MAIN { //Betamaster
- SAZONE_NAME[25],
- Float:SAZONE_AREA[6]
- };
- static const gSAZones[][SAZONE_MAIN] = { // Majority of names and area coordinates adopted from Mabako's 'Zones Script' v0.2
- // NAME AREA (Xmin,Ymin,Zmin,Xmax,Ymax,Zmax)
- // Main Zones
- {"Los Santos", {44.60,-2892.90,-242.90,2997.00,-768.00,900.00}},
- {"Las Venturas", {869.40,596.30,-242.90,2997.00,2993.80,900.00}},
- {"Bone County", {-480.50,596.30,-242.90,869.40,2993.80,900.00}},
- {"Tierra Robada", {-2997.40,1659.60,-242.90,-480.50,2993.80,900.00}},
- {"Tierra Robada", {-1213.90,596.30,-242.90,-480.50,1659.60,900.00}},
- {"San Fierro", {-2997.40,-1115.50,-242.90,-1213.90,1659.60,900.00}},
- {"Red County", {-1213.90,-768.00,-242.90,2997.00,596.30,900.00}},
- {"Flint County", {-1213.90,-2892.90,-242.90,44.60,-768.00,900.00}},
- {"Whetstone", {-2997.40,-2892.90,-242.90,-1213.90,-1115.50,900.00}}
- };
- new Menu:orase;
- new Menu:oras_ls;
- new Menu:oras_lv;
- new Text:Data[2];
- new Text:Anunt[2];
- new Text:Name_V[MAX_PLAYERS];
- new Text:Speed[MAX_PLAYERS];
- new Text:HP[MAX_PLAYERS];
- new Text:HG[MAX_PLAYERS];
- new Text:Zones[MAX_PLAYERS];
- new Text:Logo[4];
- new PlayerText:Info[5][MAX_PLAYERS];
- //new Weather;
- new SeifLogin[MAX_PLAYERS];
- new vama_LSLV, vama_LVLS;
- new Float:PlayerCruiseSpeed[MAX_PLAYERS];
- new Float:PlayerHeadingAngle[MAX_PLAYERS];
- new Speedo[MAX_PLAYERS];
- new vtimer;
- new addveh;
- new CP[MAX_PLAYERS];
- new cargo_marfa[250];
- new cursa[MAX_PLAYERS];
- new VehicleNames[212][] =
- {
- {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
- {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
- {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
- {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
- {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Cargo Trailer"},{"Previon"},
- {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
- {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Ore Trailer"},{"Turismo"},
- {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's Van"},
- {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
- {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
- {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
- {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
- {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
- {"Mesa"},{"RCGoblin"},{"HotRacer A"},{"HotRacer B"},{"Bloodring Banger"},{"Rancher"},
- {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
- {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
- {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
- {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
- {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
- {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
- {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
- {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
- {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
- {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
- {"Tug"},{"Petrol Trailer"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
- {"Arctic Trailer"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car"},{"SFPD"},
- {"LVPD"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
- {"Sadler"},{"LuTrailer A"},{"LuTrailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
- {"Utility Trailer"}
- };
- main()
- {
- for(new j=1; j<=50; j++)
- print(" ");
- print("\t|------------------------------------|");
- print("\t| SA:MP Server |\n");
- print("\t| Romania Regional Trucking | 0.3x |\n");
- print("\t| Made by Punct. |\n");
- print("\t|------------------------------------|\n");
- for(new j=1; j<=5; j++)
- print(" ");
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerCommandText * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new idx;
- new cmd[200], tmp[256];
- new string[256];
- new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- cmd = strtok(cmdtext, idx);
- printf("[CMD] %s: %s", sendername, cmd);
- if(strcmp(cmd, "/help", true) == 0) //help
- {
- if(IsPlayerConnected(playerid))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}** {67BDFC}R{F48651}omania {67BDFC}R{F48651}egional {F48651} {67BDFC}T{F48651}rucking{67BDFC} **");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /help /stats /textdraw /start /cursa /job /repair /flip");
- if(PlayerInfo[playerid][pHouseKey] != 255) SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /buyhouse /sellhouse /changespawn");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/help{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/job", true) == 0 || strcmp(cmd, "/respawn", true) == 0 || strcmp(cmd, "/rescue", true) == 0) //job //respawn //rescue
- {
- if(IsPlayerConnected(playerid))
- {
- ShowMenuForPlayer(orase,playerid);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/job{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- /* if(strcmp(cmd, "/textdraw", true) == 0) //textdraw
- {
- if(IsPlayerConnected(playerid))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Apasa pe {67BDFC}x{F48651}-ul de pe TexDraw-ul care vrei sa il inchizi{FFFFFF}.");
- if(td5_10[playerid] == 1 || td11_15[playerid] == 1 || td27_37[playerid] == 1)
- {
- SelectTextDraw(playerid, 0x84C128DD);
- if(td5_10[playerid] == 1)
- TextDrawShowForPlayer(playerid, Textdraw7[playerid]);
- else {}
- if(td11_15[playerid] == 1)
- TextDrawShowForPlayer(playerid, Textdraw15[playerid]);
- else {}
- if(td27_37[playerid] == 1)
- TextDrawShowForPlayer(playerid, Textdraw36[playerid]);
- else {}
- }
- else if(td5_10[playerid] == 0 && td11_15[playerid] == 0 && td27_37[playerid] == 0)
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Ai ascuns toate TextDraw-urile{FFFFFF}.");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/textdraw{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/stoptextdraw", true) == 0) //stoptextdraw
- {
- if(IsPlayerConnected(playerid))
- {
- CancelSelectTextDraw(playerid);
- TextDrawHideForPlayer(playerid, Textdraw7[playerid]);
- TextDrawHideForPlayer(playerid, Textdraw15[playerid]);
- TextDrawHideForPlayer(playerid, Textdraw37[playerid]);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stoptextdraw{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- */
- if(strcmp(cmd, "/stop", true) == 0) //stop
- {
- if(IsPlayerConnected(playerid))
- {
- if(cursa[playerid] == 1)
- {
- cursa[playerid] = 0;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Ai oprit cursa{FFFFFF}. {67BDFC}Ai platit 500$ ca daune {F48651}pentru amanarea cursei{FFFFFF}.");
- GivePlayerMoney(playerid, -500);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stop{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- CP[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawHide(playerid, Info[t][playerid]);
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/start2", true) == 0) //start
- {
- if(IsPlayerConnected(playerid))
- {
- if(cursa[playerid] == 0)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid, vehicleid))
- {
- if(vehicleid >= 1 && vehicleid <= 50)
- {
- if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)
- {
- ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{FFFFFF}Marfa", "1. Benzina\n2. Motorina\n3. Disel\n4. Gaz lichefiat\n5. Ulei", "Next", "Cancel");
- } else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Iti trebuie un trailer pentru a incepe o cursa.");
- }
- else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un tir.");
- }
- else return SCM(playerid, c_alb,"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai inceput deja o cursa. Termina cursa actuala si poti incepe alta.");
- }
- else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul.");
- }
- return 1;
- }
- if(strcmp(cmd, "/start", true) == 0) //start
- {
- if(IsPlayerConnected(playerid))
- {
- if(cursa[playerid] == 0)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInVehicle(playerid, vehicleid))
- {
- if(vehicleid >= 1 && vehicleid <= 50)
- {
- if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)
- {
- new idt = random(sizeof(Curse_Cargo));
- format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Cargo[idt][idx0], Curse_Cargo[idt][idx1], Curse_Cargo[idt][idx2]);
- ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
- MisiuneInfo[playerid][mLoadp_x] = Curse_Cargo[idt][idx3];
- MisiuneInfo[playerid][mLoadp_y] = Curse_Cargo[idt][idx4];
- MisiuneInfo[playerid][mLoadp_z] = Curse_Cargo[idt][idx5];
- MisiuneInfo[playerid][mUnLoadp_x] = Curse_Cargo[idt][idx6];
- MisiuneInfo[playerid][mUnLoadp_y] = Curse_Cargo[idt][idx7];
- MisiuneInfo[playerid][mUnLoadp_z] = Curse_Cargo[idt][idx8];
- strcpy(MisiuneInfo[playerid][mMarfa], Curse_Cargo[idt][idx0], 40);
- strcpy(MisiuneInfo[playerid][mLoadp], Curse_Cargo[idt][idx1], 40);
- strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Cargo[idt][idx2], 40);
- SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
- CP[playerid] = 1;
- cursa[playerid] = 1;
- MisiuneInfo[playerid][mCastig] = Curse_Cargo[idt][idx9];
- MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
- new nr = MisiuneInfo[playerid][mDistanta];
- new m[30], dl[30], l[30], d[40];
- format(m, sizeof(m), "Marfa: %s", Curse_Cargo[idt][idx0]);
- PlayerTextDrawSetString(playerid, Info[1][playerid], m);
- format(dl, sizeof(dl), "De la: %s", Curse_Cargo[idt][idx1]);
- PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
- format(l, sizeof(m), "La: %s", Curse_Cargo[idt][idx2]);
- PlayerTextDrawSetString(playerid, Info[3][playerid], l);
- format(d, sizeof(d), "Distanta: %i km", nr);
- PlayerTextDrawSetString(playerid, Info[4][playerid], d);
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawShow(playerid, Info[t][playerid]);
- }
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- else if (GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)
- {
- new idt = random(sizeof(Curse_Fluid));
- format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Fluid[idt][idx0], Curse_Fluid[idt][idx1], Curse_Fluid[idt][idx2]);
- ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
- MisiuneInfo[playerid][mLoadp_x] = Curse_Fluid[idt][idx3];
- MisiuneInfo[playerid][mLoadp_y] = Curse_Fluid[idt][idx4];
- MisiuneInfo[playerid][mLoadp_z] = Curse_Fluid[idt][idx5];
- MisiuneInfo[playerid][mUnLoadp_x] = Curse_Fluid[idt][idx6];
- MisiuneInfo[playerid][mUnLoadp_y] = Curse_Fluid[idt][idx7];
- MisiuneInfo[playerid][mUnLoadp_z] = Curse_Fluid[idt][idx8];
- strcpy(MisiuneInfo[playerid][mMarfa], Curse_Fluid[idt][idx0], 40);
- strcpy(MisiuneInfo[playerid][mLoadp], Curse_Fluid[idt][idx1], 40);
- strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Fluid[idt][idx2], 40);
- SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
- CP[playerid] = 1;
- cursa[playerid] = 1;
- MisiuneInfo[playerid][mCastig] = Curse_Fluid[idt][idx9];
- MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
- new nr = floatround(MisiuneInfo[playerid][mDistanta]);
- new m[30], dl[30], l[30], d[40];
- format(m, sizeof(m), "Marfa: %s", Curse_Fluid[idt][idx0]);
- PlayerTextDrawSetString(playerid, Info[1][playerid], m);
- format(dl, sizeof(dl), "De la: %s", Curse_Fluid[idt][idx1]);
- PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
- format(l, sizeof(m), "La: %s", Curse_Fluid[idt][idx2]);
- PlayerTextDrawSetString(playerid, Info[3][playerid], l);
- format(d, sizeof(d), "Distanta: %i km", nr);
- PlayerTextDrawSetString(playerid, Info[4][playerid], d);
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawShow(playerid, Info[t][playerid]);
- }
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- } else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Iti trebuie un trailer pentru a incepe o cursa.");
- }
- else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un tir.");
- }
- else return SCM(playerid, c_alb,"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai inceput deja o cursa. Termina cursa actuala si poti incepe alta.");
- }
- else return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul.");
- }
- return 1;
- }
- if(strcmp(cmd, "/stats", true) == 0) //stats
- {
- if(IsPlayerConnected(playerid))
- {
- new spawn[7];
- if(PlayerInfo[playerid][pSpawn] == 1) strcpy(spawn, "Firma", 7);
- else if(PlayerInfo[playerid][pSpawn] == 2) strcpy(spawn, "Acasa", 7);
- new Str[1000];
- format(Str, sizeof(Str), "{F48651}Nume: {67BDFC}%s\t\t{F48651}ID: {67BDFC}%d\n** {F48651}Score: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Cash: {FFFFFF}\t ..... \t{67BDFC}%d{F48651}$\n{67BDFC}** {F48651}Admin: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Casa: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Kills: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Deaths: {FFFFFF}\t ..... \t{67BDFC}%d\n** {F48651}Spawn: {FFFFFF}\t ..... \t{67BDFC}%s",
- sendername, playerid,
- GetPlayerScore(playerid),
- GetPlayerMoney(playerid),
- PlayerInfo[playerid][pAdmin],
- PlayerInfo[playerid][pHouseKey],
- PlayerInfo[playerid][pKills],
- PlayerInfo[playerid][pDeaths],
- spawn);
- ShowPlayerDialog(playerid, STATS, DIALOG_STYLE_MSGBOX, ""c_a"Statisticile contului tau", Str, "Ok", "");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/stats{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/cursa", true) == 0) //cursa
- {
- if(IsPlayerConnected(playerid))
- {
- if(cursa[playerid] == 1)
- {
- new Str[500];
- format(Str, sizeof(Str), "\n{FFFFFF}** {F48651}Transporti: {67BDFC}%s\n\n{FFFFFF}** {F48651}Incarci marfa la {67BDFC}%s\n\n{FFFFFF}** {F48651}Descarci marfa la {67BDFC}%s\n\n",
- MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
- ShowPlayerDialog(playerid, CURSA, DIALOG_STYLE_MSGBOX, "{FFFFFF}Informatii cursa", Str, "Ok", "");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/cursa{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Nu ai inceput vreo cursa{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/repair", true) == 0 || strcmp(cmd, "/fix", true) == 0) //repair //fix
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Vehiculul tau a fost {67BDFC}reparat{FFFFFF}.");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/repair{FFFFFF}' {B1BBBE}sau {FFFFFF}'{67BDFC}/fix{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti intr-un vehicul.");
- }
- return 1;
- }
- if(strcmp(cmd, "/changespawn", true) == 0 || strcmp(cmd, "/cspawn", true) == 0) //repair //fix
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pSpawn] == 1)
- {
- PlayerInfo[playerid][pSpawn] = 2;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum vei fi spawnat {F48651}acasa{FFFFFF}.");
- }
- else if(PlayerInfo[playerid][pSpawn] == 2)
- {
- PlayerInfo[playerid][pSpawn] = 1;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum vei fi spawnat {F48651}la firma{FFFFFF}.");
- }
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/changespan{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- if(strcmp(cmdtext, "/flip", true) == 0) //flip
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new vehicul;
- new Float:rotatie;
- vehicul = GetPlayerVehicleID(playerid);
- GetVehicleZAngle(vehicul, rotatie);
- SetVehicleZAngle(vehicul, rotatie);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Vehiculul tau a fost {F48651}indreptat{FFFFFF}.");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/flip{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti intr-un vehicul.");
- }
- return 1;
- }
- if(strcmp(cmd, "/seif", true) == 0)
- {
- new houseid = PlayerInfo[playerid][pHouseKey]+5;
- new x_nr[182], moneys;
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif [name]");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nume Valabile: login, status, logout, wmoney, dmoney");
- return 1;
- }
- //GetPlayerName(playerid, sendername, sizeof(sendername));
- else if(strcmp(x_nr,"setpin",true) == 0)
- {
- if(SeifLogin[playerid] == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
- return 1;
- }
- new dr = SeifLogin[playerid];
- if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
- return 1;
- }
- if(PlayerInfo[playerid][pAdmin] < 12 || PlayerInfo[playerid][pHouseKey] == 255)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Doar adminii & proprietarii caselor cu seif pot schimba parolele seifurilor.");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif setpin [noua parola]");
- return 1;
- }
- if(strfind(tmp, "|", true) != -1)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa nu este valabila.");
- return 1;
- }
- else
- {
- if(SeifInfo[dr][sID] == houseid)
- {
- format(string, sizeof(string), "%s", tmp);
- strmid(SeifInfo[dr][sPass], string, 0, strlen(string), 255);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}]Noua parola a seifului(%d) casei(%d) tale este: %s", dr, dr-5, tmp);
- SCM(playerid, c_alb, string);
- }
- else
- {
- format(string, sizeof(string), "%s", tmp);
- strmid(SeifInfo[dr][sPass], string, 0, strlen(string), 255);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}]Noua parola a seifului %d tale este: %s", dr, tmp);
- SCM(playerid, c_alb, string);
- }
- return 1;
- }
- }
- if(strcmp(x_nr,"login",true) == 0)
- {
- if(SeifLogin[playerid] == 1)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Esti logat la un seif, delogheaza-te mai intai!");
- return 1;
- }
- new x_nrr[182];
- x_nrr = strtok(cmdtext, idx);
- if(!strlen(x_nrr))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif login");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nume Valabile: Admin, Helper, Event, Truck, Public, House");
- return 1;
- }
- if(strcmp(x_nrr,"admin",true) == 0)
- {
- if(TrySeifLog[1][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {F48651}/seif login admin [password]");
- return 1;
- }
- if(strcmp(x_nrd,SeifInfo[1][sPass],true) == 0)
- {
- SeifLogin[playerid] = 1;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[1][playerid]++;
- if(TrySeifLog[1][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 1{FFFFFF}.",sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else if(strcmp(x_nrr,"helper",true) == 0)
- {
- if(TrySeifLog[2][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste /seif login helper [password]");
- return 1;
- }
- if(strcmp(x_nrd,SeifInfo[2][sPass],true) == 0)
- {
- SeifLogin[playerid] = 2;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[2][playerid]++;
- if(TrySeifLog[2][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 2{FFFFFF}.",sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else if(strcmp(x_nrr,"event",true) == 0)
- {
- if(TrySeifLog[3][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "/seif login event [password]");
- return 1;
- }
- if(strcmp(x_nrd,SeifInfo[3][sPass],true) == 0)
- {
- SeifLogin[playerid] = 3;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[3][playerid]++;
- if(TrySeifLog[3][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 31{FFFFFF}.",sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else if(strcmp(x_nrr,"Truck",true) == 0)
- {
- if(TrySeifLog[4][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "/seif login Truck [password]");
- return 1;
- }
- if(strcmp(x_nrd,SeifInfo[4][sPass],true) == 0)
- {
- SeifLogin[playerid] = 4;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[4][playerid]++;
- if(TrySeifLog[4][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 4{FFFFFF}.",sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else if(strcmp(x_nrr,"public",true) == 0)
- {
- if(TrySeifLog[5][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "/seif login public [password]");
- return 1;
- }
- if(strcmp(x_nrd,SeifInfo[5][sPass],true) == 0)
- {
- SeifLogin[playerid] = 5;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[5][playerid]++;
- if(TrySeifLog[5][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului 5{FFFFFF}.",sendername);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else if(strcmp(x_nrr,"house",true) == 0)
- {
- if(TrySeifLog[houseid][playerid] >= 3)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu mai ai voie sa folosesti aceasta comanda.");
- return 1;
- }
- new x_nrd[182];
- x_nrd = strtok(cmdtext, idx);
- if(!strlen(x_nrd))
- {
- SCM(playerid, c_alb, "/seif login house [password]");
- return 1;
- }
- if(strcmp(x_nrd, SeifInfo[houseid][sPass], true) == 0)
- {
- SeifLogin[playerid] = houseid;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai logat la un seif.");
- return 1;
- }
- else
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Parola introdusa este incorecta");
- TrySeifLog[houseid][playerid]++;
- if(TrySeifLog[houseid][playerid] == 3)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {FFFFFF}a incercat sa sparga parola {F48651}seifului casei %d{FFFFFF}.",sendername, houseid);
- SAM(c_alb, string);
- }
- return 1;
- }
- }
- else
- {
- SCM(playerid, c_alb, "|_______________________ Seif _______________________|");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}]/seif login [name] [password]");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}]Nume Valabile: Admin, Helper, Event, Truck, Public, House");
- SCM(playerid, c_alb, "|____________________________________________________|");
- return 1;
- }
- }
- else if(strcmp(x_nr,"dmoney",true) == 0)
- {
- if(SeifLogin[playerid] == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
- return 1;
- }
- new dr = SeifLogin[playerid];
- if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX], SeifInfo[dr][sEnterY], SeifInfo[dr][sEnterZ]))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif dmoney [suma]");
- return 1;
- }
- moneys = strval(tmp);
- if(moneys <= 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif dmoney [suma]");
- return 1;
- }
- if(moneys > GetPlayerMoney(playerid))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu detii aceasta suma.");
- return 1;
- }
- else
- {
- GivePlayerMoney(playerid, -moneys);
- SeifInfo[dr][sMoney] += moneys;
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai depus $%d in seiful factiuni",moneys);
- SCM(playerid, c_alb, string);
- }
- }
- else if(strcmp(x_nr,"wmoney",true) == 0)
- {
- if(SeifLogin[playerid] == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
- return 1;
- }
- new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- //if(PlayerInfo[playerid][pLeader] == 0)
- //{
- // SCM(playerid, c_alb, "Server: Doar lideri pot scoate bani din seif!");
- // return 1;
- //}
- new dr = SeifLogin[playerid];
- if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif wmoney [suma]");
- return 1;
- }
- moneys = strval(tmp);
- //if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] != dr)
- //{
- // return 1;
- //}
- if(moneys <= 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] /seif wmoney [suma]");
- return 1;
- }
- if(moneys > SeifInfo[dr][sMoney])
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] In seif nu se gasesc atatia bani.");
- return 1;
- }
- else
- {
- GivePlayerMoney(playerid, moneys);
- SeifInfo[dr][sMoney] -= moneys;
- format(string, sizeof(string), "Ai scos $%s din seiful factiuni.", moneys);
- SCM(playerid, c_alb, string);
- return 1;
- }
- }
- else if(strcmp(x_nr,"status",true) == 0)
- {
- if(SeifLogin[playerid] == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
- return 1;
- }
- new dr = SeifLogin[playerid];
- if(!PlayerToPoint(1.0, playerid, SeifInfo[dr][sEnterX], SeifInfo[dr][sEnterY], SeifInfo[dr][sEnterZ]))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
- return 1;
- }
- else
- {
- new ttext[40];
- if(SeifLogin[playerid] == 1) { ttext = "admin"; }
- else if(SeifLogin[playerid] == 2) { ttext = "helper"; }
- else if(SeifLogin[playerid] == 3) { ttext = "event"; }
- else if(SeifLogin[playerid] == 4) { ttext = "truck"; }
- else if(SeifLogin[playerid] == 5) { ttext = "public"; }
- else if(SeifLogin[playerid] == houseid) { ttext = "casei"; }
- else { ttext = "empty"; }
- format(string, sizeof(string), "{FFFFFF}In {0099FF}seiful %s {FFFFFF}se gasesc {228B22}%d${FFFFFF}.", ttext, SeifInfo[dr][sMoney]);
- SCM(playerid, c_alb, string);
- }
- }
- else if(strcmp(x_nr,"logout",true) == 0)
- {
- if(SeifLogin[playerid] == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti logat la nici un seif!");
- return 1;
- }
- //new dr = SeifLogin[playerid];
- //if(!PlayerToPoint(5.0, playerid, SeifInfo[dr][sEnterX],SeifInfo[dr][sEnterY],SeifInfo[dr][sEnterZ]))
- //{
- // SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti langa seif!");
- // return 1;
- //}
- //else
- //{
- SeifLogin[playerid] = 0;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai deconectat cu succes de la seif!");
- // return 1;
- //}
- }
- else
- {
- SCM(playerid, c_alb, "|_______________________ Seif _______________________|");
- SCM(playerid, c_alb, "/seif [name]");
- SCM(playerid, c_alb, "Nume Valabile: login, status, logout, wmoney, dmoney");
- SCM(playerid, c_alb, "|____________________________________________________|");
- return 1;
- }
- }
- //////////////////////////////// Comenzi Casa //////////////////////////////////
- if(strcmp(cmd, "/enterh", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- for(new i=0; i<MAX_HOUSES; i++)
- {
- if(PlayerToPoint(1.0, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
- {
- SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Bun venit acasa{FFFFFF}!");
- SetPlayerInterior(playerid, HouseInfo[i][hInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[i][hVir]);
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/exith", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- for(new i=0; i<MAX_HOUSES; i++)
- {
- if(PlayerToPoint(1.5, playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
- {
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]+0.5);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Drum bun{FFFFFF}!");
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- }
- return 1;
- }
- if(strcmp(cmdtext, "/buyhouse", true) == 0)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(PlayerToPoint(0.7, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
- {
- if(GetPlayerScore(playerid) < HouseInfo[i][hLevel]) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai level-ul necesar.");
- if(PlayerInfo[playerid][pHouseKey] != 255) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu poti detine mai mult de o casa.");
- if(HouseInfo[i][hOwned] == true) { SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Aceasta casa are deja un proprietar."); return 1; }
- if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai suficienti bani.");
- HouseInfo[i][hOwned] = true;
- PlayerInfo[playerid][pHouseKey] = HouseInfo[i][hID];
- strcpy(HouseInfo[i][hOwner], pName, MAX_PLAYER_NAME);
- GivePlayerMoney(playerid, -HouseInfo[i][hPrice]);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ti-ai cumparat o casa noua. [ID:%d].", HouseInfo[i][hPrice]);
- SCM(playerid, c_alb, string);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acum iti poti schimba spawn-ul folosind '{F48651}/changespawn{FFFFFF}'.");
- OnPropUpdate(1, i);
- SaveHouse(i);
- }
- }
- return 1;
- }
- if(strcmp(cmdtext, "/sellhouse", true) == 0)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(PlayerToPoint(2.0, playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir])
- {
- if(strcmp(HouseInfo[i][hOwner], pName, true, strlen(HouseInfo[i][hOwner]))) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu esti proprietarul acestei case.");
- if(PlayerInfo[playerid][pHouseKey] == 255) return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu ai o casa.");
- strcpy(HouseInfo[i][hOwner], "For sale", 9);
- HouseInfo[i][hOwned] = false;
- PlayerInfo[playerid][pHouseKey] = 255;
- new money = HouseInfo[i][hPrice]/2 + HouseInfo[i][hPrice]/4;
- GivePlayerMoney(playerid, money);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ti-ai vandut casa cu {F48651}%d ${FFFFFF}.", money);
- SCM(playerid, c_alb, string);
- if(PlayerInfo[playerid][pSpawn] == 2) PlayerInfo[playerid][pSpawn] = 1;
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Pentru ca ti-ai vandut casa, spawn-ul ti s-a schimba la firma.");
- OnPropUpdate(1, i);
- SaveHouse(i);
- }
- }
- return 1;
- }
- /*if(!strcmp(cmdtext, "/getcar", true))
- {
- new pName[MAX_PLAYER_NAME], Float:X, Float:Y, Float:Z, Float:A;
- new houseid = cmdtext[8]; //The param. /tphousecar is 0-8. With a space, 9. Then, the param is at 10.
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- if(!strcmp(HouseInfo[houseid][hOwner], pName, false)) return SCM(playerid, c_alb, "Nu esti proprietarul acestei case.");
- if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, c_alb, "Trebuie sa fii intr-un vehicul!"); //if is player not in an vehicle, send an message and stop (RETURN [message])
- GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
- HouseInfo[houseid][hVecX] = X;
- HouseInfo[houseid][hVecY] = Y;
- HouseInfo[houseid][hVecZ] = Z;
- HouseInfo[houseid][hVecA] = A;
- return 1;
- }*/
- //////////////////////////////// Comenzi Admin /////////////////////////////////
- if(strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/ah", true) == 0) //ahelp
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 10)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Comenzile adminilor serverului {67BDFC}R{F48651}omania{67BDFC} T{F48651}rucking{67BDFC} R{F48651}egional {FFFFFF}.");
- if(PlayerInfo[playerid][pAdmin] >= 11)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 1{FFFFFF}] /nitro /hidra /tod /kick");
- }
- if(PlayerInfo[playerid][pAdmin] >= 12)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 2{FFFFFF}] /goto /gethere /anunt");
- }
- if(PlayerInfo[playerid][pAdmin] >= 13)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 3{FFFFFF}] /addhev /delveh");
- }
- if(PlayerInfo[playerid][pAdmin] >= 14)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 4{FFFFFF}] /chouse /cseif");
- }
- if(PlayerInfo[playerid][pAdmin] >= 15)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 5{FFFFFF}] /givemoneyall");
- }
- if(PlayerInfo[playerid][pAdmin] >= 16)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}Admin 6{FFFFFF}] /setadmin");
- }
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/ahelp{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/cseif", true) == 0 || strcmp(cmd, "/createseif", true) == 0) //cseif
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 14)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}cseif [id]");
- return 1;
- }
- new seifid;
- seifid = strval(tmp);
- new File[100];
- format(File, sizeof(File), "Seifuri/%d.ini", seifid);
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- dini_Create(File);
- dini_IntSet(File, "ID", seifid);
- dini_IntSet(File, "Money", 0);
- strmid(SeifInfo[seifid][sPass], "parola", 0, strlen(string), 255);
- dini_FloatSet(File, "EnterX", X);
- dini_FloatSet(File, "EnterY", Y);
- dini_FloatSet(File, "EnterZ", Z);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai creat seiful cu id-ul {F48651}%d{FFFFFF}.", seifid);
- SCM(playerid, c_alb, string);
- LoadSeif(seifid);
- OnPropUpdate(2, seifid);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/createseif{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- } else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/chouse", true) == 0 || strcmp(cmd, "/createhouse", true) == 0) //chouse
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 14)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [pret] [interior] [id casa]'");
- return 1;
- }
- new level;
- level = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [Level] [pret] [interior] [id casa]");
- return 1;
- }
- new pret;
- pret = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [Pret] [interior] [id casa]");
- return 1;
- }
- new interior;
- interior = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}chouse [level] [pret] [Interior] [id casa]");
- return 1;
- }
- new houseid;
- houseid = strval(tmp);
- new File[100];
- format(File, sizeof(File), "Case/%d.ini", houseid);
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- dini_Create(File);
- dini_IntSet(File, "ID", houseid);
- dini_IntSet(File, "Level", level);
- dini_IntSet(File, "Price", pret);
- dini_IntSet(File, "Owned", false);
- strcpy(HouseInfo[houseid][hOwner], "For Sale", 9);
- dini_FloatSet(File, "EnterX", X);
- dini_FloatSet(File, "EnterY", Y);
- dini_FloatSet(File, "EnterZ", Z);
- dini_IntSet(File, "Vir", houseid);
- if(interior == 3)
- {
- dini_FloatSet(File, "ExitX", 235.508);
- dini_FloatSet(File, "ExitY", 1189.169);
- dini_FloatSet(File, "ExitZ", 1080.340);
- dini_IntSet(File, "Int", 3);
- strcpy(HouseInfo[houseid][hDescriere], "Casa mare", 10);
- }
- if(interior == 5)
- {
- dini_FloatSet(File, "ExitX", 1299.14);
- dini_FloatSet(File, "ExitY", -794.77);
- dini_FloatSet(File, "ExitZ", 1084.00);
- dini_IntSet(File, "Int", 5);
- strcpy(HouseInfo[houseid][hDescriere], "Madd Doggs Mansion", 19);
- }
- else if(interior == 7)
- {
- dini_FloatSet(File, "ExitX", 225.631);
- dini_FloatSet(File, "ExitY", 1022.480);
- dini_FloatSet(File, "ExitZ", 1084.070);
- dini_IntSet(File, "Int", 7);
- strcpy(HouseInfo[houseid][hDescriere], "Casa foarte mare", 17);
- }
- else if(interior == 12)
- {
- dini_FloatSet(File, "ExitX", 2324.419);
- dini_FloatSet(File, "ExitY", -1145.568);
- dini_FloatSet(File, "ExitZ", 1050.719);
- dini_IntSet(File, "Int", 12);
- strcpy(HouseInfo[houseid][hDescriere], "Unused safe house", 20);
- }
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai creat casa cu id-ul {F48651}%d{FFFFFF}.", houseid);
- SCM(playerid, c_alb, string);
- LoadHouse(houseid);
- OnPropUpdate(1, houseid);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/createhouse{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- } else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmdtext, "/anunt", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 12)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- ShowPlayerDialog(playerid, DIALOG_ANUNT, DIALOG_STYLE_INPUT, "{FFFFFF}Anunt", "{FFFFFF}Introduceti anuntul care doriti sa-l faceti public:", "OK", "Cancel");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/anunt{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/givemoneyall", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new PlayerName[MAX_PLAYER_NAME], bani;
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- if(PlayerInfo[playerid][pAdmin] >= 14)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}givemoneyall [suma]");
- return 1;
- }
- bani = strval(tmp);
- if(bani < 1)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu poti da mai putin de {F48651}1$");
- return 1;
- }
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- GivePlayerMoney(i, bani);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}Administratorul {F48651}%s {67BDFC}a dat la toata lumea cate {F48651}%d${FFFFFF}.", sendername, bani);
- SCM(i, c_alb, string);
- }
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/givemoneyall %d{FFFFFF}'.", sendername, bani);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/setadmin", true) == 0) //setadmin
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}setadmin [playerid/PartOfName] [AdminLevel]");
- return 1;
- }
- new para1;
- new level;
- para1 = ReturnUser(tmp);
- tmp = strtok(cmdtext, idx);
- level = strval(tmp);
- new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- if(PlayerInfo[playerid][pAdmin] >= 15)
- {
- if(IsPlayerConnected(para1))
- {
- if(para1 != INVALID_PLAYER_ID)
- {
- GetPlayerName(para1, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai fost promovat {F48651}admin level %d {FFFFFF}de catre {F48651}%s{FFFFFF}.", level-10, sendername);
- SCM(para1, c_alb, string);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}L-ai promovat pe {F48651}%s {FFFFFF}la gradul de {F48651}admin level %d{FFFFFF}.", giveplayer, level-10);
- SCM(playerid, c_alb, string);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}%s {67BDFC}l-a promovat pe {F48651}%s {67BDFC}la gradul de {F48651}admin nivel %d{FFFFFF}.",sendername, giveplayer, level-10);
- PlayerInfo[para1][pAdmin] = level+10;
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/setadmin %s %d{FFFFFF}'.", sendername, giveplayer, level-10);
- SAM(c_alb, string);
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acest jucator nu este {F48651}online{FFFFFF}.");
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/tod", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}tod [ora]");
- return 1;
- }
- new hour;
- hour = strval(tmp);
- if (PlayerInfo[playerid][pAdmin] >= 10)
- {
- SetWorldTime(hour);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ceasul a fost schimbat la ora {F48651}%d", hour);
- SendClientMessageToAll(c_alb, string);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/tod %d{FFFFFF}'.", sendername, hour);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/addveh", true) == 0) //addveh
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 13)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}addveh [model]");
- return 1;
- }
- new car;
- car = strval(tmp);
- if(car < 400 || car > 611)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Modelul masinilor trebuie sa fie cuprins intre {F48651}400 {FFFFFF}si {F48651}611{FFFFFF}.");
- return 1;
- }
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid, A);
- new carid = CreateVehicle(car, X, Y, Z+1.0, A, -1, -1, 6000);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {F48651}%d {FFFFFF}a fost creata.", carid);
- SCM(playerid, c_alb, string);
- addveh++;
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/addveh %d{FFFFFF}'.", sendername, car);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/delveh", true) == 0) //delveh
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 13)
- {
- if(addveh == 0) SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Nu a fost creata vreo masina.");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}delveh [id]");
- return 1;
- }
- new idv;
- idv = strval(tmp);
- if(idv < addveh+90)
- {
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {67BDFC}%d {F48651}nu a fost creeata{FFFFFF}.", idv);
- SCM(playerid, c_alb, string);
- return 1;
- }
- DestroyVehicle(idv);
- format(string, sizeof(string), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Masina cu id-ul {F48651}%d {FFFFFF}a fost stearsa{FFFFFF}.", idv);
- SCM(playerid, c_alb, string);
- addveh--;
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/delveh %d{FFFFFF}'.", sendername, idv);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/nitro", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 10)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai adugat {F48651}NITRO {FFFFFF}la vehiculul tau.");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/nitro{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/hidra", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdmin] >= 10)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai adaugat {F48651}HIDRAULICE {FFFFFF}la vehiculul tau.");
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/hidra{FFFFFF}'.", sendername);
- SAM(c_alb, string);
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/kick", true) == 0) //goto
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}kick [playerid/PartOfName] [motiv]");
- return 1;
- }
- // new Float:plocx,Float:plocy,Float:plocz;
- new playerid2;
- playerid2 = ReturnUser(tmp);
- if (IsPlayerConnected(playerid2))
- {
- if(playerid2 != INVALID_PLAYER_ID)
- {
- //new motiv[100];
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}kick [playerid/PartOfName] [motiv]");
- return 1;
- }
- if (PlayerInfo[playerid][pAdmin] >= 10)
- {
- format(string, sizeof(string), "{FFFFFF}[{F48651}AdmCmd{FFFFFF}] Ai primit kick de la %s. ( %s ).", sendername, tmp);
- KickWithMessage(playerid2, 0xFF0000FF, string);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/kick %s %s{FFFFFF}'.", sendername, playerid2, tmp);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Acest jucator nu este {67BDFC}online{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/goto", true) == 0) //goto
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}goto [playerid/PartOfName]");
- return 1;
- }
- new Float:plocx,Float:plocy,Float:plocz;
- new playerid2;
- playerid2 = ReturnUser(tmp);
- if (IsPlayerConnected(playerid2))
- {
- if(playerid2 != INVALID_PLAYER_ID)
- {
- if (PlayerInfo[playerid][pAdmin] >= 12)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(playerid2, giveplayer, sizeof(giveplayer));
- GetPlayerPos(playerid2, plocx, plocy, plocz);
- if (GetPlayerState(playerid) == 2)
- {
- new tmpcar = GetPlayerVehicleID(playerid);
- SetVehiclePos(tmpcar, plocx, plocy+2, plocz);
- }
- else
- {
- SetPlayerPos(playerid, plocx, plocy, plocz+1);
- }
- SetPlayerInterior(playerid, GetPlayerInterior(playerid2));
- format(string,sizeof(string),"{FFFFFF}[{67BDFC}System{FFFFFF}] Ai fost teleportat cu succes la {F48651}%s{FFFFFF}.", giveplayer);
- SCM(playerid, c_alb, string);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/goto %s{FFFFFF}'.", sendername, giveplayer);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Acest jucator nu este {67BDFC}online{FFFFFF}.");
- }
- return 1;
- }
- if(strcmp(cmd, "/gethere", true) == 0) //gethere
- {
- if(IsPlayerConnected(playerid))
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Foloseste {67BDFC}/{F48651}gethere [playerid/PartOfName]");
- return 1;
- }
- new Float:plocx,Float:plocy,Float:plocz;
- new playerid2;
- playerid2 = ReturnUser(tmp);
- if (IsPlayerConnected(playerid2))
- {
- if(playerid2 != INVALID_PLAYER_ID)
- {
- if (PlayerInfo[playerid][pAdmin] >= 12)
- {
- GetPlayerPos(playerid, plocx, plocy, plocz);
- SetPlayerInterior(playerid2, GetPlayerInterior(playerid));
- SetPlayerPos(playerid2, plocx, plocy, plocz+0.5);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(playerid2, giveplayer, sizeof(giveplayer));
- new string2[200];
- format(string2, sizeof(string2), "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai fost teleportat la {F48651}%s {FFFFFF}de catre {F48651}%s{FFFFFF}.", sendername, giveplayer);
- SCM(playerid2, c_alb, string2);
- format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/gethere %s{FFFFFF}'.", sendername, giveplayer);
- SAM(c_alb, string);
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Doar adminii au acces la aceasta comanda{FFFFFF}.");
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Acest jucator nu este {F48651}online{FFFFFF}.");
- }
- return 1;
- }
- return 0;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerEnterCheckpoint * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerEnterCheckpoint(playerid)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(CP[playerid] == 1)
- {
- if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514)
- {
- DisablePlayerCheckpoint(playerid);
- SCM(playerid, c_alb, "Loaded!");
- SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z], 4.0);
- CP[playerid] = 2;
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Trebuie sa fii intr-un tir{FFFFFF}.");
- }
- else if(CP[playerid] == 2)
- {
- if(GetVehicleModel(vehicleid) == 515 || GetVehicleModel(vehicleid) == 514)
- {
- new nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, sizeof(nume));
- cursa[playerid] = 0;
- new money = (floatround(MisiuneInfo[playerid][mDistanta]) * 1000 + MisiuneInfo[playerid][mCastig]);
- new scor = GetPlayerScore(playerid);
- new teext[150], teeext[200], mesaj[250];
- CP[playerid] = 0; cursa[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- SetPlayerScore(playerid, scor+3);
- GivePlayerMoney(playerid, money);
- // printf("%d KM | %d/50 | %d$ mCastig | %d$ Total", floatround(MisiuneInfo[playerid][mDistanta]), floatround(MisiuneInfo[playerid][mDistanta])/50, MisiuneInfo[playerid][mCastig], money);
- format(teext, sizeof(teext), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai terminat de transportat {F48651}%s {FFFFFF}de la {F48651}%s {FFFFFF}la {F48651}%s{FFFFFF}.", MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
- SCM(playerid, c_alb, teext);
- format(teeext, sizeof(teeext), "{FFFFFF}[{67BDFC}System{FFFFFF}] Ai primit {F48651}%d${FFFFFF} si {F48651}3 score{FFFFFF} pentru {F48651}%i km{FFFFFF}.", money, floatround(MisiuneInfo[playerid][mDistanta])/100);
- SCM(playerid, c_alb, teeext);
- format(mesaj, sizeof(mesaj), "{FFFFFF}* {F48651}%s {FFFFFF}a transportat {F48651}%s {FFFFFF}de la {F48651}%s {FFFFFF}la {F48651}%s{FFFFFF}.", nume, MisiuneInfo[playerid][mMarfa], MisiuneInfo[playerid][mLoadp], MisiuneInfo[playerid][mUnloadp]);
- SendClientMessageToAll(c_alb, mesaj);
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawHide(playerid, Info[t][playerid]);
- }
- }
- else SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Trebuie sa fii intr-un vehicul{FFFFFF}.");
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerText * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerText(playerid, text[])
- {
- new textv2[300], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof (name));
- format(textv2, sizeof (textv2), "{FFFFFF}%s.", text);
- SendPlayerMessageToAll(playerid, textv2);
- printf("[Chat] %s: %s", name, text);
- return 0;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerConnect * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerConnect(playerid)
- {
- new query[700]; //We use this variable to format our query
- GetPlayerName(playerid, Name[playerid], 24); //Getting player's name
- GetPlayerIp(playerid, IP[playerid], 16); //Getting layer's IP
- mysql_format(mysql, query, sizeof(query),"SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
- // - We use mysql_format instead of format because we can use an %e specifier. %e specifier escapes a string so we can avoid sql injection which means we don't have to use mysql_real_escape_string
- // - Formatting our query; SELECT * FROM `players` WHERE `Username`='%e' means we are selecting all rows in the table called `players` that has your name in Username column
- // - LIMIT 1; we only need 1 result to be shown
- mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
- //lets execute the formatted query and when the execution is done, a callback OnAccountCheck will be called
- //You can name the callback however you like
- for(new i=1; i<sizeof(SeifInfo); i++)
- {
- TrySeifLog[i][playerid] = 0;
- }
- cursa[playerid] = 0;
- Speedo[playerid] = 1;
- SeifLogin[playerid] = 0;
- new CString[200];
- format(CString, sizeof(CString), "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Jucatorul {67BDFC}%s {F48651}s-a conectat la server cu id-ul {67BDFC}%d{FFFFFF}.", pNamee(playerid), playerid);
- SendClientMessageToAll(c_alb, CString);
- /* new File[200];
- format(File, sizeof(File), "Conturi/%s.ini", pNamee(playerid));
- if(fexist(File))
- {
- new iStr[128];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.",pNamee(playerid), playerid);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
- }
- else
- {
- new iStr[128];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai venit %s{FFFFFF}({67BDFC}%d{FFFFFF})!\nAcest nume nu este inregistrat.\nAlege o parola cu care te vei conecta la server.", pNamee(playerid), playerid);
- ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", iStr, "Register", "Kick");
- }
- */
- Info[0][playerid] = CreatePlayerTextDraw(playerid, 569.000000, 104.000000, "Info");
- PlayerTextDrawAlignment(playerid, Info[0][playerid], 2);
- PlayerTextDrawBackgroundColor(playerid, Info[0][playerid], 204);
- PlayerTextDrawFont(playerid, Info[0][playerid], 1);
- PlayerTextDrawLetterSize(playerid, Info[0][playerid], 0.589999, 1.500000);
- PlayerTextDrawColor(playerid, Info[0][playerid], -52);
- PlayerTextDrawSetOutline(playerid, Info[0][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Info[0][playerid], 1);
- PlayerTextDrawUseBox(playerid, Info[0][playerid], 1);
- PlayerTextDrawBoxColor(playerid, Info[0][playerid], 1740504149);
- PlayerTextDrawTextSize(playerid, Info[0][playerid], 731.000000, -146.000000);
- Info[1][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 122.000000, "Marfa: ");
- PlayerTextDrawBackgroundColor(playerid, Info[1][playerid], 204);
- PlayerTextDrawFont(playerid, Info[1][playerid], 2);
- PlayerTextDrawLetterSize(playerid, Info[1][playerid], 0.240000, 1.100000);
- PlayerTextDrawColor(playerid, Info[1][playerid], -192523777);
- PlayerTextDrawSetOutline(playerid, Info[1][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Info[1][playerid], 1);
- PlayerTextDrawUseBox(playerid, Info[1][playerid], 1);
- PlayerTextDrawBoxColor(playerid, Info[1][playerid], 1740504132);
- PlayerTextDrawTextSize(playerid, Info[1][playerid], 731.000000, -146.000000);
- Info[2][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 136.000000, "De la: ");
- PlayerTextDrawBackgroundColor(playerid, Info[2][playerid], 204);
- PlayerTextDrawFont(playerid, Info[2][playerid], 2);
- PlayerTextDrawLetterSize(playerid, Info[2][playerid], 0.240000, 1.100000);
- PlayerTextDrawColor(playerid, Info[2][playerid], -192523777);
- PlayerTextDrawSetOutline(playerid, Info[2][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Info[2][playerid], 1);
- PlayerTextDrawUseBox(playerid, Info[2][playerid], 1);
- PlayerTextDrawBoxColor(playerid, Info[2][playerid], 1740504132);
- PlayerTextDrawTextSize(playerid, Info[2][playerid], 731.000000, -146.000000);
- Info[3][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 150.000000, "La: ");
- PlayerTextDrawBackgroundColor(playerid, Info[3][playerid], 204);
- PlayerTextDrawFont(playerid, Info[3][playerid], 2);
- PlayerTextDrawLetterSize(playerid, Info[3][playerid], 0.240000, 1.100000);
- PlayerTextDrawColor(playerid, Info[3][playerid], -192523777);
- PlayerTextDrawSetOutline(playerid, Info[3][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Info[3][playerid], 1);
- PlayerTextDrawUseBox(playerid, Info[3][playerid], 1);
- PlayerTextDrawBoxColor(playerid, Info[3][playerid], 1740504132);
- PlayerTextDrawTextSize(playerid, Info[3][playerid], 731.000000, -146.000000);
- Info[4][playerid] = CreatePlayerTextDraw(playerid, 501.000000, 164.000000, "Distanta: km");
- PlayerTextDrawBackgroundColor(playerid, Info[4][playerid], 204);
- PlayerTextDrawFont(playerid, Info[4][playerid], 2);
- PlayerTextDrawLetterSize(playerid, Info[4][playerid], 0.240000, 1.100000);
- PlayerTextDrawColor(playerid, Info[4][playerid], -192523777);
- PlayerTextDrawSetOutline(playerid, Info[4][playerid], 1);
- PlayerTextDrawSetProportional(playerid, Info[4][playerid], 1);
- PlayerTextDrawUseBox(playerid, Info[4][playerid], 1);
- PlayerTextDrawBoxColor(playerid, Info[4][playerid], 1740504132);
- PlayerTextDrawTextSize(playerid, Info[4][playerid], 731.000000, -146.000000);
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnAccountCheck * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnAccountCheck(playerid)
- {
- new rows, fields; //a variable that will be used to retrieve rows and fields in the database.
- cache_get_data(rows, fields, mysql);//let's get the rows and fields from the database.
- if(rows) //if there is row
- {//then
- cache_get_row(0, 2, PlayerInfo[playerid][pPassword], mysql, 129);
- //we will load their password into PlayerInfo[playerid][Password] to be used in logging in
- //0 is row, 2 is field. If you're wondering why row is 0; remember we used LIMIT 1 while checking player's account. LIMIT is a limitation of results to be shown. Since we used LIMIT 1, it'd be like;
- // ---> row> ID | Username | Password | IP | Level | .... and so on
- // ^ ^ ^ ^ ^
- // fields 0 1 2 3 4
- //So we're getting row 0, field 2 which is password
- PlayerInfo[playerid][pID] = cache_get_row_int(0, 0); //now let's load player's ID into PlayerInfo[playerid][ID] so we can use it later
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Inainte de a putea juca pe server trebuie sa te loghezi.\n Introdu parola contului tau.", "Login", "Kick"); //And since we found a result from the database, which means, there is an account; we will show a login dialog
- }
- else //if we didn't find any rows from the database, that means, no accounts were found
- {
- //So we show the a dialog register
- ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Alege o parola si introdu-o in casuta de mai jos.", "Register", "Kick");
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnAccountLoad * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnAccountLoad(playerid)
- {
- // ---> row> ID | Username | Password | Level | Money | Admin | Kills | Deaths | HouseKey | Spawn
- // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
- // fields 0 1 2 3 4 5 6 7 8 9
- PlayerInfo[playerid][pLevel] = cache_get_row_int(0, 3);
- PlayerInfo[playerid][pCash] = cache_get_row_int(0, 4);
- PlayerInfo[playerid][pAdmin] = cache_get_row_int(0, 5);
- PlayerInfo[playerid][pKills] = cache_get_row_int(0, 6);
- PlayerInfo[playerid][pDeaths] = cache_get_row_int(0, 7);
- PlayerInfo[playerid][pHouseKey] = cache_get_row_int(0, 8);
- PlayerInfo[playerid][pSpawn] = cache_get_row_int(0, 9);
- //we're getting a field 4 from row 0. And since it's an integer, we use cache_get_row_int
- /* PlayerInfo[playerid][VIP] = cache_get_row_int(0, 5); //Above
- PlayerInfo[playerid][Money] = cache_get_row_int(0, 6);//Above
- PlayerInfo[playerid][posX] = cache_get_row_float(0, 7);//Above. Since player's position is a float, we use cache_get_row_float
- PlayerInfo[playerid][posY] = cache_get_row_float(0, 8);//Above
- PlayerInfo[playerid][posZ] = cache_get_row_float(0, 9);//Above
- */
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);//Let's set their money
- //For player's position, set it once they spawn(OnPlayerSpawn)
- SCM(playerid, -1, "Successful logged in."); //tell them that they have succesfully logged in
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnDialogResponse * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //new File[50];
- //format(File, sizeof(File), "Conturi/%s.ini", pNamee(playerid));
- new query[700];
- switch(dialogid)
- {
- /* case LOGIN:
- {
- if(response)
- {
- if(strlen(inputtext) == 0)
- {
- new iStr[200];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.", pNamee(playerid), playerid);
- return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
- }
- new pw[40];
- format(pw, sizeof(pw), "%s", dini_Get(File, "Password"));
- if(strcmp(inputtext, pw) == 0)
- {
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Te-ai logat cu succes. Apasa {FFFFFF}'{67BDFC}SHIFT{FFFFFF}' {F48651}pentru a continua{FFFFFF}.");
- SetPlayerScore(playerid, dini_Int(File, "Level"));
- GivePlayerMoney(playerid, dini_Int(File, "Cash"));
- PlayerInfo[playerid][pAdmin] = dini_Int(File, "Admin");
- PlayerInfo[playerid][pKills] = dini_Int(File, "Kills");
- PlayerInfo[playerid][pDeaths] = dini_Int(File, "Deaths");
- PlayerInfo[playerid][pHouseKey] = dini_Int(File, "HouseKey");
- PlayerInfo[playerid][pSpawn] = dini_Int(File, "Spawn");
- for (new t; t != sizeof (Logo); ++t)
- {
- TextDrawShowForPlayer(playerid, Logo[t]);
- }
- }
- else
- {
- new iStr[200];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.", pNamee(playerid), playerid);
- return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
- }
- }
- else Kick(playerid);
- }
- case REGISTER:
- {
- if(response)
- {
- if(strlen(inputtext) == 0)
- {
- new iStr[200];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai venit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF})!\nAcest nume nu este inregistrat.\nAlege o parola cu care te vei conecta la server.", pNamee(playerid), playerid);
- return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "Register", iStr, "Register", "Leave");
- }
- dini_Create(File);
- dini_Set(File, "Password", inputtext);
- dini_IntSet(File, "Level", 5);
- dini_IntSet(File, "Cash", 100000);
- dini_IntSet(File, "Admin", 0);
- dini_IntSet(File, "Kills", 10);
- dini_IntSet(File, "Deaths", 0);
- dini_IntSet(File, "HouseKey", 255);
- dini_IntSet(File, "Spawn", 1);
- new iStr[128];
- format(iStr, sizeof(iStr), "{FFFFFF}Bine ai revenit {67BDFC}%s{FFFFFF}({67BDFC}%d{FFFFFF}).\nIntrodu parola pentru a continua.",pNamee(playerid), playerid);
- ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", iStr, "Login", "Kick");
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {F48651}Contul tau a fost {67BDFC}inregistrat{FFFFFF}!{F48651} Te rog logheaza-te!");
- }
- else Kick(playerid);
- }*/
- case D_Login:
- {
- if(!response) Kick(playerid); //if they clicked Quit, we will kick them
- new hpass[129]; //for password hashing
- WP_Hash(hpass, 129, inputtext); //hashing inputtext
- if(!strcmp(hpass, PlayerInfo[playerid][pPassword])) //remember we have loaded player's password into this variable, PlayerInfo[playerid][pPassword] earlier. Now let's use it to compare the hashed password with password that we load
- { //if the hashed password matches with the loaded password from database
- mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
- //let's format our query
- //once again, we select all rows in the table that has your name and limit the result
- mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
- //lets execute the formatted query and when the execution is done, a callback OnAccountLoad will be called
- //You can name the callback however you like
- }
- else //if the hashed password didn't match with the loaded password(PlayerInfo[playerid][pPassword])
- {
- //we tell them that they have inserted a wrong password
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Parola introdusa este incorecta.", "Login", "Kick");
- }
- }
- case D_Register:
- {
- if(!response) return Kick(playerid); //if they clicked Quit, we will kick them
- if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Parola trebuie sa contina cel putin 6 caractere.", "Register", "Kick");
- //strlen checks a lenght of a string. so if player types their password that is lower than 6, we tell them; Your password must be at least 6 characters long!
- WP_Hash(PlayerInfo[playerid][pPassword], 129, inputtext); //hashing inputtext
- mysql_format(mysql, query, sizeof(query), "INSERT INTO `players`(`Username`, `Password`, `IP`, `pLevel`, `Money`, `AdminLevel`, `Kills`, `Deaths`, `HouseKey`, `Spawn`) VALUES (%e, %s, %s, 10, 100000, 0, 0, 0, 255, 1)", Name[playerid], PlayerInfo[playerid][pPassword], IP[playerid]);
- //Now let's create a new row and insert player's information in it
- mysql_tquery(mysql, query, "", "");
- //let's execute the query
- ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Introduceti parola", "Login", "Kick");
- }
- case DIALOG_ANUNT:
- {
- if(response)
- {
- if(strlen(inputtext) < 10 || strlen(inputtext) > 60)
- return SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Anuntul trebuie sa contina intre 10 si 60 caractere.");
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new anuntt[71], dela[15+MAX_PLAYER_NAME];
- format(dela, sizeof(dela), " * Anunt de la: %s.", sendername);
- format(anuntt, sizeof(anuntt), "%s", inputtext);
- TextDrawSetString(Anunt[0], anuntt);
- TextDrawSetString(Anunt[1], dela);
- TextDrawShowForAll(Anunt[0]);TextDrawShowForAll(Anunt[1]);
- SetTimer("AscundeTD", 15000, true);
- }
- else SCM(playerid, c_alb, "Ai renuntat");
- }
- case DIALOG_START:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- new load[2000], sss[50], ss[52];
- for(new p=0; p<11; p++)
- {
- format(sss, sizeof(sss), "%d. %s - %s", p+1, Curse_Fluid[p][idx1], Curse_Fluid[p][idx2]);
- format(ss, sizeof(ss), "%s \n", sss);
- strcat(load, ss);
- }
- ShowPlayerDialog(playerid, DIALOG_BENZINA, DIALOG_STYLE_LIST, "{FFFFFF}Cursa", load, "Next", "Cancel");
- }
- }
- }
- else SCM(playerid, c_alb, "Canceled");
- }
- case DIALOG_BENZINA:
- {
- if(response)
- {
- new idt;
- if(listitem == 0)
- idt = 0;// new string[200];
- if(listitem == 1)
- idt = 1;
- if(listitem == 2)
- idt = 2;
- if(listitem == 3)
- idt = 3;
- if(listitem == 4)
- idt = 4;
- if(listitem == 5)
- idt = 5;
- if(listitem == 5)
- idt = 5;
- if(listitem == 6)
- idt = 6;
- if(listitem == 7)
- idt = 7;
- if(listitem == 8)
- idt = 8;
- if(listitem == 9)
- idt = 9;
- if(listitem == 10)
- idt = 10;
- if(listitem == 11)
- idt = 11;
- if(listitem == 12)
- idt = 12;
- format(cargo_marfa, sizeof(cargo_marfa), "{FFFFFF}** {F48651}Transporti: {67BDFC}%s \n{FFFFFF}** {F48651}Incarci la: {67BDFC}%s\n{FFFFFF}** {F48651}Descarci la: {67BDFC}%s", Curse_Fluid[idt][idx0], Curse_Fluid[idt][idx1], Curse_Fluid[idt][idx2]);
- ShowPlayerDialog(playerid, MIS, DIALOG_STYLE_MSGBOX, "Informatii cursa", cargo_marfa, "Ok", "");
- MisiuneInfo[playerid][mLoadp_x] = Curse_Fluid[idt][idx3];
- MisiuneInfo[playerid][mLoadp_y] = Curse_Fluid[idt][idx4];
- MisiuneInfo[playerid][mLoadp_z] = Curse_Fluid[idt][idx5];
- MisiuneInfo[playerid][mUnLoadp_x] = Curse_Fluid[idt][idx6];
- MisiuneInfo[playerid][mUnLoadp_y] = Curse_Fluid[idt][idx7];
- MisiuneInfo[playerid][mUnLoadp_z] = Curse_Fluid[idt][idx8];
- strcpy(MisiuneInfo[playerid][mMarfa], Curse_Fluid[idt][idx0], 40);
- strcpy(MisiuneInfo[playerid][mLoadp], Curse_Fluid[idt][idx1], 40);
- strcpy(MisiuneInfo[playerid][mUnloadp], Curse_Fluid[idt][idx2], 40);
- SetPlayerCheckpoint(playerid, MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], 5.0);
- CP[playerid] = 1;
- cursa[playerid] = 1;
- MisiuneInfo[playerid][mCastig] = Curse_Fluid[idt][idx9];
- MisiuneInfo[playerid][mDistanta] = GetDistance(MisiuneInfo[playerid][mLoadp_x], MisiuneInfo[playerid][mLoadp_y], MisiuneInfo[playerid][mLoadp_z], MisiuneInfo[playerid][mUnLoadp_x], MisiuneInfo[playerid][mUnLoadp_y], MisiuneInfo[playerid][mUnLoadp_z])/100;
- new nr = floatround(MisiuneInfo[playerid][mDistanta]);
- new m[30], dl[30], l[30], d[40];
- format(m, sizeof(m), "Marfa: %s", Curse_Fluid[idt][idx0]);
- PlayerTextDrawSetString(playerid, Info[1][playerid], m);
- format(dl, sizeof(dl), "De la: %s", Curse_Fluid[idt][idx1]);
- PlayerTextDrawSetString(playerid, Info[2][playerid], dl);
- format(l, sizeof(m), "La: %s", Curse_Fluid[idt][idx2]);
- PlayerTextDrawSetString(playerid, Info[3][playerid], l);
- format(d, sizeof(d), "Distanta: %i km", nr);
- PlayerTextDrawSetString(playerid, Info[4][playerid], d);
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawShow(playerid, Info[t][playerid]);
- }
- //format(string, sizeof(string), "{FFFFFF}[{DD0000}CMD{FFFFFF}] {F48651}%s {B1BBBE}a folosit {FFFFFF}'{67BDFC}/start{FFFFFF}'.", sendername);
- //SAM(c_alb, string);
- //}
- //}
- } else SCM(playerid, c_alb, "Canceled");
- }
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerSpawn * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerSpawn(playerid)
- {
- if(PlayerInfo[playerid][pSpawn] == 1)
- SetPlayerPos(playerid, 2262.1, -2250.6, 13.5);
- else if(PlayerInfo[playerid][pSpawn] == 2)
- {
- SetPlayerInterior(playerid, HouseInfo[playerid][hInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[playerid][hVir]);
- SetPlayerPos(playerid, HouseInfo[playerid][hExitX], HouseInfo[playerid][hExitY], HouseInfo[playerid][hExitZ]);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] Te-ai spawnat in casa.");
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerDisconnect * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerDisconnect(playerid, reason)
- {
- new pname[MAX_PLAYER_NAME], cstring[200 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- switch(reason)
- {
- case 0: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A pierdut conexiunea{FFFFFF}].", pname, playerid);
- case 1: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A iesit singur{FFFFFF}].", pname, playerid);
- case 2: format(cstring, sizeof(cstring), "{FFFFFF}[{67BDFC}System{FFFFFF}] {67BDFC}%s{FFFFFF}[{F48651}ID {67BDFC}%d{FFFFFF}] [{F48651}A primit kick{FFFFFF}].", pname, playerid);
- }
- SAM(c_alb, cstring);
- new query[700];//query[128] is for formatting our query and Float:pos[3] is for getting and saving player's position
- //GetPlayerPos(playerid, pos[0], pos[1], pos[2]); //let's get player's position when they leave your server
- mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `pLevel`=%d, `Money`=%d, `AdminLevel`=%d, `Kills`=%d, `Deaths`=%d, `HouseKey`=%d, `Spawn`=%d WHERE `ID`=%d", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pHouseKey], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pID]);
- //We update the table(`players`) by getting player's admin level, vip level, money, and positions and save them in the database
- mysql_tquery(mysql, query, "", "");
- //let's execute the query.
- for(new t; t != sizeof (Logo); ++t)
- {
- TextDrawHideForPlayer(playerid, Logo[t]);
- }
- for(new t; t != sizeof(Info); ++t)
- {
- PlayerTextDrawDestroy(playerid, Info[t][playerid]);
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerDeath * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerDeath(playerid, killerid, reason)
- {
- //PlayerInfo[killerid][pKills] ++;
- PlayerInfo[playerid][pDeaths] ++;
- return 1;
- }
- //*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnGameModeInit * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnGameModeInit()
- {
- mysql_debug(1); //Let's enable debugging so we can detect a problem(if there is)
- mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS); //This function will connect your server to database. Remember we have defined our host, username, database and password. It's time to use it here.
- if(mysql_errno(mysql) != 0)//This will tell if your connection to database is successful or not. If it's not, check your host, username, database and password. Make sure they all right.
- //else print("[Done] Serverul s-a conectat la baza de date!");
- //If we're cool, it's time to create a table for your database.
- /* mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `players`(\
- `ID` int(10) NOT NULL AUTO_INCREMENT, \
- `Username` VARCHAR(24) NOT NULL, \
- `Password` VARCHAR(129) NOT NULL, \
- `IP` VARCHAR(16) NOT NULL, \
- `pLevel` INT(5) NOT NULL, \
- `Money` INT(10) NOT NULL, \
- `AdminLevel` INT(3) NOT NULL, \
- `Kills` INT(5) NOT NULL, \
- `Deaths` INT(5) NOT NULL, \
- `HouseKey` INT(4) NOT NULL, \
- `Spawn` INT(3) NOT NULL, \
- PRIMARY KEY (`ID`))", "", "");*/
- // 60000ms = 60 seconds = 1 minute
- addveh = 0;
- DisableInteriorEnterExits();
- UsePlayerPedAnims();
- SendRconCommand("gamemodetext RRT v0.1");
- SendRconCommand("mapname RRT v0.1");
- //SendRconCommand("loadfs object");
- SetTimer("SendMSG", 300000, true); // 5minute
- SetTimer("SeteazaTimp", 1000, true);
- SetTimer("RWeather", RWTime, true);
- //SetTimer("Zones_Update", 500, 1);
- vtimer = SetTimer("SpeedoMeter", 350, 1);
- AddPlayerClass(3, -516.1736, -540.3485, 25.5234, 0.0, 0, 1, 43, 999, 41, 1);
- orase = CreateMenu("Orase", 1, 200.0, 100.0, 150.0, 150.0);
- AddMenuItem(orase, 0, "Los Santos");
- AddMenuItem(orase, 0, "Las Venturas");
- oras_lv = CreateMenu("Job", 1, 200.0, 100.0, 150.0, 150.0);
- AddMenuItem(oras_lv, 0, "Cargo");
- AddMenuItem(oras_lv, 0, "Ore");
- AddMenuItem(oras_lv, 0, "Fluid");
- oras_ls = CreateMenu("Job", 1, 200.0, 100.0, 150.0, 150.0);
- AddMenuItem(oras_ls, 0, "Cargo");
- AddMenuItem(oras_ls, 0, "Ore");
- AddMenuItem(oras_ls, 0, "Fluid");
- //LoadProperty();
- for(new i=0; i<MAX_HOUSES; i++)
- {
- LoadHouse(i);
- OnPropUpdate(1, i);
- }
- for(new s=0; s<MAX_PLAYERS; s++)
- {
- LoadSeif(s);
- OnPropUpdate(2, s);
- }
- Logo[0] = TextDrawCreate(16.000000, 405.000000, "v0.0.1");
- TextDrawAlignment(Logo[0], 2);
- TextDrawBackgroundColor(Logo[0], 51);
- TextDrawFont(Logo[0], 1);
- TextDrawLetterSize(Logo[0], 0.160000, 1.099999);
- TextDrawColor(Logo[0], -192523828);
- TextDrawSetOutline(Logo[0], 1);
- TextDrawSetProportional(Logo[0], 1);
- TextDrawUseBox(Logo[0], 1);
- TextDrawBoxColor(Logo[0], 1740504115);
- TextDrawTextSize(Logo[0], 0.000000, -50.000000);
- Logo[1] = TextDrawCreate(16.000000, 378.000000, "Regional");
- TextDrawAlignment(Logo[1], 2);
- TextDrawBackgroundColor(Logo[1], 51);
- TextDrawFont(Logo[1], 1);
- TextDrawLetterSize(Logo[1], 0.220000, 1.099999);
- TextDrawColor(Logo[1], -192523828);
- TextDrawSetOutline(Logo[1], 1);
- TextDrawSetProportional(Logo[1], 1);
- TextDrawUseBox(Logo[1], 1);
- TextDrawBoxColor(Logo[1], 1740504115);
- TextDrawTextSize(Logo[1], 0.000000, -50.000000);
- Logo[2] = TextDrawCreate(16.000000, 392.000000, "Trucking");
- TextDrawAlignment(Logo[2], 2);
- TextDrawBackgroundColor(Logo[2], 51);
- TextDrawFont(Logo[2], 1);
- TextDrawLetterSize(Logo[2], 0.220000, 1.099999);
- TextDrawColor(Logo[2], -192523828);
- TextDrawSetOutline(Logo[2], 1);
- TextDrawSetProportional(Logo[2], 1);
- TextDrawUseBox(Logo[2], 1);
- TextDrawBoxColor(Logo[2], 1740504115);
- TextDrawTextSize(Logo[2], 0.000000, -50.000000);
- Logo[3] = TextDrawCreate(16.000000, 364.000000, "Romania");
- TextDrawAlignment(Logo[3], 2);
- TextDrawBackgroundColor(Logo[3], 51);
- TextDrawFont(Logo[3], 1);
- TextDrawLetterSize(Logo[3], 0.220000, 1.099999);
- TextDrawColor(Logo[3], -192523828);
- TextDrawSetOutline(Logo[3], 1);
- TextDrawSetProportional(Logo[3], 1);
- TextDrawUseBox(Logo[3], 1);
- TextDrawBoxColor(Logo[3], 1740504115);
- TextDrawTextSize(Logo[3], 0.000000, -50.000000);
- Data[0] = TextDrawCreate(547.000000, 11.000000, "--");
- TextDrawFont(Data[0], 3);
- TextDrawLetterSize(Data[0], 0.399999, 1.600000);
- TextDrawColor(Data[0], -192523828);
- Data[1] = TextDrawCreate(547.000000, 28.000000, "--");
- TextDrawFont(Data[1], 3);
- TextDrawLetterSize(Data[1], 0.399999, 1.600000);
- TextDrawColor(Data[1], -192523828);
- Anunt[0] = TextDrawCreate(318.000000, 359.000000, "Anunt:");
- TextDrawAlignment(Anunt[0], 2);
- TextDrawBackgroundColor(Anunt[0], 255);
- TextDrawFont(Anunt[0], 1);
- TextDrawLetterSize(Anunt[0], 0.310000, 1.199999);
- TextDrawColor(Anunt[0], -192523777);
- TextDrawSetOutline(Anunt[0], 1);
- TextDrawSetProportional(Anunt[0], 1);
- TextDrawUseBox(Anunt[0], 1);
- TextDrawBoxColor(Anunt[0], 1740504132);
- TextDrawTextSize(Anunt[0], 600.000000, 340.000000);
- Anunt[1] = TextDrawCreate(148.000000, 343.000000, "Anunt de la:");
- TextDrawBackgroundColor(Anunt[1], 255);
- TextDrawFont(Anunt[1], 2);
- TextDrawLetterSize(Anunt[1], 0.339999, 1.399999);
- TextDrawColor(Anunt[1], -192523777);
- TextDrawSetOutline(Anunt[1], 1);
- TextDrawSetProportional(Anunt[1], 1);
- TextDrawUseBox(Anunt[1], 1);
- TextDrawBoxColor(Anunt[1], 1740504132);
- TextDrawTextSize(Anunt[1], 488.000000, 340.000000);
- //============================== CreateObject ==============================
- new LosSantos1 = CreateObject(19353, 2141.7644, -2236.2141, 15.4652, 0.7000, 0.0000, 134.9909);
- SetObjectMaterialText(LosSantos1, "Los Santos", 0, 130, "ComicSansMS", 100, 1, -256, 0, 1);
- new CargoJob = CreateObject(19353, 2141.7653, -2236.2004, 14.8199, 0.0000, 0.0000, 134.9741);
- SetObjectMaterialText(CargoJob, "* cargo job *", 0, 140, "ComicSansMS", 100, 1, -65281, 0, 1);
- new RRT1 = CreateObject(19353, 2141.7377, -2236.2512, 13.1799, 0.0000, 0.0000, 135.0262);
- SetObjectMaterialText(RRT1, "{76D735}R.R.T.", 0, 140, "CourierNew", 100, 1, -16468988, 0, 1);
- vama_LSLV = CreateObject(968, 1730.41724, 462.13879, 31.90910, 0.00000, -90.00000, -19.00000);
- vama_LVLS = CreateObject(968, 1699.93262, 450.43240, 31.88910, 0.00000, 90.00000, -19.00000);
- // ============================= CreateVehicle =============================
- //Tiruri
- CreateVehicle(541, 2252.7896, -2278.0391, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2257.4121, -2273.4370, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2247.9534, -2282.9631, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2243.2429, -2287.5835, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2238.5066, -2292.3184, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2233.8591, -2296.9128, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2229.1243, -2301.7800, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2224.1353, -2306.8665, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2219.2432, -2311.7114, 14.3078, 45.0000, -1, -1, 1000); // LS _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7092, 945.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 960.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 955.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 950.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 940.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 935.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 930.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 925.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 920.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 915.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 2882.7000, 910.0000, 11.7000, 90.0000, -1, -1, 1000); // LV _ Cargo _ RoadTrain
- CreateVehicle(515, 924.6030, 1669.3523, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(515, 924.6030, 1696.0000, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(515, 924.6030, 1688.7169, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(515, 924.6030, 1682.1368, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(515, 924.6030, 1675.4846, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(515, 924.6030, 1703.0000, 11.0031, 240.0000, -1, -1, 1000); // LV _ ORE _ RoadTrain
- CreateVehicle(514, 950.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(514, 945.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(514, 940.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(514, 930.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(514, 935.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(514, 925.0000, 1629.0000, 10.4800, 0.0000, -1, -1, 1000); // LV _ ORE _ Taker
- CreateVehicle(515, 1663.0000, 1205.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1200.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1195.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1190.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1185.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1180.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- CreateVehicle(515, 1663.0000, 1175.0000, 11.7800, 270.0000, -1, -1, 1000); // LV _ FUEL _ RoadTrain
- //Trailer
- CreateVehicle(435, 2240.0110, -2229.2168, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2234.3779, -2223.4226, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2229.2698, -2218.0518, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2223.7935, -2212.6113, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2212.8635, -2201.3330, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2218.4292, -2207.0735, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2207.2556, -2196.1536, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2177.8228, -2210.6594, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2197.5813, -2191.3069, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2190.6023, -2197.6255, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2184.0828, -2204.4814, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2171.9846, -2216.1304, 14.5, 170.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2245.2988, -2234.5396, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2223.4487, -2252.9355, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2218.6594, -2248.1018, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2213.4744, -2242.9456, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2208.2178, -2237.4695, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2202.6345, -2231.9873, 14.5, -225.0000, -1, -1, 1000); // LS _ Cargo _ Trailer
- CreateVehicle(435, 2786.4614, 971.5320, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2785.9741, 979.7285, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2786.4521, 986.7941, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2786.3574, 993.1647, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2786.3252, 999.5724, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2786.8430, 1006.2341, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2787.5334, 1013.3503, 11.3, -135.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2810.7585, 1013.6876, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2804.6987, 1013.5463, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2816.6812, 1013.7043, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2822.7178, 1013.8634, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2828.5789, 1013.4830, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2834.5049, 1013.6192, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(435, 2840.2200, 1013.7421, 11.3, 180.0000, -1, -1, 1000); // LV _ Cargo _ Trailer
- CreateVehicle(450, 945.9777, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 950.7542, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 955.8819, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 961.0938, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 966.1882, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 971.1977, 1718.5000, 11.0031, 180.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 985.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 990.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 980.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 975.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 970.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 965.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(450, 960.0000, 1628.2000, 10.4800, 25.0000, -1, -1, 1000); // LV _ ORE _ Trailer
- CreateVehicle(584, 1664.4000, 1254.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1259.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1249.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1244.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1239.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1234.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1229.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1224.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1219.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- CreateVehicle(584, 1664.4000, 1214.0000, 11.7800, 260.0000, -1, -1, 1000); // LV _ FLUID _ Trailer
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- Speedo[i] = 1;
- Name_V[i] = TextDrawCreate(534.000000, 341.000000, " ");
- TextDrawBackgroundColor(Name_V[i], 255);
- TextDrawFont(Name_V[i], 1);
- TextDrawLetterSize(Name_V[i], 0.270000, 1.200000);
- TextDrawColor(Name_V[i], -1);
- TextDrawSetOutline(Name_V[i], 1);
- TextDrawSetProportional(Name_V[i], 1);
- Speed[i] = TextDrawCreate(534.000000, 356.000000, " ");
- TextDrawBackgroundColor(Speed[i], 255);
- TextDrawFont(Speed[i], 1);
- TextDrawLetterSize(Speed[i], 0.270000, 1.200000);
- TextDrawColor(Speed[i], -1);
- TextDrawSetOutline(Speed[i], 1);
- TextDrawSetProportional(Speed[i], 1);
- HP[i] = TextDrawCreate(534.000000, 371.000000, " ");
- TextDrawBackgroundColor(HP[i], 255);
- TextDrawFont(HP[i], 1);
- TextDrawLetterSize(HP[i], 0.270000, 1.200000);
- TextDrawColor(HP[i], -1);
- TextDrawSetOutline(HP[i], 1);
- TextDrawSetProportional(HP[i], 1);
- HG[i] = TextDrawCreate(534.000000, 386.000000, " ");
- TextDrawBackgroundColor(HG[i], 255);
- TextDrawFont(HG[i], 1);
- TextDrawLetterSize(HG[i], 0.270000, 1.200000);
- TextDrawColor(HG[i], -1);
- TextDrawSetOutline(HG[i], 1);
- TextDrawSetProportional(HG[i], 1);
- Zones[i] = TextDrawCreate(534.000000, 401.000000, " ");
- TextDrawBackgroundColor(Zones[i], 255);
- TextDrawFont(Zones[i], 1);
- TextDrawLetterSize(Zones[i], 0.270000, 1.200000);
- TextDrawColor(Zones[i], -1);
- TextDrawSetOutline(Zones[i], 1);
- TextDrawSetProportional(Zones[i], 1);
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnGameModeExit * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnGameModeExit()
- {
- KillTimer(vtimer);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- TextDrawDestroy(HG[i]);
- TextDrawDestroy(HP[i]);
- TextDrawDestroy(Speed[i]);
- TextDrawDestroy(Name_V[i]);
- TextDrawDestroy(Zones[i]);
- /* new File[200]; format(File, sizeof(File), "Conturi/%s.ini", pNamee(i));
- dini_IntSet(File, "Level", GetPlayerScore(i));
- dini_IntSet(File, "Cash", GetPlayerMoney(i));
- dini_IntSet(File, "Admin", PlayerInfo[i][pAdmin]);
- dini_IntSet(File, "Kills", PlayerInfo[i][pKills]);
- dini_IntSet(File, "Deaths", PlayerInfo[i][pDeaths]);
- dini_IntSet(File, "HouseKey", PlayerInfo[i][pHouseKey]);
- dini_IntSet(File, "Spawn", PlayerInfo[i][pSpawn]);
- */ }
- for(new i=0; i<MAX_HOUSES; i++)
- {
- SaveHouse(i);
- }
- for(new s=0; s<MAX_PLAYERS; s++)
- {
- SaveSeif(s);
- }
- //SendRconCommand("unloadfs object");
- //SendRconCommand("unloadfs tdimg");
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerKeyStateChange * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- //Bariere
- if(newkeys & KEY_HORN && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1724.7449,458.2328,32.0400))
- {
- SetObjectRot(vama_LSLV, 0.0, -10.0, -19.0);
- GivePlayerMoney(playerid, -250);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai platit la vama {F48651}250${FFFFFF}, iar bariera s-a deschis pentru {F48651}4 secunde{FFFFFF}!");
- SetTimerEx("Inchide_vama_LSLV", 4000, false, "i", playerid);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1704.9524,454.5538,32.0400))
- {
- SetObjectRot(vama_LVLS, 0.0, 10.0, -19.0);
- GivePlayerMoney(playerid, -250);
- SCM(playerid, c_alb, "{FFFFFF}[{67BDFC}System{FFFFFF}] {FFFFFF}Ai platit la vama {F48651}250${FFFFFF}, iar bariera s-a deschis pentru {F48651}4 secunde{FFFFFF}!");
- SetTimerEx("Inchide_vama_LVLS", 4000, false, "i", playerid);
- }
- }
- }
- //CruiseControl
- if (newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)/* && !(oldkeys & CCKey)*/
- {
- new vid = GetPlayerVehicleID(playerid);
- if (GetVehicleSpeed(vid) == 0) return false;
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(vid, x, y, z);
- GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]);
- DistanceFlat(0, 0, x, y, PlayerCruiseSpeed[playerid]);
- SetTimerEx("CruiseControl", 400, false, "d", playerid);
- SCM(playerid, c_alb, "{FFFFFF}Pilot automat: {67BDFC}activat{FFFFFF}."); // === Remove this if not needed ===
- }
- else if (PlayerCruiseSpeed[playerid] != 0.00 && (newkeys & KEY_HANDBRAKE))
- {
- PlayerCruiseSpeed[playerid] = 0.00;
- }
- //Enter-Exit House
- if(newkeys & 16 && !IsPlayerInAnyVehicle(playerid))
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.7, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVir]) //Is player near house entrance, and if player is in interior of that house + virtual world
- {
- SetPlayerPos(playerid, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]);
- SetPlayerInterior(playerid, HouseInfo[i][hInt]);
- SetPlayerVirtualWorld(playerid, HouseInfo[i][hVir]);
- }
- else if(IsPlayerInRangeOfPoint(playerid, 1.7, HouseInfo[i][hExitX], HouseInfo[i][hExitY], HouseInfo[i][hExitZ]))// && GetPlayerInterior(playerid) == HouseInfo[i][hInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hVir]) //Same as the previous IsPlayerInRangeOfPoint, but now if the player is near the house exit+int+vir
- {
- SetPlayerPos(playerid, HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SAM * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SAM(color, string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- SCM(i, color, string);
- }
- }
- }
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * Zones_Update * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public Zones_Update()
- {
- new zone[MAX_ZONE_NAME], string[30];
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
- format(string,sizeof(string),"%s", zone);
- TextDrawSetString(Zones[i], string);
- //TextDrawShowForPlayer(i, Zones[i]);
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * LoadHouse * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public LoadHouse(houseid)
- {
- new File[512];
- format(File, 512, "Case/%d.ini", houseid);
- if(!dini_Exists(File)) return 0;
- HouseInfo[houseid][hID] = dini_Int(File, "ID");
- HouseInfo[houseid][hLevel] = dini_Int(File, "Level");
- HouseInfo[houseid][hPrice] = dini_Int(File, "Price");
- HouseInfo[houseid][hOwned] = dini_Bool(File, "Owned") ? true : false;
- strcpy(HouseInfo[houseid][hOwner], dini_Get(File, "Owner"), MAX_PLAYER_NAME);
- HouseInfo[houseid][hEnterX] = dini_Float(File, "EnterX");
- HouseInfo[houseid][hEnterY] = dini_Float(File, "EnterY");
- HouseInfo[houseid][hEnterZ] = dini_Float(File, "EnterZ");
- HouseInfo[houseid][hExitX] = dini_Float(File, "ExitX");
- HouseInfo[houseid][hExitY] = dini_Float(File, "ExitY");
- HouseInfo[houseid][hExitZ] = dini_Float(File, "ExitZ");
- HouseInfo[houseid][hInt] = dini_Int(File, "Int");
- HouseInfo[houseid][hVir] = dini_Int(File, "Vir");
- strcpy(HouseInfo[houseid][hDescriere], dini_Get(File, "Descriere"), 20);
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * LoadSeif * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public LoadSeif(seifid)
- {
- new File[255];
- format(File, 255, "Seifuri/%d.ini", seifid);
- if(!dini_Exists(File)) return 0;
- SeifInfo[seifid][sID] = dini_Int(File, "ID");
- SeifInfo[seifid][sMoney] = dini_Int(File, "Money");
- strcpy(SeifInfo[seifid][sPass], dini_Get(File, "Password"), 50);
- SeifInfo[seifid][sEnterX] = dini_Float(File, "EnterX");
- SeifInfo[seifid][sEnterY] = dini_Float(File, "EnterY");
- SeifInfo[seifid][sEnterZ] = dini_Float(File, "EnterZ");
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SaveHouse * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SaveHouse(houseid)
- {
- new File[512];
- format(File, 512, "Case/%d.ini", houseid);
- if(!dini_Exists(File)) return 0;
- dini_IntSet(File, "ID", HouseInfo[houseid][hID]);
- dini_IntSet(File, "Level", HouseInfo[houseid][hLevel]);
- dini_IntSet(File, "Price", HouseInfo[houseid][hPrice]);
- dini_BoolSet(File,"Owned" , HouseInfo[houseid][hOwned] ); // daca e bool stergi integer
- dini_Set(File, "Owner", HouseInfo[houseid][hOwner]);
- dini_FloatSet(File, "EnterX", HouseInfo[houseid][hEnterX]);
- dini_FloatSet(File, "EnterY", HouseInfo[houseid][hEnterY]);
- dini_FloatSet(File, "EnterZ", HouseInfo[houseid][hEnterZ]);
- dini_FloatSet(File, "ExitX", HouseInfo[houseid][hExitX]);
- dini_FloatSet(File, "ExitY", HouseInfo[houseid][hExitY]);
- dini_FloatSet(File, "ExitZ", HouseInfo[houseid][hExitZ]);
- dini_IntSet(File, "Int", HouseInfo[houseid][hInt]);
- dini_IntSet(File, "Vir", HouseInfo[houseid][hVir]);
- if(HouseInfo[houseid][hInt] == 3)
- {
- dini_Set(File, "Descriere", "Casa mare");
- }
- if(HouseInfo[houseid][hInt] == 5)
- {
- dini_Set(File, "Descriere", "Madd Doggs Mansion");
- }
- else if(HouseInfo[houseid][hInt] == 7)
- {
- dini_Set(File, "Descriere", "Casa foarte mare");
- }
- else if(HouseInfo[houseid][hInt] == 12)
- {
- dini_Set(File, "Descriere", "Unused safe house");
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SaveSeif * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SaveSeif(seifid)
- {
- new File[255];
- format(File, 255, "Seifuri/%d.ini", seifid);
- if(!dini_Exists(File)) return 0;
- dini_IntSet(File, "ID", SeifInfo[seifid][sID]);
- dini_IntSet(File, "Money", SeifInfo[seifid][sMoney]);
- dini_Set(File, "Password", SeifInfo[seifid][sPass]);
- dini_FloatSet(File, "EnterX", SeifInfo[seifid][sEnterX]);
- dini_FloatSet(File, "EnterY", SeifInfo[seifid][sEnterY]);
- dini_FloatSet(File, "EnterZ", SeifInfo[seifid][sEnterZ]);
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPlayerEnterVehicle * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- Speedo[playerid] = 1;
- return 1;
- }
- public AscundeTD()
- {
- TextDrawHideForAll(Anunt[0]);TextDrawHideForAll(Anunt[1]);
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SpeedoMeter * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SpeedoMeter()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerInAnyVehicle(i) && Speedo[i] == 1)
- {
- new sp[5][100];
- new Float:health, Float:xX, Float:yY, Float:zZ;
- new vehicleid = GetPlayerVehicleID(i);
- new viteza = GetVehicleSpeed(vehicleid);
- new zone[MAX_ZONE_NAME];
- GetVehicleHealth(vehicleid, health);
- GetPlayerPos(i, xX, yY, zZ);
- GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
- format(sp[0], 100, "~p~Vehicul~w~: ~w~%s", VehicleNames[GetVehicleModel(vehicleid)-400]);
- if(viteza <= 120) format(sp[1], 100, "~p~Viteza~w~: ~w~%d ~p~km/h",GetVehicleSpeed(vehicleid));
- else format(sp[1], 100, "~p~Viteza~w~: ~r~%d ~p~km/h",GetVehicleSpeed(vehicleid));
- if(health >= 350) format(sp[2], 100, "~p~Viata~w~: ~w~%.2f ~p~hp",health);
- else format(sp[2], 100, "~p~Viata~w~: ~r~%.2f ~p~hp",health);
- format(sp[3], 100, "~p~Inaltime~w~: ~w~%.1f ~p~m",zZ);
- format(sp[4], 100 ,"~p~Zona~w~: \t~w~%s", zone);
- TextDrawSetString(Name_V[i], sp[0]);
- TextDrawSetString(Speed[i], sp[1]);
- TextDrawSetString(HP[i], sp[2]);
- TextDrawSetString(HG[i], sp[3]);
- TextDrawSetString(Zones[i], sp[4]);
- TextDrawShowForPlayer(i, Name_V[i]);
- TextDrawShowForPlayer(i, Speed[i]);
- TextDrawShowForPlayer(i, HP[i]);
- TextDrawShowForPlayer(i, HG[i]);
- TextDrawShowForPlayer(i, Zones[i]);
- }
- else
- {
- TextDrawHideForPlayer(i, Name_V[i]);
- TextDrawHideForPlayer(i, Speed[i]);
- TextDrawHideForPlayer(i, HP[i]);
- TextDrawHideForPlayer(i, HG[i]);
- TextDrawHideForPlayer(i, Zones[i]);
- }
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* OnPlayerSelectedMenuRow */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- new Menu:CurrentMenu = GetPlayerMenu(playerid);
- if (CurrentMenu == orase)
- {
- switch(row)
- {
- case 0: //LosSantos
- {
- ShowMenuForPlayer(oras_ls,playerid);
- }
- case 1: //LasVenturas
- {
- ShowMenuForPlayer(oras_lv,playerid);
- }
- }
- }
- if (CurrentMenu == oras_ls)
- {
- switch(row)
- {
- case 0: //Cargo
- {
- SetPlayerPos(playerid, 2262.63, -2250.74, 13.40);
- }
- case 1: //Ore
- {
- SetPlayerPos(playerid, 2262.63, -2250.74, 16.00);
- }
- case 2: //Fluids
- {
- SetPlayerPos(playerid, 2262.63, -2250.74, 10.00);
- }
- }
- }
- if (CurrentMenu == oras_lv)
- {
- switch(row)
- {
- case 0: //Cargo
- {
- SetPlayerPos(playerid, 2789.57, 851.57, 15.00);
- }
- case 1: //Ore
- {
- SetPlayerPos(playerid, 922.18, 1718.27, 10.10);
- }
- case 2: //Fluids
- {
- SetPlayerPos(playerid, 1667.37, 1153.16, 12.10);
- }
- }
- }
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * Kick * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public KickPublic(playerid)
- {
- Kick(playerid);
- }
- stock KickWithMessage(playerid, color, message[])
- {
- SendClientMessage(playerid, color, message);
- SetTimerEx("KickPublic", 1000, false, "d", playerid); // Delay of 1 second before kicking the player so he receives the message
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnPropUpdate * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnPropUpdate(update, num)
- {
- new pstring[200];
- if(update == 1)
- {
- if(HouseInfo[num][hOwned] == false)
- {
- DestroyDynamic3DTextLabel(HouseLabel[num]);
- DestroyPickup(HousePickup[num]);
- format(pstring, sizeof(pstring), "{67BDFC}Casa de vanzare \n {67BDFC}Level: {F48651}%d \n {67BDFC}Pret: {F48651}%d{18B614}$ \n {67BDFC}Descriere: {F48651}%s \n {FFFFFF}/buyhouse", HouseInfo[num][hLevel], HouseInfo[num][hPrice], HouseInfo[num][hDescriere]);
- HouseLabel[num] = CreateDynamic3DTextLabel(pstring, 0xFFFFFFEE, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 35.0);
- HousePickup[num] = CreateDynamicPickup(1273, 2, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], -1, -1, -1, 40);
- }
- else if(HouseInfo[num][hOwned] == true)
- {
- DestroyPickup(HousePickup[num]);
- DestroyDynamic3DTextLabel(HouseLabel[num]);
- format(pstring, sizeof(pstring), "{F48651}Casa cumparata \n {67BDFC}Proprietar: {F48651}%s \n {67BDFC}Level: {F48651}%d \n {67BDFC}Pret: {F48651}%d{18B614}$ \n {67BDFC}Descriere: {F48651}%s", HouseInfo[num][hOwner], HouseInfo[num][hLevel], HouseInfo[num][hPrice], HouseInfo[num][hDescriere]);
- HouseLabel[num] = CreateDynamic3DTextLabel(pstring ,0xFFFFFFEE, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 35.0);
- HousePickup[num] = CreateDynamicPickup(1272, 2, HouseInfo[num][hEnterX], HouseInfo[num][hEnterY], HouseInfo[num][hEnterZ], -1, -1, -1, 40);
- }
- }
- else if(update == 2)
- {
- DestroyDynamic3DTextLabel(SeifLabel[num]);
- DestroyPickup(SeifPickup[num]);
- format(pstring, sizeof(pstring), "{67BDFC}Seif {F48651}%d \n {FFFFFF}/seif", SeifInfo[num][sID]);
- SeifLabel[num] = CreateDynamic3DTextLabel(pstring, 0xFFFFFFEE, SeifInfo[num][sEnterX], SeifInfo[num][sEnterY], SeifInfo[num][sEnterZ], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 5.0);
- SeifPickup[num] = CreateDynamicPickup(1274, 2, SeifInfo[num][sEnterX], SeifInfo[num][sEnterY], SeifInfo[num][sEnterZ], -1, -1, -1, 10.0);
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * Timere Vami * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public Inchide_vama_LSLV(playerid)
- {
- SetObjectRot(vama_LSLV, 0.0, -90.0, -19.0);
- }
- public Inchide_vama_LVLS(playerid)
- {
- SetObjectRot(vama_LVLS, 0.0, 90.0, -19.0);
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SendMSG * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SendMSG()
- {
- new rand = random(sizeof(RandomMsg));
- SendClientMessageToAll(c_alb, RandomMsg[rand]);
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * OnRconLoginAttempt * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(!success) //If the password was incorrect
- {
- printf("Jucatorul cu IP-ul %s a incercat sa se logheze RCON folosind parola %s.",ip, password);
- new pip[120];
- for(new i=1; i<=MAX_PLAYERS; i++) //Loop through all players
- {
- GetPlayerIp(i, pip, sizeof(pip));
- new idiot[MAX_PLAYER_NAME];
- GetPlayerName(i, idiot, sizeof(idiot));
- if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
- {
- SCM(i, 0xFFFFFFFF, "Curiosii mor repede!"); //Send a message
- new string[100];
- format(string, sizeof(string), "%s s-a conectat cu parola RCON", idiot);
- SAM(c_alb, string);
- Kick(i); //They are now banned.
- }
- }
- }
- else
- {
- for(new i=1; i<=MAX_PLAYERS; i++) //Loop through all players
- {
- SCM(i, 0xFFFFFFFF, "s-a logat folosind parola RCON."); //Send a message
- }
- }
- return 1;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * CruiseControl * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public CruiseControl(playerid)
- {
- new vid = GetPlayerVehicleID(playerid);
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(vid, x, y, z);
- new keys, ud, lr;
- GetPlayerKeys(playerid, keys, ud, lr);
- new Float:angle, Float:heading, Float:speed;
- GetVehicleZAngle(vid, angle);
- GetVehicleHeadingAngle(vid, heading);
- DistanceFlat(0, 0, x, y, speed);
- if (PlayerCruiseSpeed[playerid] == 0.00 ||//!(keys & CCKey) //If player released LCTRL or CruiseSpeed got cancelled by other means (spacebar press)
- GetPlayerState(playerid) != PLAYER_STATE_DRIVER ||
- (speed < 0.5 * PlayerCruiseSpeed[playerid]) || //if player slowed down too much
- z > 1)// || //if car is going upwards too fast
- //(floatabs(angle - heading) > 50 && floatabs(angle - heading) < 310))//if vehicle goes sideways
- { //Cruise control will turn off:
- PlayerCruiseSpeed[playerid] = 0.00;
- SCM(playerid, c_alb, "{FFFFFF}Pilot automat: {F48651}dezactivat{F48651}."); // === Remove this if not needed ===
- return false;
- }
- GetVehicleZAngle(vid, PlayerHeadingAngle[playerid]);
- GetXYVelocity(vid, x, y, PlayerCruiseSpeed[playerid]);
- SetVehicleVelocity(vid, x, y, z);
- return SetTimerEx("CruiseControl", 400, false, "d", playerid);
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * SeteazaTimp * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public SeteazaTimp(playerid)
- {
- new string[256], an, luna, zi, ora, minut, secunda;
- getdate(an, luna, zi);
- gettime(ora, minut, secunda);
- format(string, sizeof string, "%d.%s%d.%s%d", zi, ((luna < 10) ? ("0") : ("")), luna, (an < 10) ? ("0") : (""), an);
- TextDrawSetString(Data[0], string);
- format(string, sizeof string, "%s%d:%s%d:%s%d", (ora < 10) ? ("0") : (""), ora, (minut < 10) ? ("0") : (""), minut, (secunda < 10) ? ("0") : (""), secunda);
- TextDrawSetString(Data[1], string);
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * PlayerToPoint * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 0;
- }
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- /* * RWeather * */
- /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
- public RWeather()
- {
- new rand = random(sizeof(RandomW));
- SendClientMessageToAll(c_alb, RandomW[rand]);
- SetWeather(rand);
- }
- GetXYVelocity(vehicleid, &Float:x, &Float:y, Float:speed)
- {
- new Float:a;
- x = 0.0;
- y = 0.0;
- GetVehicleZAngle(vehicleid, a);
- x += (speed * floatsin(-a, degrees));
- y += (speed * floatcos(-a, degrees));
- }
- GetAngleToXY(Float:X, Float:Y, Float:CurrentX, Float:CurrentY, &Float:Angle)
- {
- Angle = atan2(Y-CurrentY, X-CurrentX);
- Angle = floatsub(Angle, 90.0);
- if(Angle < 0.0) Angle = floatadd(Angle, 360.0);
- }
- GetVehicleHeadingAngle(vehicleid, &Float:a)
- {
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(vehicleid, x, y, z);
- GetAngleToXY(x, y, 0, 0, a);
- }
- stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
- {
- return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) );
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- stock ReturnUser(text[], playerid = INVALID_PLAYER_ID)
- {
- new pos = 0;
- while (text[pos] < 0x21) // Strip out leading spaces
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos])) // Check whole passed string
- {
- // If they have a numeric name you have a problem (although names are checked on id failure)
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- {
- userid = INVALID_PLAYER_ID;
- }
- else
- {
- return userid; // A player was found
- }
- }
- }
- // They entered [part of] a name or the id search failed (check names just incase)
- new len = strlen(text[pos]);
- new count = 0;
- new name[MAX_PLAYER_NAME];
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- if (IsPlayerConnected(i))
- {
- GetPlayerName(i, name, sizeof (name));
- if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
- {
- if (len == strlen(name)) // Exact match
- {
- return i; // Return the exact player on an exact match
- }
- else // Partial match
- {
- count++;
- userid = i;
- }
- }
- }
- }
- if (count != 1)
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- if (count)
- {
- SCM(playerid, 0xFF0000AA, "Multiple users found, please narrow search.");
- }
- else
- {
- SCM(playerid, 0xFF0000AA, "No matching user found.");
- }
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid; // INVALID_PLAYER_ID for bad return
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- stock pNamee(playerid)
- {
- new Nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nume, sizeof(Nume));
- return Nume;
- }
- stock GetVehicleSpeed(vehicleid)
- {
- new Float:vSpeed[3];
- GetVehicleVelocity( vehicleid, vSpeed[0], vSpeed[1], vSpeed[2] );
- new Float:vSpeed_Float;
- vSpeed_Float = floatsqroot( ((vSpeed[0] * vSpeed[0]) + (vSpeed[1] * vSpeed[1])) + (vSpeed[2] * vSpeed[2])) * 161;
- new vSpeed_Int;
- vSpeed_Int = floatround( vSpeed_Float, floatround_round);
- return vSpeed_Int;
- }
- DistanceFlat(Float:ax, Float:ay, Float:bx,Float:by, &Float:distance)
- {
- distance = floatsqroot(floatpower(bx-ax,2)+floatpower(by-ay,2));
- return floatround(distance);
- }
- stock GetPlayer2DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i != sizeof(gSAZones); i++ )
- {
- if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4])
- {
- return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
- }
- }
- return 0;
- }
- stock IsValidVehicleModel(vehiclemodel)
- {
- if(vehiclemodel >= 400 && vehiclemodel <= 611)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement