[POMOC] Rent

Započeo 032.Marcus
15. Feb. 2014. Zaključano
348
pregleda
10
postova
032.Marcus
4
Made Man
15. Feb. 2014.
Scripta: moja od nule
Problem: Zanima me kako da napravim rentcar sistem tj kako da napravim da kola mogu da se rentaju, ne mogu da nadjem tut nigde
Deo scripte: ///
FiLiP.99
4
Shot Caller
15. Feb. 2014.
Prvo napravis vozila za rent:

Rent = AddStaticVehicle(IDAUTA, X, Y, Z, A,BOJA1, BOJA2); 
Rent = AddStaticVehicle(IDAUTA, X, Y, Z, A,BOJA1, BOJA2); 
Rent = AddStaticVehicle(IDAUTA, X, Y, Z, A,BOJA1, BOJA2); 
Rent = AddStaticVehicle(IDAUTA, X, Y, Z, A,BOJA1, BOJA2); 
Rent = AddStaticVehicle(IDAUTA, X, Y, Z, A,BOJA1, BOJA2);


Ne zaboravi da dodas "new Rent;" na pocetku skripte!! Tako isto dodas i "new Rentano;"!!

Sada napravis public za rentvozila ovako:

forward RentVozila(carid)
Public RentVozila(carid) 

  for(new i = 0; i < sizeof(Rent); i++) 
  { 
      if(carid == Rent)  return 1; 
  } 
  return 0; 
}



Napravis komandu kojom ce se rentati:

CMD:rentaj(playerid,params[]) 

  new string; 
  if (GetPlayerMoney(playerid) <  150)//Ako igrac nema 150 $, nece moci da renta. 
  { 
      SendClientMessage(playerid, COLOR_GRAD2, "Nemas dovoljno Novca!"); 
      return 1; 
  } 
  if(Rentano != 299)//Proverava da li vec imas rentano vozilo. 
  { 
      SendClientMessage(playerid, SIVA, "Moras prvo da vratis iznajmljeno vozilo."); 
      return 1; 
  } 
  for(new i=0; i  { 
    if(Rentano == GetPlayerVehicleID(playerid))//Ako je neko rentao vozilo, neces ga moci rentati 
    { 
      SendClientMessage(playerid, SIVA, "Neko je vec rentao ovo vozilo."); 
      return 1; 
    } 
  } 
      GivePlayerMoney(playerid,-150);//Oduzima igracu 150$ 
      Rentano = GetPlayerVehicleID(playerid);//Postavlja igracu rent vozilo(da drugi nmg rentati) 
      PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);// Pusta neke zvuke... 
      format(string, sizeof(string), "~r~/unrentcar~n~~g~/lock.");//Tekst koji ce biti u GameTextu 
      SendClientMessage(playerid, ZUTA, "Prijatan dan!");// ispisuje poruku igracu 
      TogglePlayerControllable(playerid, 1);//Odmrzava igraca - Omogucava mu da se krece 
      GameTextForPlayer(playerid, string, 5000, 3);// Prikazuje GameText 
      return 1; 
  }



Takodje i komandu kojom ce se unrentati:

CMD:unrentaj(playerid,params[]) 

    new idcar = GetPlayerVehicleID(playerid); 
  if(Rentano != 299) 
  { 
    if(idcar == Rentano) 
    { 
      TogglePlayerControllable(playerid, 1); 
    } 
        SetVehicleToRespawn(Rentano); 
      Rentano = 299; 
      SendClientMessage(playerid,CRVENA,"Vratio si iznajmljeno vozilo!"); 
  } 
  return 1; 
}


Onda napravis da ne mozes da vozis kola dok ih ne rentas:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2) 

  if(RentVozila(newcar)) 
  { 
    if (Rentano != newcar) 
  { 
        SendClientMessage(playerid,ZELENA,"========== RENT VOZILO =========="); 
        SendClientMessage(playerid,LJUBICASTA,"Da rentas: /rentcar ."); 
        SendClientMessage(playerid,LJUBICASTA,"Da izadjes: /exitcar ."); 
        TogglePlayerControllable(playerid, 0);// Freeza igraca, da ne moze da pobegne 
        PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0); 
  } 
  else 
  { 
  return 1; 
  } 
  } 
}
return 1;
}
032.Marcus
4
Made Man
15. Feb. 2014.
Je l' ovo tutorijal sa KGBa, meni nije radio, sad cu da probam opet.
EDIT: error 017: undefined symbol "newcar"
Prikazuje mi kod OnPlayerStateChange, je l' newcar treba da bude GetPlayerVehicleID ?
FiLiP.99
4
Shot Caller
15. Feb. 2014.
Ovo dodas :

new newcar = GetPlayerVehicleID(playerid);  ovo sam ubacio odmah ispod ovog if(newstate == PLAYER_STATE_DRIVER)
032.Marcus
4
Made Man
15. Feb. 2014.
Uradio sam to vec odmah cim sam editovao post. Sad radi, samo malo da sredim nesto jos i to je to...
Nego, da ne otvaram novu temu, kako bih mogao fuel sistem da napravim tj gorivo sistem ?
FiLiP.99
4
Shot Caller
15. Feb. 2014.
Evo tebi FILTERSKRIPTA moja (BRZINOMETAR SA FUEL SYSTEMOM) http://www.4shared.com/file/1c5p1FY6ba/brzinometar.html !!
032.Marcus
4
Made Man
15. Feb. 2014.
Da hocu FS mogao bih ceo server od njih da napravim, ali ja hocu lepo da ubacim u MOD .
EDIT: Poslao sam ti PM, ali neka i drugi vide ovo:
Koja je greska ovde?

if(!IsPlayerInVehicle(playerid, RentVehicle)) return SCM(playerid, -1, ""CRVENA"GoMilano"BELA": Niste u vozilo za iznajmljivanje.");

RentVehicle su mi vozila za rent...
FiLiP.99
4
Shot Caller
15. Feb. 2014.
Mnogo imas navodnika moguce da se pomesalo ness ! Stavi lepo SCM(playerid, COLOR, "TEXT BEZ 100 NAVODNIKA - iskljucivo samo tekst");
Andrijan
4
Shot Caller
16. Feb. 2014.
Resio sam sad cu da ti kazem sta je bila greska samo nemoj da se smejes :-D Ulazio sam sa aduty u rent i odmah sam mogo da vozim. xD
FiLiP.99
4
Shot Caller
16. Feb. 2014.
Hahahahahaahahaha 🙂

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha