[Pomoc]Raven's ownership

Započeo [BURPG] Wistaa, Septembar 04, 2012, 17:58:24 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: BURPG (Edit: Raven's)
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 :D

enum cInfo
{
cModel,
Float:cLocationx,
Float:cLocationy,
Float:cLocationz,
Float:cAngle,
cColorOne,
cColorTwo,
cOwner[MAX_PLAYER_NAME],
cOwned,
cLock,
cPaintjob,
cVirWorld,
cComponent0,
cComponent1,
cComponent2,
cComponent3,
cComponent4,
cComponent5,
cComponent6,
cComponent7,
cComponent8,
cComponent9,
cComponent10,
cComponent11,
cComponent12,
cComponent13,
};

new CarInfo[425][cInfo];


}

public LoadCar()
{
new file[26];
for(new idx = 424; idx < sizeof(CarInfo) ; idx++)
{
    format(file, sizeof(file),"BURPG/Vehicles/%d.ini", idx)
if(dini_Exists(file))
{
CarInfo[idx][cModel] = dini_Int(file,"Model");
CarInfo[idx][cLocationx] = dini_Float(file,"Location_X");
CarInfo[idx][cLocationy] = dini_Float(file,"Location_Y");
CarInfo[idx][cLocationz] = dini_Float(file,"Location_Z");
CarInfo[idx][cAngle] = dini_Float(file,"Angle");
CarInfo[idx][cColorOne] = dini_Int(file,"Color_1");
CarInfo[idx][cColorTwo] = dini_Int(file,"Color_2");
strmid(CarInfo[idx][cOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
CarInfo[idx][cOwned] = dini_Int(file,"Owned");
CarInfo[idx][cLock] = dini_Int(file,"Locked");
CarInfo[idx][cPaintjob] = dini_Int(file,"Paintjob");
CarInfo[idx][cVirWorld] = dini_Int(file,"VirtualWorld");
    CarInfo[idx][cComponent0] = dini_Int(file,"Component0");
    CarInfo[idx][cComponent1] = dini_Int(file,"Component1");
CarInfo[idx][cComponent2] = dini_Int(file,"Component2");
CarInfo[idx][cComponent3] = dini_Int(file,"Component3");
CarInfo[idx][cComponent4] = dini_Int(file,"Component4");
CarInfo[idx][cComponent5] = dini_Int(file,"Component5");
CarInfo[idx][cComponent6] = dini_Int(file,"Component6");
CarInfo[idx][cComponent7] = dini_Int(file,"Component7");
CarInfo[idx][cComponent8] = dini_Int(file,"Component8");
CarInfo[idx][cComponent9] = dini_Int(file,"Component9");
CarInfo[idx][cComponent10] = dini_Int(file,"Component10");
CarInfo[idx][cComponent11] = dini_Int(file,"Component11");
CarInfo[idx][cComponent12] = dini_Int(file,"Component12");
CarInfo[idx][cComponent13] = dini_Int(file,"Component13");
}
}
print("[SCRIPT]: Loaded Cars");
return 1;


Ovo ispod svih vozila:

LoadCar();
new string2[64];
for(new h = 424; h < sizeof(CarInfo); h++)
{
format(string2, sizeof(string2), "BURPG/Vehicles/%d.ini",h);
if(dini_Exists(string2))
{
ownedcar[h] = AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
if(CarInfo[h][cPaintjob] != 999)
{
ChangeVehiclePaintjob(h, CarInfo[h][cPaintjob]);
}
SetVehicleVirtualWorld(h, CarInfo[h][cVirWorld]);
SetVehicleModifications(h);
}


}
else if(update == 4)
{
format(file, sizeof(file),"BURPG/Vehicles/%d.ini",idx);
if(dini_Exists(file))
{
dini_IntSet(file,"Model",CarInfo[idx][cModel]);
dini_FloatSet(file,"Location_X",CarInfo[idx][cLocationx]);
dini_FloatSet(file,"Location_Y",CarInfo[idx][cLocationy]);
dini_FloatSet(file,"Location_Z",CarInfo[idx][cLocationz]);
dini_FloatSet(file,"Angle",CarInfo[idx][cAngle]);
dini_IntSet(file,"Color_1",CarInfo[idx][cColorOne]);
dini_IntSet(file,"Color_2",CarInfo[idx][cColorTwo]);
dini_Set(file,"Owner",CarInfo[idx][cOwner]);
dini_IntSet(file,"Owned",CarInfo[idx][cOwned]);
dini_IntSet(file,"Locked",CarInfo[idx][cLock]);
dini_IntSet(file,"Paintjob",CarInfo[idx][cPaintjob]);
dini_IntSet(file,"VirtualWorld",CarInfo[idx][cVirWorld]);
dini_IntSet(file,"Component0",CarInfo[idx][cComponent0]);
dini_IntSet(file,"Component1",CarInfo[idx][cComponent1]);
dini_IntSet(file,"Component2",CarInfo[idx][cComponent2]);
dini_IntSet(file,"Component3",CarInfo[idx][cComponent3]);
dini_IntSet(file,"Component4",CarInfo[idx][cComponent4]);
dini_IntSet(file,"Component5",CarInfo[idx][cComponent5]);
dini_IntSet(file,"Component6",CarInfo[idx][cComponent6]);
dini_IntSet(file,"Component7",CarInfo[idx][cComponent7]);
dini_IntSet(file,"Component8",CarInfo[idx][cComponent8]);
dini_IntSet(file,"Component9",CarInfo[idx][cComponent9]);
dini_IntSet(file,"Component10",CarInfo[idx][cComponent10]);
dini_IntSet(file,"Component11",CarInfo[idx][cComponent11]);
dini_IntSet(file,"Component12",CarInfo[idx][cComponent12]);
dini_IntSet(file,"Component13",CarInfo[idx][cComponent13]);
}
}
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[playerid][pLevel] < 2)
    {
                    SendClientMessage(playerid, COLOR_GREY, "You need to be level 2 to buy a vehicle!");
                    return 1;
    }
    if(PlayerInfo[playerid][pPcarkey] == 999 || PlayerInfo[playerid][pPcarkey2] == 999) { }
    else return SendClientMessage(playerid, COLOR_GREY,"* You already own Two cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
    if(PlayerInfo[playerid][pCarLic] == 1)
    {
for(new h = 425; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 999;
}
}
format(string, sizeof(string),"BURPG/Vehicles/%d.ini",car)
dini_Create(string);

if(PlayerInfo[playerid][pPcarkey] != 999) { PlayerInfo[playerid][pPcarkey2] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeJBC_GivePlayerMoney(playerid,-GetVehiclePrice(idcar));
if(IsModelAPlane(idcar) || IsModelAHeli(idcar))
{
CarInfo[car][cLocationx] = 1432.6451;
CarInfo[car][cLocationy] = 1378.7216;
CarInfo[car][cLocationz] = 11.5507;
CarInfo[car][cAngle] = 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[car][cLocationx] = -1568.9614;
CarInfo[car][cLocationy] = 169.0118;
CarInfo[car][cLocationz] = -0.6016;
CarInfo[car][cAngle] = 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[car][cLocationx] = -1589.2644;
CarInfo[car][cLocationy] = 106.9119;
CarInfo[car][cLocationz] = 3.5495;
CarInfo[car][cAngle] = 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[car][cModel] = model;
CarInfo[car][cVirWorld] = 0;
CarInfo[car][cPaintjob] = 999;

CarInfo[car][cColorOne] = 1;
CarInfo[car][cColorTwo] = 1;

CarInfo[car][cComponent0] = 0;
CarInfo[car][cComponent1] = 0;
CarInfo[car][cComponent2] = 0;
CarInfo[car][cComponent3] = 0;
CarInfo[car][cComponent4] = 0;
CarInfo[car][cComponent5] = 0;
CarInfo[car][cComponent6] = 0;
CarInfo[car][cComponent7] = 0;
CarInfo[car][cComponent8] = 0;
CarInfo[car][cComponent9] = 0;
CarInfo[car][cComponent10] = 0;
CarInfo[car][cComponent11] = 0;
CarInfo[car][cComponent12] = 0;
CarInfo[car][cComponent13] = 0;

DestroyVehicle(car);
ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],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[playerid] = 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;
}
            }




Balkan Ulice RPG opis servera: Click



-Tutorial za mijesanje ID-ova na vozilima: Click

Stari covek

IsASalesVehicle jel si tu podesio od kog id-a?

[quote author=[OG:RP] Mr.Gagi link=topic=52716.msg383699#msg383699 date=1346775550]
IsASalesVehicle jel si tu podesio od kog id-a?
[/quote]

Nema se sta tu podesiti,to je uradjeno sa array to ne predstavlja problem




Balkan Ulice RPG opis servera: Click



-Tutorial za mijesanje ID-ova na vozilima: Click

Ne treba pomoc vise sredio sam problem...
Poslednja Izmena: Septembar 05, 2012, 10:57:33 PRE PODNE od [BURPG] 4men




Balkan Ulice RPG opis servera: Click



-Tutorial za mijesanje ID-ova na vozilima: Click

Izvinjavam se za jos jedan DP,ali pojavio se jos jedan problem znaci kada kupim auto sve fino radi kako treba,ali kada zatvorim pa otvorim server udjem tog auta sto sam kupio vise nema,u cemu je fazon?




Balkan Ulice RPG opis servera: Click



-Tutorial za mijesanje ID-ova na vozilima: Click