[POMOC] Rent vozila

Započeo Mirnas_Tajic, April 11, 2011, 21:32:04 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

Citat: Mirnas_Tajic poslato April 12, 2011, 22:15:08 POSLE PODNE
56,55,57,58,59,1000,1316,1314,1317 Eto i hvala unaprjed

dakle evo ti kod.

if(newcar == 55 || newcar == 56 || newcar == 57 || newcar == 58 || newcar == 59 || newcar == 1000 || newcar == 1314 || newcar == 1316 || newcar == 1317)



Posjetite nas i osjetite razliku
www.balkan-city.info



193.192.59.151:7788


Game monitor nije u 100% tocan tj uvjek pokaziva manje

dragan12

Evo ja msm da ce hteti ovako komanda:
if(strcmp(cmd, "/rentcar", true) == 0)
{
        if(IsPlayerConnected(playerid))
{
if((GetPlayerVehicleID(playerid) >= 55 && GetPlayerVehicleID(playerid) <= 59) || (GetPlayerVehicleID(playerid) == 1000) || (GetPlayerVehicleID(playerid) == 1314) || (GetPlayerVehicleID(playerid) == 1316) || (GetPlayerVehicleID(playerid) == 1317))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nema Produkata", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate novca !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Morate unrentati prvo vas prethodni auto/motor/brod prvo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(HireCar[i] == GetPlayerVehicleID(playerid))
    {
        SendClientMessage(playerid, COLOR_GREY, "    Netko je vec rentao ovo vozilo !");
        return 1;
    }
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate(3);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Ne zaboravite ~r~/unrentcar~n~~g~/lock ~w~za zakljucavanje.",hirefee);
SendClientMessage(playerid, COLOR_YELLOW2, "Mozete upaliti motor vozila !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);

new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentcar",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
return 1;
}

I ovo drugo:
if((newcar >= 55&& newcar <= 59) || (newcar == 1000) || (newcar == 1314) || (newcar == 1316) || (newcar == 1317))
      {
         if (HireCar[playerid] != newcar)
         {
            format(string, sizeof(string), "~w~Mozete unajmiti ovo vozilo~n~Cijena:~g~$%d~n~~w~Za iznajmiti Koristi ~g~/rentcar~w~~n~za izlazak Koristi ~r~/exit",SBizzInfo[1][sbEntranceCost]);
Poslednja Izmena: April 12, 2011, 22:28:38 POSLE PODNE od Gagi_Corleone

Mirnas_Tajic

Citat: [BC]Ante_Dracar aka Lopa poslato April 12, 2011, 22:24:37 POSLE PODNE
Citat: Mirnas_Tajic poslato April 12, 2011, 22:15:08 POSLE PODNE
56,55,57,58,59,1000,1316,1314,1317 Eto i hvala unaprjed

dakle evo ti kod.

if(newcar == 55 || newcar == 56 || newcar == 57 || newcar == 58 || newcar == 59 || newcar == 1000 || newcar == 1314 || newcar == 1316 || newcar == 1317)
znam ja to staviti ali kad kucam /rentcar neodu mi pare kontas? moram definirati kod /rentcar komande

Citat: Mirnas_Tajic poslato April 12, 2011, 22:30:10 POSLE PODNE
Citat: [BC]Ante_Dracar aka Lopa poslato April 12, 2011, 22:24:37 POSLE PODNE
Citat: Mirnas_Tajic poslato April 12, 2011, 22:15:08 POSLE PODNE
56,55,57,58,59,1000,1316,1314,1317 Eto i hvala unaprjed

dakle evo ti kod.

if(newcar == 55 || newcar == 56 || newcar == 57 || newcar == 58 || newcar == 59 || newcar == 1000 || newcar == 1314 || newcar == 1316 || newcar == 1317)
znam ja to staviti ali kad kucam /rentcar neodu mi pare kontas? moram definirati kod /rentcar komande

cek meni se cini da ni ti nezz sta zelis :D.

koliko sam shvatio u zadnjem postu tbi ono uspjesno renta ozilo ali ti neoduzme pare.

da ti oduzme novece stavi ovako.

GivePlayerMoney(playerid, -500);




Posjetite nas i osjetite razliku
www.balkan-city.info



193.192.59.151:7788


Game monitor nije u 100% tocan tj uvjek pokaziva manje

dragan12

E ti onda umesto ovoga
SafeGivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];

Stavi ovako samo stavi cenu i koliko love
SafeGivePlayerMoney(playerid,-cena renta);//Ovde ide minus pa koliko love
SBizzInfo[1][sbTill] += cenarenta];//A ovde samo lova ta da ide vlasniku bizza

Mirnas_Tajic

Kako ne kontate Ja kad stavim ovo: if(newcar >= 55&& newcar <= 59) || (newcar <= 1000) || (newcar <= 1314) || (newcar <= 1316) || (newcar) meni pise da je auto na rent itd.... ali kad kucam /rentcar nebude nista ali kad ja kod komande /rentcar stavim: if((GetPlayerVehicleID(playerid) >= 55 && GetPlayerVehicleID(playerid) <= 59) || onda mi se auto renta evo uzecemo npr.. auto koji ima ID 55 dakle ja ga moram definirati ali ako stavim vako sva ce mi auta od 55 do 59 biti na rent
         

dragan12

Evo komanda ali ti si i stavio da su ti ta auta za rent od 55 do 59 samo promeni cenu sto sam ti rekao. To si trazio i skidace ti pare sa ovim.
if(strcmp(cmd, "/rentcar", true) == 0)
{
        if(IsPlayerConnected(playerid))
{
if((GetPlayerVehicleID(playerid) >= 55 && GetPlayerVehicleID(playerid) <= 59) || (GetPlayerVehicleID(playerid) == 1000) || (GetPlayerVehicleID(playerid) == 1314) || (GetPlayerVehicleID(playerid) == 1316) || (GetPlayerVehicleID(playerid) == 1317))
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Nema Produkata", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   Nemate novca !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Morate unrentati prvo vas prethodni auto/motor/brod prvo !");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(HireCar[i] == GetPlayerVehicleID(playerid))
    {
        SendClientMessage(playerid, COLOR_GREY, "    Netko je vec rentao ovo vozilo !");
        return 1;
    }
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
SafeGivePlayerMoney(playerid,-cena renta);//Ovde ide minus pa koliko love
SBizzInfo[1][sbTill] += cenarenta];//A ovde samo lova ta da ide vlasniku bizza
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate(3);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Ne zaboravite ~r~/unrentcar~n~~g~/lock ~w~za zakljucavanje.",hirefee);
SendClientMessage(playerid, COLOR_YELLOW2, "Mozete upaliti motor vozila !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
//TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);

new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /rentcar",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
return 1;
}

Mirnas_Tajic

eh sad mi objasni kako da ja jos dodajem auta

prvo dodas novo vozilo u ongamemodeinit

i zatim prosiris onj kod koji ti je on dao sa jos jednim

|| (GetPlayerVehicleID(playerid) == IdNovogVozila)



Posjetite nas i osjetite razliku
www.balkan-city.info



193.192.59.151:7788


Game monitor nije u 100% tocan tj uvjek pokaziva manje

Mirnas_Tajic

Kako ne kontate ja kad ovo stavim || newcar == 57 || newcar == 58 || newcar == 59 || newcar == 1000 || newcar == 1314 || newcar == 1316 || newcar == 1317) Ne odu mi pare ali kad kod /rentcar definiram od kojeg do kojeg auta npr. uzet cu auto koji ima ID 22 Ja kod Rent car moram staviti ovako: Od npr. 3 > 23 tek ce mi onda uzeti pare ali onda sva vozila od 3 do 23 bit ce na rent a to nezelim zelim samo da su mi neka auta na rent

evo ovako napravi
pronadi 1 new i dodaj
new rentc[BROJVOZILA+1]; //kada sve izracunas tj npr ima 11 definiranih vozila tu stavi 12
zatim evo primjer kako dodajes ispred vozila oznaku rentc
rentc[0] = AddStaticVehicleEx(405,1077.67626953,-1754.99218750,13.39507866,90.00000000,125,1,15); //KRENI OBAVEZNO OD 0
i evo ti komanda rentcar
if(strcmp(cmd, "/rentcar", true) == 0)
{
        if(IsPlayerConnected(playerid))
{
    new carid = GetPlayerVehicleID(playerid);
if(carid == rentc[playerid])
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(carid == rentc[playerid])
{
if(SBizzInfo[0][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == 0)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbProducts]--;
}
if(carid == rentc[playerid])
{
if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}
if (GetPlayerMoney(playerid) <  SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much cash !");
return 1;
}
GivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~We hope you enjoy ~n~the use of this car~n~To lock or unlock your car~n~type ~g~/lock~n~~w~please drive safely",hirefee);
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
}
return 1;
}


poznaticovik

Ivice zar nije to za GF i njegove edite samo?

Citat: [M]att poslato April 13, 2011, 15:11:17 POSLE PODNE
Ivice zar nije to za GF i njegove edite samo?
je ali i Balkan-Evolution je edit gf-a :) mozda korisiti gtarp ili larp ali i to je od gfa :)
i sama komande je iz default gf-a samo sam zamijenio ovih par stvarcica
Poslednja Izmena: April 13, 2011, 15:19:28 POSLE PODNE od [modern]Ivica


poznaticovik

Citat: [modern]Ivica poslato April 13, 2011, 15:18:35 POSLE PODNE
Citat: [M]att poslato April 13, 2011, 15:11:17 POSLE PODNE
Ivice zar nije to za GF i njegove edite samo?
je ali i Balkan-Evolution je edit gf-a :) mozda korisiti gtarp ili larp ali i to je od gfa :)

Onda uredu , nisam čuo za taj GM pa neznam koji mu je "izvor"

Mirnas_Tajic

Citat: [CH]Tiger poslato April 13, 2011, 15:08:43 POSLE PODNE

rentc[0] = AddStaticVehicleEx(405,1077.67626953,-1754.99218750,13.39507866,90.00000000,125,1,15); //KRENI OBAVEZNO OD 0
Ovo ne kontam dje da to stavim i sta je to ?