Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: yabb3 poslato Maj 01, 2013, 16:16:20 POSLE PODNE

Naslov: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 01, 2013, 16:16:20 POSLE PODNE
Skipta koju koristim: Ravens GM
Problem:

Definisao sam Faction vozila tacan broj je 340
new car = 340;

339 je poslednji auto u GM i dodao sam za jedan vise,medjutim kupim automobil trenutno u statsu nemam nista

slika 1: http://i39.tinypic.com/30979ja.png - ovde je stats bez automobila
slika 2: http://i44.tinypic.com/qxkoj6.png - ovde sam kupio svoj automobil
slika 3: http://i43.tinypic.com/x3ihiu.png - ovde se automobil nalazi u statsu sve lepo kaze
slika 4: http://i44.tinypic.com/dz81m1.png - ovde ja ulazim u svoj lepi automobil i sve je uredu
slika 5: http://i41.tinypic.com/2efnihj.png - NAKON /gmx restarta nista nije kako treba ulazim u isti auto pise owner: prazno
slika 5: http://i42.tinypic.com/r74nz9.png - ovde u statsu kaze da je moj auto neki Dumper koji je u stvari saleVehicle i ja nisam njegov vlasnik

Ako neko zna u cemu sam pogresio neka mi molim vas objasni
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 01, 2013, 20:26:17 POSLE PODNE
Jel zna neko?  :'(
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: Bilsen_Jahjagic poslato Maj 01, 2013, 21:15:25 POSLE PODNE
Moras da napravis da kad igrac kupi vozilo cuva se u njegovom fajlu,inace nista.
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 01, 2013, 21:16:47 POSLE PODNE
mislis da stavim da se podatci vozila stavljaju na njegov acc?
Kako to da izvedem?
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: Bilsen_Jahjagic poslato Maj 01, 2013, 21:20:39 POSLE PODNE
Daj mi komandu ili dialog kojim kupujes vozilo  ,da pogledam varijable.
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 01, 2013, 21:32:47 POSLE PODNE
        else if(strcmp(x_nr,"buy",true) == 0)
        {
            new car = 340;
            new model = GetVehicleModel(idcar);
            if(IsASalesVehicle(idcar))
            {
                if(PlayerInfo[playerid][pLevel] < 5)
    {
                    SendClientMessage(playerid, COLOR_GREY, "You need to be level 5 to buy a vehicle!");
                    return 1;
    }
    if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999 || PlayerInfo[playerid][pPcarkey3] == 9999) { }
    else return SendClientMessage(playerid, COLOR_GREY,"* You already own Three cars!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
    if(PlayerInfo[playerid][pCarLic] == 1)
    {
for(new h = 340; h < sizeof(CarInfo); h++)
{
if(CarInfo[h][cOwned] == 0)
{
car = h;
h = 9999;
}
}
format(string, sizeof(string),"LARP/Vehicles/%d.ini",car)
dini_Create(string);

if(PlayerInfo[playerid][pPcarkey] == 9999) { PlayerInfo[playerid][pPcarkey] = car; }
else if(PlayerInfo[playerid][pPcarkey2] == 9999) { PlayerInfo[playerid][pPcarkey2] = car; }
else if(PlayerInfo[playerid][pPcarkey3] == 9999) { PlayerInfo[playerid][pPcarkey3] = car; }
else { return 1; }
CarInfo[car][cOwned] = 1;
strmid(CarInfo[car][cOwner], sendername, 0, strlen(sendername), 999);
SafeGivePlayerMoney(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;
SendClientMessage(playerid, COLOR_GREY, "Remember to set the new Security Code of the Car (/v setcode)!");
new pass[24];
format(pass, sizeof(pass),"%d%d%d",random(9),random(9),random(9));
CarInfo[car][cCode] = strval(pass);
OnPropUpdate(4,car);
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;
}
            }
        }
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 01, 2013, 23:38:37 POSLE PODNE
Jel mi moze neko pomoci u opste ne razumem zasto nakon restarta radi a dok ne restartujem sve je ok posle restarta nista nije u redu,i opet isto tako obrisem iz server fajlova kupljeno auto,izbrisem iz stats auto i kupim ga i sve normalno dok ne restartujem opet
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: Bilsen_Jahjagic poslato Maj 02, 2013, 05:59:18 PRE PODNE
Mislim da bi to ovako trebalo da ide na ravensu.
Ispod publica onplayerregister dodaj:
format(var, 64, "Car=%d\n",PlayerInfo[playerid][pPcarkey]);fwrite(hFile, var);
format(var, 64, "Car2=%d\n",PlayerInfo[playerid][pPcarkey2]);fwrite(hFile, var);
format(var, 64, "Car3=%d\n",PlayerInfo[playerid][pPcarkey3]);fwrite(hFile, var);

Ispod publica OnPlayerUpdateCustom
format(var, 64, "Car=%d\n",PlayerInfo[playerid][pPcarkey]);fwrite(hFile, var);
format(var, 64, "Car2=%d\n",PlayerInfo[playerid][pPcarkey2]);fwrite(hFile, var);
format(var, 64, "Car3=%d\n",PlayerInfo[playerid][pPcarkey3]);fwrite(hFile, var);

Ispod onplayerlogin
        if( strcmp( key , "Car" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey] = strval( val ); }
        if( strcmp( key , "Car2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey2] = strval( val ); }
        if( strcmp( key , "Car3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey3] = strval( val ); }

Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 02, 2013, 13:24:30 POSLE PODNE
nesto slicno vec postoji a i nemam OnPlayerUpdateCustom
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: Bilsen_Jahjagic poslato Maj 02, 2013, 15:35:11 POSLE PODNE
Daj mi komandu /update
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 02, 2013, 17:21:37 POSLE PODNE
Citat: Joe_Most poslato Maj 02, 2013, 15:35:11 POSLE PODNE
Daj mi komandu /update

if (strcmp(cmd, "/update", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
    ShowPlayerDialog(playerid,19990,DIALOG_STYLE_LIST,"Select which thing do you want to reload","1\tUser file\n2\tVehicle File\n3\tHouse File\n3\tBizz File\n4\tSBizz File","Select","Cancel");
}
else
{
    SendClientMessage(playerid, COLOR_GREY,"* You're not authorised to use this command!");
    return 1;
}
return 1;
}


Ja nisam siguran da li je do cuvanja server fajlova jer kao da se pomesaju idovi na primer imao sam zadnji auto 339 taj dumper koji je na prodaju i onda nakon restarta ako ima 10 kupljenih auta svih deset su taj zadnji dumper ali sa drugim idovima a u server files stoji lepo id auta i ko je vlasnik ja mislim nikako mi nije jasno zasto se to dogadja
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 03, 2013, 01:15:36 PRE PODNE
Evo na primer sada sam stavio pod
new car = 340;
sam stavio 1
I sada kad kupim auto krene od ID 1 i to bude na primer Army kamion ali kada gmx ono ga zameni i kupljeni auto je u redu,ali nije mi jasno zasto kada stavim na poslednji auto u GM a to je 339 i stavio sam 1 vise i sve bude ok dok ne restartujem nikako mi nije jasno zasto sad kada stavim na 1 radi ali zamenjuje Org aute a ovako kako bi trebalo biti nece  :'(
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 05, 2013, 03:18:43 PRE PODNE
Znaci niko ne zna u cemo bi mogao biti problem?
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 05, 2013, 14:40:33 POSLE PODNE
Niko ne zna da pomogne,moze lock onda
Naslov: Odg: [Pomoc] u vezi Veh system
Poruka od: yabb3 poslato Maj 06, 2013, 16:50:58 POSLE PODNE
Platicu nekom iz Srbije 1000 dinara samo da mi resi ovo.
Probao sam i da izbrisem sva org vozila i ostavim po jedan i definisem 18 + 1 = 19 auta samo jedan sales car ostavim i sve znaci kupim prvi id19 kupim drugi id20 kupim treci isto id 20 i pise da je state,ja odjem i v park i on na moje ime nemam ideju zasto je ovo tako,ako zeli neko da mi pomogne ili ako problem nije resiv da me kontaktira ako neko moze da mi ubaci bilo kakav drugi car system jer cu poludeti :D