Opis problema: Znaci dok je Gagi skriptao kod nas ubacio je svoj CoS,kada je on otisao bilo je dosta bugova,jedan popravim dodje novi,pa sam to izbrisao,sada posto nemam ownership-a a nisam nikako mogao urediti GTA RP ownership,ponovo zelim ovaj. Znaci ovako ubacio sam jedno vozilo na prodaju,bez tog vozila na prodaju imam 423 vozila + to 424. Ja sam stavio u CarInfo 425, na /v buy da vozila krecu od 424,ali onda dodje problem poklapaju se id-ovi naravno,kada stavim da krece od 425 onda kada kucam /v buy pise server unkown command
Dio skripte: Evo dat cu sve dijelove sto se tice toga 😄
enum cInfo
{
cModel,
Float:cLocationx,
Float:cLocationy,
Float:cLocationz,
Float:cAngle,
cColorOne,
cColorTwo,
cOwner,
cOwned,
cLock,
cPaintjob,
cVirWorld,
cComponent0,
cComponent1,
cComponent2,
cComponent3,
cComponent4,
cComponent5,
cComponent6,
cComponent7,
cComponent8,
cComponent9,
cComponent10,
cComponent11,
cComponent12,
cComponent13,
};
new CarInfo;}
public LoadCar()
{
new file;
for(new idx = 424; idx < sizeof(CarInfo) ; idx++)
{
format(file, sizeof(file),"BURPG/Vehicles/%d.ini", idx)
if(dini_Exists(file))
{
CarInfo = dini_Int(file,"Model");
CarInfo = dini_Float(file,"Location_X");
CarInfo = dini_Float(file,"Location_Y");
CarInfo = dini_Float(file,"Location_Z");
CarInfo = dini_Float(file,"Angle");
CarInfo = dini_Int(file,"Color_1");
CarInfo = dini_Int(file,"Color_2");
strmid(CarInfo, dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
CarInfo = dini_Int(file,"Owned");
CarInfo = dini_Int(file,"Locked");
CarInfo = dini_Int(file,"Paintjob");
CarInfo = dini_Int(file,"VirtualWorld");
CarInfo = dini_Int(file,"Component0");
CarInfo = dini_Int(file,"Component1");
CarInfo = dini_Int(file,"Component2");
CarInfo = dini_Int(file,"Component3");
CarInfo = dini_Int(file,"Component4");
CarInfo = dini_Int(file,"Component5");
CarInfo = dini_Int(file,"Component6");
CarInfo = dini_Int(file,"Component7");
CarInfo = dini_Int(file,"Component8");
CarInfo = dini_Int(file,"Component9");
CarInfo = dini_Int(file,"Component10");
CarInfo = dini_Int(file,"Component11");
CarInfo = dini_Int(file,"Component12");
CarInfo = dini_Int(file,"Component13");
}
}
print(": Loaded Cars");
return 1;Ovo ispod svih vozila:
LoadCar();
new string2;
for(new h = 424; h < sizeof(CarInfo); h++)
{
format(string2, sizeof(string2), "BURPG/Vehicles/%d.ini",h);
if(dini_Exists(string2))
{
ownedcar = AddStaticVehicleEx(CarInfo,CarInfo,CarInfo,CarInfo+1.0,CarInfo,CarInfo,CarInfo,60000);
if(CarInfo != 999)
{
ChangeVehiclePaintjob(h, CarInfo);
}
SetVehicleVirtualWorld(h, CarInfo);
SetVehicleModifications(h);
}}
else if(update == 4)
{
format(file, sizeof(file),"BURPG/Vehicles/%d.ini",idx);
if(dini_Exists(file))
{
dini_IntSet(file,"Model",CarInfo);
dini_FloatSet(file,"Location_X",CarInfo);
dini_FloatSet(file,"Location_Y",CarInfo);
dini_FloatSet(file,"Location_Z",CarInfo);
dini_FloatSet(file,"Angle",CarInfo);
dini_IntSet(file,"Color_1",CarInfo);
dini_IntSet(file,"Color_2",CarInfo);
dini_Set(file,"Owner",CarInfo);
dini_IntSet(file,"Owned",CarInfo);
dini_IntSet(file,"Locked",CarInfo);
dini_IntSet(file,"Paintjob",CarInfo);
dini_IntSet(file,"VirtualWorld",CarInfo);
dini_IntSet(file,"Component0",CarInfo);
dini_IntSet(file,"Component1",CarInfo);
dini_IntSet(file,"Component2",CarInfo);
dini_IntSet(file,"Component3",CarInfo);
dini_IntSet(file,"Component4",CarInfo);
dini_IntSet(file,"Component5",CarInfo);
dini_IntSet(file,"Component6",CarInfo);
dini_IntSet(file,"Component7",CarInfo);
dini_IntSet(file,"Component8",CarInfo);
dini_IntSet(file,"Component9",CarInfo);
dini_IntSet(file,"Component10",CarInfo);
dini_IntSet(file,"Component11",CarInfo);
dini_IntSet(file,"Component12",CarInfo);
dini_IntSet(file,"Component13",CarInfo);
}
}
return 1;Komanda za kupovinu vozila,na engleskom je:
}
else if(strcmp(x_nr,"buy",true) == 0)
{
new car = 424;
new model = GetVehicleModel(idcar);
if(IsASalesVehicle(idcar))
{
if(PlayerInfo < 2)
{
SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
return 1;
}
if(PlayerInfo == 999 || PlayerInfo == 999) { }
else return SendClientMessage(playerid, COLOR_GREY,"* You already own Two cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
if(PlayerInfo == 1)
{
for(new h = 425; h < sizeof(CarInfo); h++)
{
if(CarInfo == 0)
{
car = h;
h = 999;
}
}
format(string, sizeof(string),"BURPG/Vehicles/%d.ini",car)
dini_Create(string);
if(PlayerInfo != 999) { PlayerInfo = car; }
else { PlayerInfo = car; }
CarInfo = 1;
strmid(CarInfo, sendername, 0, strlen(sendername), 999);
SafeJBC_GivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
{
CarInfo = 1432.6451;
CarInfo = 1378.7216;
CarInfo = 11.5507;
CarInfo = 359.2072;
SendClientMessage(playerid, COLOR_YELLOW2, "Your Aircraft has been deliveried to Las Venturas Airport, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
}
else if(IsModelABoat(idcar))
{
CarInfo = -1568.9614;
CarInfo = 169.0118;
CarInfo = -0.6016;
CarInfo = 208.7506;
SendClientMessage(playerid, COLOR_YELLOW2, "Your Boat has been deliveried to San Fierro Docks, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
else
{
CarInfo = -1589.2644;
CarInfo = 106.9119;
CarInfo = 3.5495;
CarInfo = 317.1649;
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle has been deliveried to San Fierro Docks, you can get it there!");
SendClientMessage(playerid, COLOR_YELLOW2, "Your vehicle is unlocked so you can pay someone to deliver it to your new spawn point!");
SendClientMessage(playerid, COLOR_NICERED, "REMEMBER: Leaving your car in the deliver point can get your car SOLD by an administration without refund!");
GameTextForPlayer(playerid, "~p~Congratulations~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
CarInfo = model;
CarInfo = 0;
CarInfo = 999;
CarInfo = 1;
CarInfo = 1;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
CarInfo = 0;
DestroyVehicle(car);
ownedcar = CreateVehicle(CarInfo,CarInfo,CarInfo,CarInfo,90.0,1,1,30000);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SendClientMessage(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
gEngine = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
OnPropUpdate(4);
OnPlayerUpdateEx(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* For security reasons, a Driving License is needed to buy a car!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
}