Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <sscanf2>
- #include <zcmd>
- #include <mSelection>
- #define PURPLE 0xFF00FFFF
- #define Dialog_Manual 888
- #define Dialog_Pret 889
- #define Dialog_Culoare1 890
- #define Dialog_Culoare2 891
- new vehicule = mS_INVALID_LISTID;
- new VanzatorVeh[MAX_PLAYERS];
- new carsshow[MAX_PLAYERS];
- new IDVehicul[MAX_PLAYERS];
- new PretVehicul[MAX_PLAYERS];
- new neonon[MAX_VEHICLES];
- new neon[MAX_VEHICLES][5];
- new motoron[MAX_VEHICLES];
- new Text3D:vtextlabel[1000];
- new vehicul[MAX_PLAYERS];
- new vehiculpret[MAX_PLAYERS];
- new vehiculculoare1[MAX_PLAYERS];
- new vehiculculoare2[MAX_PLAYERS];
- new maxperscar = 9;//Numarul maxim de vehicule pe care un jucator le poate avea
- new buyablecars = 114;//Cate vehicule ai pe server +1;
- new Contuar[MAX_PLAYERS];
- new Metrii[MAX_VEHICLES];
- 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"},{"Trailer 1"},{"Previon"},
- {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
- {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
- {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC 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"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer 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"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
- {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
- {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
- {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
- {"Utility Trailer"}};
- forward LoadCar();
- forward SaveCar();
- forward SaveThisCar(vehid);
- forward IsAnOwnableCar(vehicleid);
- forward IsAtDealership(playerid);
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- forward SendAdminMesaj(color,const string[]);
- forward GetDistanceToCar(playerid,carid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward VerificaKilometri(vehicleid);
- new vindelevel = 0;// Nivelul de la care poti cumpara un vehicul
- enum PlayerData
- {
- pLoggedIn,
- pVehicule,
- }
- new PlayerInfo[MAX_PLAYERS][PlayerData];
- enum vInfo
- {
- Model,
- Float:Locatiex,
- Float:Locatiey,
- Float:Locatiez,
- Float:Rotatie,
- Valoare,
- Culoare1,
- Culoare2,
- Propietar[MAX_PLAYER_NAME],
- Cumparata,
- Inchisa,
- Neon,
- Numar,
- PaintJob,
- Km,
- }
- new VehInfo[MAX_VEHICLES][vInfo];
- public OnGameModeInit()
- {
- LoadCar();
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Vehicule personale by Gireada");
- print("--------------------------------------\n");
- vehicule = LoadModelSelectionMenu("vehicule.txt");
- for(new veh = buyablecars; veh < MAX_VEHICLES; veh++)
- {
- SetVehicleParamsEx(veh,false,false,false,VehInfo[veh][Inchisa],false,false,false);
- motoron[veh] = 0;
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- SaveCar();
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Vehicule personale by Gireada");
- print("----------------------------------\n");
- }
- public IsAtDealership(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007) || PlayerToPoint(50,playerid,221.6332,-1952.4972,-0.5304) || PlayerToPoint(50,playerid,223.8193,-1905.8246,-0.5363) || PlayerToPoint(50,playerid,1258.2405,-1817.7858,13.4052))
- {
- return 1;
- }
- }
- return 0;
- }
- 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);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- return 1;
- }
- public IsAnOwnableCar(vehicleid)
- {
- if(vehicleid >= buyablecars && vehicleid <= 1000) { return 1; }
- return 0;
- }
- CMD:rac(playerid, params[])
- {
- new string[256], nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, sizeof(nume));
- if(IsPlayerAdmin(playerid))
- {
- for(new i=0;i<MAX_VEHICLES;i++)
- {
- if(!IsVehicleOccupied(i))
- {
- if(IsAnOwnableCar(i))
- {
- SetVehiclePos(i, VehInfo[i][Locatiex], VehInfo[i][Locatiey], VehInfo[i][Locatiez]);
- SetVehicleZAngle(i, VehInfo[i][Rotatie]);
- //SetVehicleToRespawn(i);
- }
- else
- {
- SetVehicleToRespawn(i);
- }
- }
- }
- format(string, sizeof(string), "Admin-ul %s a dat RAC(Respawn All Car)",nume);
- SendClientMessageToAll(0xFFFFFFFF, string);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii admin RCON");
- return 1;
- }
- return 1;
- }
- CMD:rpv(playerid, params[])
- {
- new string[256], nume[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nume, sizeof(nume));
- if(IsPlayerAdmin(playerid))
- {
- for(new i=buyablecars;i<MAX_VEHICLES;i++)
- {
- if(!(IsVehicleOccupied(i)))
- {
- SetVehiclePos(i, VehInfo[i][Locatiex], VehInfo[i][Locatiey], VehInfo[i][Locatiez]);
- SetVehicleZAngle(i, VehInfo[i][Rotatie]);
- }
- }
- format(string, sizeof(string), "Admin-ul %s a dat RPV(Respawn Personal Vehicle)",nume);
- SendClientMessageToAll(0xFFFFFFFF, string);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii admin RCON");
- return 1;
- }
- return 1;
- }
- CMD:rtpv(playerid, params[])
- {
- new i=GetPlayerVehicleID(playerid);
- if(IsPlayerAdmin(playerid))
- {
- SetVehiclePos(i, VehInfo[i][Locatiex], VehInfo[i][Locatiey], VehInfo[i][Locatiez]);
- SetVehicleZAngle(i, VehInfo[i][Rotatie]);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii admin RCON");
- }
- return 1;
- }
- CMD:asellcar(playerid, params[])
- {
- new file[512], string[256];
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new carid = GetPlayerVehicleID(playerid);
- new Dealer[MAX_PLAYER_NAME];
- format(Dealer, 32 ,"Dealer");
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(IsPlayerAdmin(playerid))
- {
- if(IsPlayerConnected(playerid))
- {
- if(!IsAnOwnableCar(carid))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Acest vehicul apartine unei factiuni/job");
- }
- if(IsAtDealership(playerid))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii la dealer");
- }
- if(!(strcmp(VehInfo[carid][Propietar], Dealer, true) == 0))
- {
- format(file, sizeof(file), "JucatoriVehicule/%s.ini", VehInfo[carid][Propietar]);
- dini_IntSet(file,"Vehicule",PlayerInfo[playerid][pVehicule]-1); VehInfo[carid][Cumparata] = 0;
- strmid(VehInfo[carid][Numar], "DeVanzare", 0, strlen("DeVanzare"), 999); SetVehicleNumberPlate(carid,VehInfo[carid][Numar]);
- VehInfo[carid][Locatiex] = x; VehInfo[carid][Locatiey] = y; VehInfo[carid][Locatiez] = z; VehInfo[carid][Rotatie]= 1;
- strmid(VehInfo[carid][Propietar], "Dealer", 0, strlen("Dealer"), 999); VehInfo[carid][Cumparata] = 0; VehInfo[carid][Neon] = 0;
- format(string, sizeof(string), " Vehiculul %d a fost vandut cu succes. Felicitari!.", carid);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a vandut vehiculul %d.",name, carid);
- SendAdminMesaj(0xFFFFFFFF,string);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Acest vehicul este deja de vanzare");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii conectat");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii admin RCON");
- }
- return 1;
- }
- CMD:cumparaneon(playerid, params[])
- {
- new tip;
- new vehid = GetPlayerVehicleID(playerid);
- new name[MAX_PLAYERS];
- GetPlayerName(playerid,name,sizeof(name));
- if(unformat(params, "i", tip))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /cumparaneon <culoare>");
- return 1;
- }
- if(!(tip>0 && tip < 7))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Culori neon:");
- SendClientMessage(playerid, 0xFFFFFFFF, "1.Rosu 2.Verde");
- SendClientMessage(playerid, 0xFFFFFFFF, "3.Verde Lamai 4.Abastru");
- SendClientMessage(playerid, 0xFFFFFFFF, "5.Alb 6.Violet");
- }
- if(IsAtDealership(playerid))
- {
- if(strcmp(VehInfo[vehid][Propietar], name, true) == 0)
- {
- if(neonon[vehid] == 0)
- {
- if(GetPlayerMoney(playerid) >= 100)
- {
- if(tip == 1)
- {
- VehInfo[vehid][Neon] = 1;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- else if(tip == 2)
- {
- VehInfo[vehid][Neon] = 2;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- else if(tip == 3)
- {
- VehInfo[vehid][Neon] = 3;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- else if(tip == 4)
- {
- VehInfo[vehid][Neon] = 4;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- else if(tip == 5)
- {
- VehInfo[vehid][Neon] = 5;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- else if(tip == 6)
- {
- VehInfo[vehid][Neon] = 6;
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari pentru noua achizitie. Te-a costat 100$");
- GivePlayerMoney(playerid, -100);
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu ai destui bani. Iti trebuie 100$");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa ai neoanele inchise");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Aceasta nu este vehicolul tau");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii la dealer");
- }
- return 1;
- }
- CMD:vneon(playerid, params[])
- {
- new vehid = GetPlayerVehicleID(playerid);
- if(VehInfo[vehid][Neon] >= 1)
- {
- if(neonon[vehid] == 0)
- {
- if(VehInfo[vehid][Neon] == 1)
- {
- neon[vehid][0] = CreateObject(18647,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18647,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18647,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18647,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- else if(VehInfo[vehid][Neon] == 2)
- {
- neon[vehid][0] = CreateObject(18649,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18649,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18649,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18649,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- else if(VehInfo[vehid][Neon] == 3)
- {
- neon[vehid][0] = CreateObject(18649,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18649,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18652,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18652,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- else if(VehInfo[vehid][Neon] == 4)
- {
- neon[vehid][0] = CreateObject(18648,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18648,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18648,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18648,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- else if(VehInfo[vehid][Neon] == 5)
- {
- neon[vehid][0] = CreateObject(18652,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18652,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18652,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18652,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- else if(VehInfo[vehid][Neon] == 6)
- {
- neon[vehid][0] = CreateObject(18651,0,0,0,0,0,0);
- neon[vehid][1] = CreateObject(18651,0,0,0,0,0,0);
- neon[vehid][2] = CreateObject(18651,0,0,0,0,0,0);
- neon[vehid][3] = CreateObject(18651,0,0,0,0,0,0);
- AttachObjectToVehicle(neon[vehid][0], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][1], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][2], vehid, -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(neon[vehid][3], vehid, 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
- neonon[vehid] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ai aprins neonul");
- }
- }
- else if(neonon[vehid] == 1)
- {
- DestroyObject(neon[vehid][0]);DestroyObject(neon[vehid][1]);DestroyObject(neon[vehid][2]);DestroyObject(neon[vehid][3]); neonon[vehid] = 0;
- SendClientMessage(playerid, 0xFFFFFFFF, "Ai stint neonul");
- }
- }
- return 1;
- }
- CMD:adestroycar(playerid, params[])
- {
- new vehid = GetPlayerVehicleID(playerid);
- new loc = GetPlayerVehicleSeat(playerid);
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- new string[256];
- if(loc == -1)
- {
- if(IsPlayerAdmin(playerid))
- {
- format(string, sizeof(string), " %s a distrus vehiculul %d.",name, vehid);
- SendAdminMesaj(0xFFFFFFFF,string);
- format(file, sizeof(file), "Vehicule/%d.ini", vehid);
- dini_Remove(file);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu esti admin");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii soferul");
- }
- return 1;
- }
- CMD:apark(playerid, params[])
- {
- new Float:x, Float:y, Float:z, Float:Angle;
- GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, Angle);
- new vehid = GetPlayerVehicleID(playerid);
- new loc = GetPlayerVehicleSeat(playerid);
- if(IsPlayerAdmin(playerid))
- {
- if(IsAnOwnableCar(vehid))
- {
- if(loc == 0)
- {
- VehInfo[vehid][Locatiex] = x; VehInfo[vehid][Locatiey] = y; VehInfo[vehid][Locatiez] = z; VehInfo[vehid][Rotatie]= Angle;
- SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, Angle); SaveThisCar(vehid);
- SendClientMessage(playerid, 0xFFFFFFFF, "Ai parcat vehiculul in aceste pozitii. Aici va fi respawnata.");
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii soferul");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii vehicul de vanzare");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii ADMIN RCON");
- }
- return 1;
- }
- CMD:asetpret(playerid, params[])
- {
- new vehid = GetPlayerVehicleID(playerid);
- new pret, string[50], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- new loc = GetPlayerVehicleSeat(playerid);
- if(unformat(params, "i", pret))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /asetpret <pret>");
- return 1;
- }
- if(IsPlayerAdmin(playerid))
- {
- if(IsAnOwnableCar(vehid))
- {
- if(loc == -1)
- {
- VehInfo[vehid][Valoare] = pret;
- format(string, sizeof(string), "Ai setat pretul vehiculului la %d",pret);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), "%s a setat pretul vehiculului %d la %d",name,vehid,pret);
- SendAdminMesaj(0xFFFFFFFF,string);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii soferul");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii vehicul de vanzare");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Trebuie sa fii ADMIN RCON");
- }
- return 1;
- }
- CMD:setnumar(playerid, params[])
- {
- new numar, plate[10];
- new vehid = GetPlayerVehicleID(playerid);
- new name5[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name5, sizeof(name5));
- if(unformat(params, "s[3]", numar))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /setnumar <litere>(3)");
- return 1;
- }
- if(!(strcmp(VehInfo[vehid][Propietar], name5, true) == 0))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Vehiculul nu este al tau");
- return 1;
- }
- if(IsAtDealership(playerid))
- {
- format(plate, sizeof(plate), "LS %d %d",vehid,numar);
- SetVehicleNumberPlate(vehid,plate);
- strmid(VehInfo[vehid][Numar], plate, 0, strlen(plate), 999);
- }
- return 1;
- }
- CMD:acreatecar2(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowModelSelectionMenu(playerid, vehicule, "Create Car by Gireada");
- }
- return 1;
- }
- CMD:acreatecar(playerid, params[])
- {
- new string[256], model, valoare, culoare1, culoare2;
- new name[MAX_PLAYER_NAME],string2[256];
- GetPlayerName(playerid, name, sizeof(name));
- if(unformat(params, "iiii", model,valoare,culoare1,culoare2))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /acreatecar <model> <valoare> <culoare1> <culoare2>");
- return 1;
- }
- if(!(model > 400 && model < 611))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Modelul trebuie cuprins intre 400 si 600");
- return 1;
- }
- if(!(valoare > 0 && valoare < 5000000))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Valoarea trebuie cuprins intre 0 si 5000000$");
- return 1;
- }
- if(!(culoare1 > 0 && culoare1 < 255))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Culoarea trebuie cuprins intre 0 si 255");
- return 1;
- }
- if(!(culoare2 > 0 && culoare2 < 255))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Culoarea trebuie cuprins intre 0 si 255");
- return 1;
- }
- if(!(IsAtDealership(playerid)))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii la Dealer");
- return 1;
- }
- if(IsPlayerAdmin(playerid))
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new vehicle = CreateVehicle(model,x,y,z,1,culoare1,culoare2,999999);
- PutPlayerInVehicle(playerid,vehicle,0);
- new vehid = GetPlayerVehicleID(playerid);
- format(VehInfo[vehid][Numar], 32 ,"DeVanzare");
- SetVehicleNumberPlate(vehid,VehInfo[vehicle][Numar]);
- strmid(VehInfo[vehid][Numar], "DeVanzare", 0, strlen("DeVanzare"), 999);
- VehInfo[vehid][Locatiex] = x; VehInfo[vehid][Locatiey] = y; VehInfo[vehid][Locatiez] = z; VehInfo[vehid][Rotatie]= 1;
- VehInfo[vehid][Model] = model; VehInfo[vehid][Valoare] = valoare; VehInfo[vehid][Culoare1] = culoare1; VehInfo[vehid][Culoare2] = culoare2;
- strmid(VehInfo[vehid][Propietar], "Dealer", 0, strlen("Dealer"), 999); VehInfo[vehid][Cumparata] = 0; VehInfo[vehid][Neon] = 0;
- VehInfo[vehid][PaintJob] = 3;
- format(string, sizeof(string), " Vehiculul %d a fost creat cu succes. Felicitari!.", vehicle);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat vehiculul %d.",name, vehicle);
- SendAdminMesaj(0xFFFFFFFF,string);
- printf("%s a creiat vehiculul %d.",name, vehicle); SaveThisCar(vehicle);
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",GetVehicleName(vehid), VehInfo[vehid][Valoare]);
- vtextlabel[vehid] = Create3DTextLabel(string2, 0x7FFF00FF, VehInfo[vehid][Locatiex], VehInfo[vehid][Locatiey], VehInfo[vehid][Locatiez], 20.0, 0, 0);
- Attach3DTextLabelToVehicle( vtextlabel[vehid] , vehid, 0.0, 0.0, 0.0);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii conectat.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa ai RCON ADMIN");
- return 1;
- }
- return 1;
- }
- CMD:vcumpara(playerid, params[])
- {
- new name5[MAX_PLAYER_NAME], vehid = GetPlayerVehicleID(playerid);
- GetPlayerName(playerid, name5, sizeof(name5));
- new string2[256],string[256];
- if(!(IsAtDealership(playerid)))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii la Dealer.");
- return 1;
- }
- if(!(GetPlayerScore(playerid) >= vindelevel))
- {
- format(string,sizeof(string),"[Server-Info] Trebuie sa ai level-ul %d pentru a achizitiona un vehicul",vindelevel);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- return 1;
- }
- if(IsAnOwnableCar(vehid))
- {
- if(VehInfo[vehid][Cumparata] == 0)
- {
- if(PlayerInfo[playerid][pVehicule] <= maxperscar)
- {
- if(GetPlayerMoney(playerid) >= VehInfo[vehid][Valoare])
- {
- strmid(VehInfo[vehid][Propietar], name5, 0, strlen(name5), 999);
- VehInfo[vehid][Cumparata] = 1; PlayerInfo[playerid][pVehicule] += 1;
- GivePlayerMoney(playerid, -VehInfo[vehid][Valoare]);
- TogglePlayerControllable(playerid, 1); SaveThisCar(vehid);
- GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
- SendClientMessage(playerid, 0xFFFFFFFF, "Felicitari ti-ai cumparat o masina noua!");
- format(string2, sizeof(string2), " Propietar: %s \n Model: %s",VehInfo[vehid][Propietar], GetVehicleName(vehid));
- Update3DTextLabelText(vtextlabel[vehid], 0xFF4500FF, string2);
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Nu ai destui bani, la tine.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Ai atins limita de vehicule personale");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Vehiculul este deja cumparat");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Vehiculul nu este de vanzare");
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Hint] Incearca unul de la dealer");
- return 1;
- }
- return 1;
- }
- CMD:vvinde(playerid, params[])
- {
- new name5[MAX_PLAYER_NAME], vehid = GetPlayerVehicleID(playerid), string[256];
- GetPlayerName(playerid, name5, sizeof(name5));
- new string2[256];
- new engine,lights,alarm,doors,bonnet,boot,objective;
- new bani;
- if(!(strcmp(VehInfo[vehid][Propietar], name5, true) == 0))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Vehiculul nu este al tau");
- return 1;
- }
- if(!(IsAtDealership(playerid)))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii la Dealer.");
- return 1;
- }
- if(!(IsAnOwnableCar(vehid)))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii vehicul de vanzare/");
- return 1;
- }
- strmid(VehInfo[vehid][Propietar], "Dealer", 0, strlen("Dealer"), 999);
- VehInfo[vehid][Cumparata] = 0; PlayerInfo[playerid][pVehicule] -= 1;
- TogglePlayerControllable(playerid, 1); SaveThisCar(vehid);
- bani = VehInfo[vehid][Valoare]%2;
- GivePlayerMoney(playerid, VehInfo[vehid][Valoare]%2);
- GameTextForPlayer(playerid, "~w~Ti-ai vandut vehicululul~n~Nu uita de bani!", 5000, 3);
- format(string, sizeof(string), " Ti-ai vandut vehiculul, ai primit %d $!.", bani);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehid,false,lights,alarm,doors,bonnet,boot,objective);
- VehInfo[vehid][PaintJob] = 3;
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",VehInfo[vehid][Propietar], VehInfo[vehid][Valoare]);
- Update3DTextLabelText(vtextlabel[vehid], 0x7FFF00FF, string2);
- return 1;
- }
- CMD:vvindelui(playerid, params[])
- {
- new giveplayerid,valoare, vehid = GetPlayerVehicleID(playerid);
- new name5[MAX_PLAYER_NAME], playername[256], giveplayer[256], string[256];
- GetPlayerName(playerid, name5, sizeof(name5));
- if(unformat(params, "ui",giveplayerid,valoare))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /vvindelui <playerid/name> <valoare> ");
- return 1;
- }
- if(!(GetPlayerScore(giveplayerid) >= vindelevel))
- {
- format(string,sizeof(string),"[Server-Info] Cumparatorul trebuie sa ai level-ul %d pentru a achizitiona un vehicul",vindelevel);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string,sizeof(string),"[Server-Info] Trebuief trebuie sa ai level-ul %d pentru a achizitiona un vehicul",vindelevel);
- SendClientMessage(giveplayerid, 0xFFFFFFFF, string);
- return 1;
- }
- if(!(strcmp(VehInfo[vehid][Propietar], name5, true) == 0))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Vehiculul nu este al tau");
- return 1;
- }
- if(!(PlayerInfo[giveplayerid][pVehicule] < maxperscar))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Persoana a atins limita de vehicule personale");
- return 1;
- }
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "* I-ai oferit lui %s vehiculul tau pentru $%d .", giveplayer, valoare);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), "* %s ti-a oferit veiculul lui pentru $%d (scrie {1E90FF}/accepta{FFFFFF}) pentru a o cumpara.", playername, valoare);
- SendClientMessage(giveplayerid, 0xFFFFFFFF, string); SaveThisCar(vehid);
- VanzatorVeh[giveplayerid] = playerid;
- IDVehicul[giveplayerid] = vehid;
- PretVehicul[giveplayerid] = valoare;
- SetTimerEx( "VDecizion", 30000, false, "i", giveplayerid);
- return 1;
- }
- CMD:acceptav(playerid, params[])
- {
- new string[256], vehid = GetPlayerVehicleID(playerid), name5[MAX_PLAYER_NAME], name6[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name5, sizeof(name5));
- GetPlayerName(VanzatorVeh[playerid], name6, sizeof(name6));
- new string2[256];
- if(VanzatorVeh[playerid] >= 0)
- {
- if(GetPlayerMoney(playerid) >= PretVehicul[playerid])
- {
- GivePlayerMoney(VanzatorVeh[playerid], PretVehicul[playerid]);
- GivePlayerMoney(playerid, -PretVehicul[playerid]);
- format(string, sizeof(string), "* %s ti-a acceptat, ai primit %d.", name5, PretVehicul[playerid]);
- SendClientMessage(VanzatorVeh[playerid], 0xFFFFFFFF, string);
- format(string, sizeof(string), "* %s ti-a vandut vehiculul pentru %d.", name6, PretVehicul[playerid]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- strmid(VehInfo[vehid][Propietar], name5, 0, strlen(name5), 999);
- PlayerInfo[playerid][pVehicule] += 1; PlayerInfo[VanzatorVeh[playerid]][pVehicule] -= 1;
- format(string2, sizeof(string2), " Propietar: %s \n Model: %s",VehInfo[vehid][Propietar], GetVehicleName(vehid));
- Update3DTextLabelText(vtextlabel[vehid], 0xFF4500FF, string2);
- VanzatorVeh[playerid] = -1; IDVehicul[playerid] = 0; PretVehicul[playerid] = 0;
- }
- else
- {
- format(string, sizeof(string), "* Nu ai destui bani iti trebuie %d", PretVehicul[playerid]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- VanzatorVeh[playerid] = -1;
- IDVehicul[playerid] = 0;
- PretVehicul[playerid] = 0;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu ai nici o oferta");
- }
- return 1;
- }
- CMD:refuzav(playerid, params[])
- {
- new string[256], name5[MAX_PLAYER_NAME], name6[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name5, sizeof(name5));
- if(VanzatorVeh[playerid] >= 0)
- {
- if(GetPlayerMoney(playerid) >= PretVehicul[playerid])
- {
- format(string, sizeof(string), "* %s ti-a refuzt oferta.", name5);
- SendClientMessage(VanzatorVeh[playerid], 0xFFFFFFFF, string);
- format(string, sizeof(string), "* % I-ai refuzat oferta lui %s.", name6);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- VanzatorVeh[playerid] = -1;IDVehicul[playerid] = 0;PretVehicul[playerid] = 0;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Nu ai nici o oferta, pentru a o refuza.");
- return 1;
- }
- return 1;
- }
- CMD:vpark(playerid, params[])
- {
- new Float:x, Float:y, Float:z, Float:Angle, string[26], name5[MAX_PLAYERS];
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, Angle);
- new vehid = GetPlayerVehicleID(playerid);
- GetPlayerName(playerid, name5, sizeof(name5));
- if(strcmp(VehInfo[vehid][Propietar], name5, true) == 0)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- VehInfo[vehid][Locatiex] = x; VehInfo[vehid][Locatiey] = y; VehInfo[vehid][Locatiez] = z; VehInfo[vehid][Rotatie]= Angle;
- SetPlayerFacingAngle(playerid, Angle); SetVehiclePos(vehid, x, y, z); SetVehicleZAngle(vehid, Angle);
- SendClientMessage(playerid, 0xFFFFFFFF, "Ai parcat vehiculul in aceste pozitii. Aici va fi respawnata.");
- format(string, sizeof(string), "* %s si-a parcat vehiculul in aceasta pozitie.", name5);
- ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE); SaveThisCar(vehid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Nu esti soferul.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Nu esti propietarul vehiculului.");
- }
- return 1;
- }
- CMD:vlock(playerid, params[])
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- new loc = GetPlayerVehicleSeat(playerid);
- if(GetPlayerVehicleSeat(playerid) == -1)
- {
- for(new carid = buyablecars; carid<MAX_VEHICLES; carid++)
- {
- if(GetDistanceToCar(playerid,carid) < 2.0)
- {
- if(strcmp(VehInfo[carid][Propietar], name, true) == 0)
- {
- if(VehInfo[carid][Inchisa] == 0)
- {
- VehInfo[carid][Inchisa] = 1;
- SendClientMessage(playerid, 0xFFFFFFFF, "Ti-ai inchis vehiculul.");break;
- }
- else if(VehInfo[carid][Inchisa] == 1)
- {
- VehInfo[carid][Inchisa] = 0;
- SendClientMessage(playerid, 0xFFFFFFFF, "Ti-ai deschis vehiculul.");break;
- }
- }
- }
- }
- }
- else if(loc == 0 || loc == 1 || loc == 2 || loc == 3 || loc == 4)
- {
- new vehid = GetPlayerVehicleID(playerid);
- if(strcmp(VehInfo[vehid][Propietar], name, true) == 0)
- {
- if(VehInfo[vehid][Inchisa] == 0)
- {
- VehInfo[vehid][Inchisa] = 1; SendClientMessage(playerid, 0xFFFFFFFF, "Ti-ai inchis vehiculul.");
- return 1;
- }
- else if(VehInfo[vehid][Inchisa] == 1)
- {
- VehInfo[vehid][Inchisa] = 0; SendClientMessage(playerid, 0xFFFFFFFF, "Ti-ai deschis vehiculul.");
- return 1;
- }
- }
- }
- return 1;
- }
- CMD:mycars(playerid, params[])
- {
- new name[MAX_PLAYER_NAME], string[256];
- GetPlayerName(playerid, name, sizeof(name));
- carsshow[playerid] = 0;
- for(new vehid = buyablecars; vehid<sizeof(VehInfo); vehid++)
- {
- if(VehInfo[vehid][Propietar] == name[playerid])
- {
- if(carsshow[playerid] <= PlayerInfo[playerid][pVehicule])
- {
- new value = VehInfo[vehid][Valoare]%2;
- new Neontxt[10], Statustxt[10];
- if(VehInfo[vehid][Neon] >= 1) { Neontxt = "Da"; }
- else if(VehInfo[vehid][Neon] == 0) { Neontxt = "Nu"; }
- if(VehInfo[vehid][Inchisa] == 0) { Statustxt = "Nu"; }
- else if(VehInfo[vehid][Inchisa] == 1) { Statustxt = "Da"; }
- new kilo = VehInfo[vehid][Km];
- format(string, sizeof(string), " CarID: %d, Model: %s Valoare: %d, Neon: %s, Inchisa: %s, Kilometrii: %d", vehid, GetVehicleName(vehid), value, Neontxt, Statustxt, kilo);
- SendClientMessage(playerid, 0xFFFFFFFF, string); carsshow[playerid] += 1;
- }
- }
- }
- carsshow[playerid] = 0;
- return 1;
- }
- CMD:manual(playerid, params[])
- {
- new string[1024];
- strcat( string, " {FF9094}Manual Vehicul\n\n");
- strcat( string, "{7CFC00}/vlock - {FFFAF0}inchizi vehiculul\n");
- strcat( string, "{7CFC00}/vpark - {FFFAF0}parchezi vehiculul \n");
- strcat( string, "{7CFC00}/vvindelui - {FFFAF0}vinzi vehiculul cuiva \n");
- strcat( string, "{7CFC00}/vvinde - {FFFAF0}vinzi vehiculul la dealer \n");
- strcat( string, "{7CFC00}/vcumpara - {FFFAF0}cumperi vehiculul \n");
- strcat( string, "{7CFC00}/vneon - {FFFAF0}aprinzi neon-ul \n");
- strcat( string, "{7CFC00}/cumparaneon - {FFFAF0}cumperi neon\n");
- strcat( string, "{7CFC00}/mycars - {FFFAF0}vezi vehiculele tale\n\n\n");
- strcat( string, "{7CFC00}/asellcar - {FFFAF0}vinzi vehiculul (RCON)\n");
- strcat( string, "{7CFC00}/acreatecar - {FFFAF0}creezi vehiculul (RCON)\n");
- strcat( string, "{7CFC00}/apark - {FFFAF0}parchezi vehiculul (RCON)\n");
- strcat( string, "{7CFC00}/asetpret - {FFFAF0}setezi pretul (RCON)\n");
- strcat( string, "{7CFC00}/rtpv - {FFFAF0}respawnezi vehiculul in care te aflii (RCON)\n");
- strcat( string, "{7CFC00}/rpv - {FFFAF0}respawnezi vehiculele personale (RCON)\n\n\n");
- strcat( string, "{7CFC00}/rac - {FFFAF0}respawnezi toate vehiculele (RCON)\n\n\n");
- strcat( string, "{FFFFFF}Sistemul de vehicule personale creeat de: {FFFAF0}Gireada");
- ShowPlayerDialog(playerid, 888, DIALOG_STYLE_MSGBOX,"Comenzi",string,"De Acord","");
- return 1;
- }
- CMD:motor(playerid, params[])
- {
- new playerState = GetPlayerState(playerid), string[256], vehicleid = GetPlayerVehicleID(playerid), name1[MAX_PLAYERS];
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetPlayerName(playerid, name1, sizeof(name1));
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(!(strcmp(VehInfo[vehicleid][Propietar], name, true) == 0))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu ai cheile acestui vehicul");
- return 1;
- }
- if(playerState == PLAYER_STATE_DRIVER)
- {
- if(motoron[vehicleid] == 0)
- {
- motoron[vehicleid] = 1;
- SetVehicleParamsEx(vehicleid,true,lights,alarm,doors,bonnet,boot,objective);
- format(string, sizeof(string), "* %s invarte cheia si porneste motorul.",name1);
- ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
- return 1;
- }
- else if(motoron[vehicleid] == 1)
- {
- motoron[vehicleid] = 0;
- SetVehicleParamsEx(vehicleid,false,lights,alarm,doors,bonnet,boot,objective);
- format(string, sizeof(string), "* %s invarte cheia si opreste motorul.",name1);
- ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
- return 1;
- }
- }
- return 1;
- }
- stock pName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- return name;
- }
- public OnPlayerConnect(playerid)
- {
- new file[80];
- format(file, sizeof(file),"JucatoriVehicule/%s.ini", pName(playerid));
- if(dini_Exists(file))
- {
- PlayerInfo[playerid][pVehicule] = dini_Int(file,"Vehicule");
- PlayerInfo[playerid][pLoggedIn] = dini_Int(file,"Logat");
- }
- else if(!dini_Exists(file))
- {
- dini_Create(file);
- dini_IntSet(file,"Vehicule",PlayerInfo[playerid][pVehicule] = 0);
- dini_IntSet(file,"Logat",PlayerInfo[playerid][pVehicule] = 1);
- }
- carsshow[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new file[80];
- format(file, sizeof(file),"JucatoriVehicule/%s.ini", pName(playerid));
- dini_IntSet(file,"Vehicule",PlayerInfo[playerid][pVehicule]);
- PlayerInfo[playerid][pLoggedIn] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- PlayerInfo[playerid][pLoggedIn] = 1;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- DestroyObject(neon[vehicleid][0]);DestroyObject(neon[vehicleid][1]);DestroyObject(neon[vehicleid][2]);DestroyObject(neon[vehicleid][3]); neonon[vehicleid] = 0;
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(VehInfo[vehicleid][Inchisa] == 1 && VehInfo[vehicleid][Propietar] != name[playerid])
- {
- SetPlayerPos(playerid,x,y,z);
- SendClientMessage(playerid, 0xFFFFFFFF, "Acest vehiculul este inchiat");
- }
- VerificaKilometri(vehicleid);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- KillTimer(Contuar[playerid]);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- Contuar[playerid] = SetTimerEx("VerificaKilometri", 2500, true, "i", GetPlayerVehicleID(playerid));
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- if(GetPlayerInterior(playerid) == 0)
- {
- BanEx(playerid, "Tuning Hacks");
- }
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- /*if(GetPlayerInterior(playerid) == 0)
- {
- BanEx(playerid, "Tuning Hacks");
- }
- else if(GetPlayerInterior(playerid) == 1)
- {
- VehInfo[vehicleid][PaintJob] = paintjobid;
- }*/
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public LoadCar()
- {
- new file[254];
- new idx = buyablecars;
- new string2[256];
- while(idx<sizeof(VehInfo))
- {
- format(file, sizeof(file),"Vehicule/%d.ini", idx);
- if(dini_Exists(file))
- {
- VehInfo[idx][Model] = dini_Int(file,"Model");
- VehInfo[idx][Locatiex] = dini_Float(file,"Locatiex");
- VehInfo[idx][Locatiey] = dini_Float(file,"Locatiey");
- VehInfo[idx][Locatiez] = dini_Float(file,"Locatiez");
- VehInfo[idx][Rotatie] = dini_Float(file,"Rotatie");
- VehInfo[idx][Valoare] = dini_Int(file,"Valoare");
- VehInfo[idx][Culoare1] = dini_Int(file,"Culoare1");
- VehInfo[idx][Culoare2] = dini_Int(file,"Culoare2");
- strmid(VehInfo[idx][Propietar], dini_Get(file,"Propietar"), 0, strlen(dini_Get(file,"Propietar")), 255);
- VehInfo[idx][Cumparata] = dini_Int(file,"Cumparata");
- VehInfo[idx][Inchisa] = dini_Int(file,"Inchisa");
- VehInfo[idx][Neon] = dini_Int(file,"Neon");
- strmid(VehInfo[idx][Numar], dini_Get(file,"Numar"), 0, strlen(dini_Get(file,"Numar")), 255);
- VehInfo[idx][PaintJob] = dini_Int(file,"PaintJob");
- //=============================================================[Spawner]===================================================================
- new carid = AddStaticVehicle(VehInfo[idx][Model], VehInfo[idx][Locatiex], VehInfo[idx][Locatiey], VehInfo[idx][Locatiez], VehInfo[idx][Rotatie], VehInfo[idx][Culoare1], VehInfo[idx][Culoare2]);
- SetVehicleNumberPlate(idx, VehInfo[idx][Numar]);
- ChangeVehiclePaintjob(idx, VehInfo[idx][PaintJob]);
- idx++;
- if(VehInfo[carid][Cumparata] == 1)
- {
- format(string2, sizeof(string2), " Model: %s \n Propietar: %s",GetVehicleName(carid),VehInfo[idx][Propietar]);
- vtextlabel[carid] = Create3DTextLabel(string2, 0xFF4500FF, VehInfo[carid][Locatiez], VehInfo[carid][Locatiey], VehInfo[carid][Locatiez], 20.0, 0, 0);
- Attach3DTextLabelToVehicle(vtextlabel[carid] , carid, 0.0, 0.0, 0.0);
- }
- if(VehInfo[idx][Cumparata] == 0)
- {
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",GetVehicleName(carid), VehInfo[idx][Valoare]);
- vtextlabel[carid] = Create3DTextLabel(string2, 0x7FFF00FF, VehInfo[carid][Locatiex], VehInfo[carid][Locatiey], VehInfo[carid][Locatiez], 20.0, 0, 0);
- Attach3DTextLabelToVehicle(vtextlabel[carid] , carid, 0.0, 0.0, 0.0);
- }
- }
- else if(!dini_Exists(file))
- {
- idx++;
- }
- }
- printf("Server Stats: Vehicule Personale Incarcate");
- printf("S-au incarcat %d vehicule personale", idx-buyablecars);
- return 1;
- }
- public SaveCar()
- {
- new file2[254];
- new idx = buyablecars;
- while(idx<sizeof(VehInfo))
- {
- format(file2, sizeof(file2),"Vehicule/%d.ini", idx);
- if(dini_Exists(file2))
- {
- dini_IntSet(file2,"Model",VehInfo[idx][Model]);
- dini_FloatSet(file2,"Locatiex",VehInfo[idx][Locatiex]);
- dini_FloatSet(file2,"Locatiey",VehInfo[idx][Locatiey]);
- dini_FloatSet(file2,"Locatiez",VehInfo[idx][Locatiez]);
- dini_FloatSet(file2,"Angle",VehInfo[idx][Rotatie]);
- dini_IntSet(file2,"Valoare",VehInfo[idx][Valoare]);
- dini_IntSet(file2,"Culoare1",VehInfo[idx][Culoare1]);
- dini_IntSet(file2,"Culoare2",VehInfo[idx][Culoare2]);
- dini_Set(file2,"Propietar",VehInfo[idx][Propietar]);
- dini_IntSet(file2,"Cumparata",VehInfo[idx][Cumparata]);
- dini_IntSet(file2,"Inchisa",VehInfo[idx][Inchisa]);
- dini_IntSet(file2,"Neon",VehInfo[idx][Neon]);
- dini_Set(file2,"Numar",VehInfo[idx][Numar]);
- SetVehicleNumberPlate(idx,VehInfo[idx][Numar]);
- dini_IntSet(file2,"PaintJob",VehInfo[idx][PaintJob]);
- idx++;
- return 1;
- }
- /*else if(!dini_Exists(file2))
- {
- dini_Create(file2);
- dini_IntSet(file2,"Model",VehInfo[idx][Model]);
- dini_FloatSet(file2,"Locatiex",VehInfo[idx][Locatiex]);
- dini_FloatSet(file2,"Locatiey",VehInfo[idx][Locatiey]);
- dini_FloatSet(file2,"Locatiez",VehInfo[idx][Locatiez]);
- dini_FloatSet(file2,"Angle",VehInfo[idx][Rotatie]);
- dini_IntSet(file2,"Valoare",VehInfo[idx][Valoare]);
- dini_IntSet(file2,"Culoare1",VehInfo[idx][Culoare1]);
- dini_IntSet(file2,"Culoare2",VehInfo[idx][Culoare2]);
- dini_Set(file2,"Propietar",VehInfo[idx][Propietar]);
- dini_IntSet(file2,"Cumparata",VehInfo[idx][Cumparata]);
- dini_IntSet(file2,"Inchisa",VehInfo[idx][Inchisa]);
- dini_IntSet(file2,"Neon",VehInfo[idx][Neon]);
- dini_Set(file2,"Numar",VehInfo[idx][Numar]);
- SetVehicleNumberPlate(idx,VehInfo[idx][Numar]);
- dini_IntSet(file2,"PaintJob",VehInfo[idx][PaintJob]);
- idx++;
- return 1;
- }*/
- }
- return 1;
- }
- public SaveThisCar(vehid)
- {
- new file2[254];
- format(file2, sizeof(file2),"Vehicule/%d.ini", vehid);
- if(dini_Exists(file2))
- {
- dini_IntSet(file2,"Model",VehInfo[vehid][Model]);
- dini_FloatSet(file2,"Locatiex",VehInfo[vehid][Locatiex]);
- dini_FloatSet(file2,"Locatiey",VehInfo[vehid][Locatiey]);
- dini_FloatSet(file2,"Locatiez",VehInfo[vehid][Locatiez]);
- dini_FloatSet(file2,"Angle",VehInfo[vehid][Rotatie]);
- dini_IntSet(file2,"Valoare",VehInfo[vehid][Valoare]);
- dini_IntSet(file2,"Culoare1",VehInfo[vehid][Culoare1]);
- dini_IntSet(file2,"Culoare2",VehInfo[vehid][Culoare2]);
- dini_Set(file2,"Propietar",VehInfo[vehid][Propietar]);
- dini_IntSet(file2,"Cumparata",VehInfo[vehid][Cumparata]);
- dini_IntSet(file2,"Inchisa",VehInfo[vehid][Inchisa]);
- dini_IntSet(file2,"Neon",VehInfo[vehid][Neon]);
- dini_Set(file2,"Numar",VehInfo[vehid][Numar]);
- SetVehicleNumberPlate(vehid,VehInfo[vehid][Numar]);
- dini_IntSet(file2,"PaintJob",VehInfo[vehid][PaintJob]);
- return 1;
- }
- else if(!dini_Exists(file2))
- {
- dini_Create(file2);
- dini_IntSet(file2,"Model",VehInfo[vehid][Model]);
- dini_FloatSet(file2,"Locatiex",VehInfo[vehid][Locatiex]);
- dini_FloatSet(file2,"Locatiey",VehInfo[vehid][Locatiey]);
- dini_FloatSet(file2,"Locatiez",VehInfo[vehid][Locatiez]);
- dini_FloatSet(file2,"Angle",VehInfo[vehid][Rotatie]);
- dini_IntSet(file2,"Valoare",VehInfo[vehid][Valoare]);
- dini_IntSet(file2,"Culoare1",VehInfo[vehid][Culoare1]);
- dini_IntSet(file2,"Culoare2",VehInfo[vehid][Culoare2]);
- dini_Set(file2,"Propietar",VehInfo[vehid][Propietar]);
- dini_IntSet(file2,"Cumparata",VehInfo[vehid][Cumparata]);
- dini_IntSet(file2,"Inchisa",VehInfo[vehid][Inchisa]);
- dini_IntSet(file2,"Neon",VehInfo[vehid][Neon]);
- dini_Set(file2,"Numar",VehInfo[vehid][Numar]);
- SetVehicleNumberPlate(vehid,VehInfo[vehid][Numar]);
- dini_IntSet(file2,"PaintJob",VehInfo[vehid][PaintJob]);
- return 1;
- }
- return 1;
- }
- public SendAdminMesaj(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerAdmin(i))
- {
- SendClientMessage(i, color, string);
- printf("%s", string);
- }
- }
- }
- return 1;
- }
- public VerificaKilometri(vehicleid)
- {
- if(GetVehicleSpeed(vehicleid) > 10)
- {
- Metrii[vehicleid] += floatround(floatdiv(GetVehicleSpeed(vehicleid), 60.0));
- }
- if(Metrii[vehicleid] > 9)
- {
- VehInfo[vehicleid][Km] += 1;
- Metrii[vehicleid] = 0;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[256], name[MAX_PLAYER_NAME],string2[500];
- GetPlayerName(playerid, name, sizeof(name));
- if(response)
- {
- switch(dialogid)
- {
- case Dialog_Manual:
- {
- SendClientMessage(playerid, 0xFFFFFFFFF, " Speram ca te-ai lamurit");
- }
- case Dialog_Pret:
- {
- if(!(IsNumeric(inputtext)))
- {
- format(string,sizeof(string), "{FFFFFF}Introdu pretul vehiculului. Model: %s ", VehicleNames[vehicul[playerid]-400]);
- ShowPlayerDialog(playerid, Dialog_Pret, DIALOG_STYLE_INPUT,"Pret Vehicul",string,"->","Anuleaza");
- }
- vehiculpret[playerid] = strval(inputtext);
- format(string,sizeof(string), "{FFFFFF}Introdu culoarea 1. Model: %s ", VehicleNames[vehicul[playerid]-400]);
- ShowPlayerDialog(playerid, Dialog_Culoare1, DIALOG_STYLE_INPUT,"Culoare Vehicul",string,"->","Anuleaza");
- }
- case Dialog_Culoare1:
- {
- if(!(strval(inputtext) >= 0 || strval(inputtext) <= 254))
- {
- format(string,sizeof(string), "{FFFFFF}Introdu culoarea 1(Intre 0 si 254). Model: %s ", VehicleNames[vehicul[playerid]-400]);
- ShowPlayerDialog(playerid, Dialog_Culoare1, DIALOG_STYLE_INPUT,"Culoare Vehicul",string,"->","Anuleaza");
- }
- vehiculculoare1[playerid] = strval(inputtext);
- format(string,sizeof(string), "{FFFFFF}Introdu culoarea 2. Model: %s ", VehicleNames[vehicul[playerid]-400]);
- ShowPlayerDialog(playerid, Dialog_Culoare2, DIALOG_STYLE_INPUT,"Culoare Vehicul",string,"->","Anuleaza");
- }
- case Dialog_Culoare2:
- {
- if(!(strval(inputtext) >= 0 || strval(inputtext) <= 254))
- {
- format(string,sizeof(string), "{FFFFFF}Introdu culoarea 2(Intre 0 si 254). Model: %s ", VehicleNames[vehicul[playerid]-400]);
- ShowPlayerDialog(playerid, Dialog_Culoare2, DIALOG_STYLE_INPUT,"Culoare Vehicul",string,"->","Anuleaza");
- }
- vehiculculoare2[playerid] = strval(inputtext);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- new vehicle = CreateVehicle(vehicul[playerid],x,y,z,1,vehiculculoare1[playerid],vehiculculoare2[playerid],999999);
- PutPlayerInVehicle(playerid,vehicle,0);
- new vehid = GetPlayerVehicleID(playerid);
- format(VehInfo[vehid][Numar], 32 ,"DeVanzare");
- SetVehicleNumberPlate(vehid,VehInfo[vehicle][Numar]);
- strmid(VehInfo[vehid][Numar], "DeVanzare", 0, strlen("DeVanzare"), 999);
- VehInfo[vehid][Locatiex] = x; VehInfo[vehid][Locatiey] = y; VehInfo[vehid][Locatiez] = z; VehInfo[vehid][Rotatie]= 1;
- VehInfo[vehid][Model] = vehicul[playerid]; VehInfo[vehid][Valoare] = vehiculpret[playerid]; VehInfo[vehid][Culoare1] = vehiculculoare1[playerid]; VehInfo[vehid][Culoare2] = vehiculculoare2[playerid];
- strmid(VehInfo[vehid][Propietar], "Dealer", 0, strlen("Dealer"), 999); VehInfo[vehid][Cumparata] = 0; VehInfo[vehid][Neon] = 0;
- VehInfo[vehid][PaintJob] = 3;
- format(string, sizeof(string), " Vehiculul %d a fost creat cu succes. Felicitari!.", vehicle);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- format(string, sizeof(string), " %s a creiat vehiculul %d.",name, vehicle);
- SendAdminMesaj(0xFFFFFFFF,string);
- printf("%s a creiat vehiculul %d.",name, vehicle); SaveThisCar(vehicle);
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",GetVehicleName(vehid), VehInfo[vehid][Valoare]);
- vtextlabel[vehid] = Create3DTextLabel(string2, 0x7FFF00FF, VehInfo[vehid][Locatiex], VehInfo[vehid][Locatiey], VehInfo[vehid][Locatiez], 20.0, 0, 0);
- Attach3DTextLabelToVehicle( vtextlabel[vehid] , vehid, 0.0, 0.0, 0.0);
- }
- }
- return 1;
- }
- return 0;
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // If the player is within 16 meters
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) // within 8 meters
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) //4 meters
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) //2 meters
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) //1 meter
- {
- SendClientMessage(i, col5, string);
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- return 1;
- }
- stock GetDistanceToCar(playerid,carid)
- {
- new Float:dis;
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- if (!IsPlayerConnected(playerid)) {
- return -1;
- }
- GetPlayerPos(playerid,x1,y1,z1);
- if(!IsVehicleInUse(carid)){
- GetVehiclePos(carid,x2,y2,z2);
- dis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
- return floatround(dis);
- }else{
- return 1;
- }
- }
- stock IsVehicleInUse(vehicleid)
- {
- for(new i; i != MAX_PLAYERS; i++)
- {
- if(GetPlayerVehicleID(i) == vehicleid)
- {
- return i;
- }
- }
- return INVALID_PLAYER_ID;
- }
- stock GetVehicleName(vehicleid)
- {
- new String[256];
- format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
- return String;
- }
- stock IsVehicleOccupied(vehicleid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- if(GetPlayerVehicleID(i)==vehicleid)
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- }
- return 1;
- }
- 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;
- }
- public OnPlayerModelSelection(playerid, response, listid, modelid)
- {
- new string[256];
- if(listid == vehicule)
- {
- if(response)
- {
- vehicul[playerid] = modelid;
- format(string,sizeof(string), "{FFFFFF}Introdu pretul vehiculului. Model: %s ", VehicleNames[modelid-400]);
- ShowPlayerDialog(playerid, Dialog_Pret, DIALOG_STYLE_INPUT,"Pret Vehicul",string,"->","Anuleaza");
- }
- else SendClientMessage(playerid, 0xFF0000FF, "Altadata");
- return 1;
- }
- return 1;
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement