[pomoc]CO-Ship Na 2 mjesta

Započeo dane_1, Novembar 19, 2011, 13:42:02 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:LARP
Detaljan opis problema:Ovako..Co system mi je ovakvi..Kod grotia mi mora stajat 60+ auta sto stvara lagg..Pa sam mislio raposedit na 2-3 mjesta..NPR LowRideraute tamo kod jeff motela..Ali kad sjedne u auto i kuca /car buy kupi auto i stvori mu novi ispred grotia..Ja bi da mi ostane i taj pred grotiem i tamo kod jeff hotela..Ako ste me imalo razumjeli ,pomozite :)
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):

U larpu imas salescar[2] = AddStaticVehicle....
e tu npr namapiras aute di hoces i tu dodaje aute ovako
salescar[3] = AddStaticVehicle..i auto koji si dodao i onda je on na prodaju
nadam se da si me razumio i da sma ti pomogo
<a href="http://tinypic.com?ref=5l2yrb" target="_blank"><img src="http://i47.tinypic.com/5l2yrb.png" border="0" alt="Image and video hosting by TinyPic"></a>

Nisi jer nisi shvatio..Ja znam to al ako stavim na 2 mjesta to i kad kupi neko auto na tom drugom mjestu mora ic na 1. mjesto po auto..Kuzis

Kad prebacis sva vozila na zeljeno mesto (podelis na dva auto salona), kroisti sledece

IsPlayerInRangeOfPoint(playerid, 10, x, y, z)

Evo ovako gledaj:

ovo je jedan deo komande u /v buy


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, "Cestitamo na kupovini auta, da bi saznali dodatne opcije za vas auto, kucajte /vehiclehelp");
SendClientMessage(playerid, COLOR_NICERED, "Nezaboravi da parkiras svoje vozilo na zeljeno mesto (/v park)!!");
}


a ti uradis ovako:


else
{
if{IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) // ovde stavis koordinate gde ti se nalazi auto salon 1
{
CarInfo[car][cLocationx] = x;
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = a;
}
else if{IsPlayerInRangeOfPoint(playerid, 20, x, y, z)) // ovde stavis koordinate gde ti se nalazi auto salon 2
{
CarInfo[car][cLocationx] = x;
CarInfo[car][cLocationy] = y;
CarInfo[car][cLocationz] = z;
CarInfo[car][cAngle] = a;
}
SendClientMessage(playerid, COLOR_YELLOW2, "Cestitamo na kupovini auta, da bi saznali dodatne opcije za vas auto, kucajte /vehiclehelp");
SendClientMessage(playerid, COLOR_NICERED, "Nezaboravi da parkiras svoje vozilo na zeljeno mesto (/v park)!!");
}


Ovo ti je ustvari sad uradjena komanda, samo treba da podesis koordinate...

Nisam compile pa da vidim el radi, al ako nevalja nesto, napisi ovde...

Samo da znas, ovaj tekst cestitamo na kupovini... ti to prepravi kako hoces da bude, aj sam ovo izvadio iz svog moda (ravens edit), pa je zato drugaciji tekst... msm da u originalu stoji GameTextForPlayer, pa ti namesti kako treba da bude...
Poslednja Izmena: Novembar 19, 2011, 18:36:43 POSLE PODNE od [A]Maki187

evo ti moja buy komanda pa vidi..System mi je takvi da sjednem  u auto i kucam /car buy  i onda se spawna ispred..Ti mislis kao da na nekom mjestu dodem kucam /car buy id i spawna mi se auto?

else if(strcmp(x_nr,"buy",true) == 0)
        {
            new car = 1;
            new model = GetVehicleModel(idcar);
            if(IsASalesVehicle(idcar))
            TogglePlayerControllable(playerid, false);
            {
                if(PlayerInfo[playerid][pLevel] < 2)
    {
                    SendClientMessage(playerid, COLOR_GREY, "Morate biti level 2 da kupite vozilo!");
                    return 1;
    }
    if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999) { }
    else return SendClientMessage(playerid, COLOR_GREY,"* Već imate 2 vozila!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
    if(PlayerInfo[playerid][pCarLic] == 1)
    {
for(new h = 1; 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][pPcarkey2] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
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] = 558.2007;
CarInfo[car][cLocationy] = -1263.5748;
CarInfo[car][cLocationz] = 17.1381;
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~Cestitamo~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
}
else if(IsModelABoat(idcar))
{
    CarInfo[car][cLocationx] = 558.2007;
CarInfo[car][cLocationy] = -1263.5748;
CarInfo[car][cLocationz] = 17.1381;
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~Cestitamo~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
else
{
                                CarInfo[car][cLocationx] = 558.2007;
CarInfo[car][cLocationy] = -1263.5748;
CarInfo[car][cLocationz] = 17.1381;
CarInfo[car][cAngle] = 176.4683;
SendClientMessage(playerid, COLOR_YELLOW2, "Tvoje vozilo je dostavljeno ispred Salona, ondje ga pokupi!");
SendClientMessage(playerid, COLOR_NICERED, "ZAPAMTI: Ako ostaviš auto gdje se sad stvorilo, admin će ga prodati bez povrata novca!!");
GameTextForPlayer(playerid, "~p~Cestitamo~n~~w~ne zaboravi ga pokupiti ispred ~b~salona!", 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, "Cestitamo na kupnji!");
SendClientMessage(playerid, COLOR_GRAD2, "Napiši /vhelp da bi vidjeli priručnik!");
gEngine[playerid] = 1;
engineOn[GetPlayerVehicleID(playerid)] = true;
TogglePlayerControllable(playerid, true);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "Ne zaboravite postaviti novu lozinku vozila!");
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, "* Morate imati vozačku dozvolu da bi kupili vozilo!");
return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novca ! ");
    return 1;
}
            }
       

Pogresno si me rauzmeo, evo ti gotove komande ispod, i dole imas "uputstvo" sta da promenis...
else if(strcmp(x_nr,"buy",true) == 0)
       {
           new car = 1;
           new model = GetVehicleModel(idcar);
           if(IsASalesVehicle(idcar))
           TogglePlayerControllable(playerid, false);
           {
               if(PlayerInfo[playerid][pLevel] < 2)
    {
                    SendClientMessage(playerid, COLOR_GREY, "Morate biti level 2 da kupite vozilo!");
                    return 1;
    }
    if(PlayerInfo[playerid][pPcarkey] == 9999 || PlayerInfo[playerid][pPcarkey2] == 9999) { }
    else return SendClientMessage(playerid, COLOR_GREY,"* Već imate 2 vozila!");
if(GetPlayerMoney(playerid) >= GetVehiclePrice(idcar))
{
   if(PlayerInfo[playerid][pCarLic] == 1)
   {
for(new h = 1; 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][pPcarkey2] = car; }
else { PlayerInfo[playerid][pPcarkey] = car; }
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] = 558.2007;
CarInfo[car][cLocationy] = -1263.5748;
CarInfo[car][cLocationz] = 17.1381;
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~Cestitamo~n~~w~Don't forget to pickup your car at the ~b~Las Venturas Airport!", 5000, 3);
}
else if(IsModelABoat(idcar))
{
   CarInfo[car][cLocationx] = 558.2007;
CarInfo[car][cLocationy] = -1263.5748;
CarInfo[car][cLocationz] = 17.1381;
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~Cestitamo~n~~w~Don't forget to pickup your car at the ~b~San Fierro Docks!", 5000, 3);
}
else  
                    {  
                    if{IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) // ovde stavis koordinate gde ti se nalazi auto salon 1  
                    {  
                       CarInfo[car][cLocationx] = x;  
                       CarInfo[car][cLocationy] = y;  
                       CarInfo[car][cLocationz] = z;  
                       CarInfo[car][cAngle] = a;  
                    }  
                    else if{IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) // ovde stavis koordinate gde ti se nalazi auto salon 2  
                    {  
                       CarInfo[car][cLocationx] = x;  
                       CarInfo[car][cLocationy] = y;  
                       CarInfo[car][cLocationz] = z;  
                       CarInfo[car][cAngle] = a;  
                    }  
                       SendClientMessage(playerid, COLOR_YELLOW2, "Cestitamo na kupovini auta, da bi saznali dodatne opcije za vas auto, kucajte /vehiclehelp");  
                       SendClientMessage(playerid, COLOR_NICERED, "Nezaboravi da parkiras svoje vozilo na zeljeno mesto (/v park)!!");  
                    }
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, "Cestitamo na kupnji!");
SendClientMessage(playerid, COLOR_GRAD2, "Napiši /vhelp da bi vidjeli priručnik!");
gEngine[playerid] = 1;
engineOn[GetPlayerVehicleID(playerid)] = true;
TogglePlayerControllable(playerid, true);
SafeRemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, "Ne zaboravite postaviti novu lozinku vozila!");
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, "* Morate imati vozačku dozvolu da bi kupili vozilo!");
return 1;
}
}
else
{
   SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novca ! ");
   return 1;
}
           }
       


Obicno je u ravensu /v buy, al ok, promenio si na car... svejedno, evo ubacio sam ti u komandu sve sto ej trebalo, i gledaj sad sta da uradis...


if{IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) // auto salon 1
                    {  
                       CarInfo[car][cLocationx] = x;  
                       CarInfo[car][cLocationy] = y;  
                       CarInfo[car][cLocationz] = z;  
                       CarInfo[car][cAngle] = a;  
                    }  
                    else if{IsPlayerInRangeOfPoint(playerid, 30, x, y, z)) // auto salon 2  
                    {  
                       CarInfo[car][cLocationx] = x;  
                       CarInfo[car][cLocationy] = y;  
                       CarInfo[car][cLocationz] = z;  
                       CarInfo[car][cAngle] = a;  
                    }  


Ovde gde pise auto salon 1, tu uzmes i stavis npr koordinate koje su kod grotti, onda ovo sto sadrzi auto salon (cLocationx...), tu stavis koordinate gde zelis da ti se stvori auto posle kupovine (ispred salona verovatno)
a u ovo drugo, uradis isto samo sto stavis koordiante koje su kod hotela ili gde vec zelis, i gde ispred tog hotela zleis da ti se stvori auto (pominjao si neki hotel, zato ga koristim)

U prevodu, ukoliko kupis auto kod grotija, auto ce se stvoriti ispred grotija, ukoliko ga kupis kod tog hotela, on ce se stvoriti kod tog hotela, naravno na koordinatama koje si ti odredio...
Poslednja Izmena: Novembar 20, 2011, 02:29:15 PRE PODNE od [A]Maki187

fejlo si ovo if{isplayer in.... umjesto te zagrade trea ic (?

Working..TNX brate..
Poslednja Izmena: Novembar 20, 2011, 13:09:53 POSLE PODNE od dane_1