Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <sscanf2>
- #include <zcmd>
- #define PURPLE 0xFF00FFFF
- 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 maxperscar = 9;//Numarul maxim de vehicule pe care un jucator le poate avea
- new buyablecars = 90;//Cate vehicule ai pe server +1;
- 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);
- 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,
- }
- new VehInfo[MAX_VEHICLES][vInfo];
- public OnGameModeInit()
- {
- LoadCar();
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Vehicule personale by Gireada");
- print("--------------------------------------\n");
- for(new veh = buyablecars; veh < MAX_VEHICLES; veh++)
- {
- SetVehicleParamsEx(veh,false,false,false,VehInfo[veh][Inchisa],false,false,false);
- motoron[veh] = 0;
- return 1;
- }
- 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:asellcar(playerid, params[])
- {
- new file[512], string[256], string2[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(VehInfo[carid][Propietar] != Dealer[playerid] && VehInfo[carid][Cumparata] == 1)
- {
- 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);
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",VehInfo[carid][Propietar], VehInfo[carid][Valoare]);
- Update3DTextLabelText(vtextlabel[carid], 0x7FFF00FF, string2);
- }
- 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(VehInfo[vehid][Propietar] == name[playerid])
- {
- 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 == 0)
- {
- 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);
- 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);
- new string2[256];
- if(unformat(params, "i", pret))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Foloseste: /asetpret <pret>");
- return 1;
- }
- if(IsPlayerAdmin(playerid))
- {
- if(IsAnOwnableCar(vehid))
- {
- if(loc == 0)
- {
- 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);
- if(VehInfo[vehid][Cumparata] == 0)
- {
- format(string2, sizeof(string2), " DeVanzare\n Model: %s \n Pret: %d",GetVehicleName(vehid), VehInfo[vehid][Valoare]);
- Update3DTextLabelText(vtextlabel[vehid], 0x7FFF00FF, string2);
- Attach3DTextLabelToVehicle(vtextlabel[vehid] , vehid, 0.0, 0.0, 0.0);
- }
- }
- 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(!(VehInfo[vehid][Propietar] == name5[playerid]))
- {
- 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:acreatecar(playerid, params[])
- {
- new string[256], model, valoare, culoare1, culoare2, string2[256];
- new name[MAX_PLAYER_NAME];
- 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], 20 ,"DeVanzare");
- SetVehicleNumberPlate(vehid,VehInfo[vehicle][Numar]);
- strmid(VehInfo[vehid][Numar], "DeVanzare", 0, strlen("DeVanzare"), 20);
- 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"), 10); 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];
- if(!(IsAtDealership(playerid)))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[Server-Info] Trebuie sa fii la Dealer.");
- 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 nu 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 diler");
- return 1;
- }
- return 1;
- }
- CMD:vvinde(playerid, params[])
- {
- new name5[MAX_PLAYER_NAME], vehid = GetPlayerVehicleID(playerid), dealer[MAX_PLAYERS], string[256];
- GetPlayerName(playerid, name5, sizeof(name5));
- format(dealer, sizeof(dealer), name5);
- new string2[256];
- new engine,lights,alarm,doors,bonnet,boot,objective;
- new bani;
- if(!(VehInfo[vehid][Propietar] == dealer[playerid]))
- {
- 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], dealer[MAX_PLAYERS], 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(!(VehInfo[vehid][Propietar] == dealer[playerid]))
- {
- 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(VehInfo[vehid][Propietar] == name5[playerid])
- {
- 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);
- 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(VehInfo[carid][Propietar] == name[playerid])
- {
- 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(VehInfo[vehid][Propietar] == name[playerid])
- {
- 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"; }
- format(string, sizeof(string), " CarID: %d, Model: %s Valoare: %d, Neon: %s, Inchisa: %s,", vehid, GetVehicleName(vehid), value, Neontxt, Statustxt);
- 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\n\n");
- strcat( string, "{FFFFFF}Sistemul de vehicule personale creeat de: {FFFAF0}Gireada");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_MSGBOX,"Comenzi",string,"Accept","");
- 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(!(VehInfo[vehicleid][Propietar] == name[playerid]))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "Nu ai cheile acestui vehicul");
- }
- 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");
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- 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]);
- 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);
- }
- idx++;
- }
- 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 OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) // 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;
- }
- new VehicleNames[][] =
- {
- "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
- "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
- "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
- "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
- "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
- "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
- "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
- "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "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", "Cropduster", "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", "Hustler", "Intruder", "Primo",
- "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
- "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
- "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
- "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
- "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
- "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
- "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
- "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
- "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
- "Tiller", "Utility Trailer"
- };
- stock GetVehicleName(vehicleid)
- {
- new String[256];
- format(String,sizeof(String),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
- return String;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement