Evo ja sam ti složio nešto nabrzaka, ove poruke i to tvoje sam ostavio. Uzmi dole kod i samo nadogradi šta ti je još potrebno, usput nisam testiro niti compile-o već sam na site-u pisao - tako da ako ima neka greška tagaj me pa ćemo riješiti. Izvoli i pastebin ->
https://pastebin.com/nHWm5zEV.
// rent system - b samp help
new
bool: _RentVeh = false
_RentVehID = INVALID_VEHICLE_ID;
//
CMD:rent(playerid, params[]) {
new vehicleid = GetPlayerVehicleID(playerid);
if(_RentVeh == true)
return SCM(playerid, -1, "Vec si iznajmio vozilo, prvo vrati iznjamljeno(/unrent) pa mozes opet rentat"), RemovePlayerFromVehicle(playerid);
foreach(new i: Player) {
if(_RentVehID == vehicleid) {
SCM(playerid, CRVENA, "Neko je vec rentovao ovo vozilo !");
RemovePlayerFromVehicle(playerid);
}
}
if(vehicleid >= RentVozilo && vehicleid <= RentVozilo) {
ShowPlayerDialog(playerid, DIALOG_RENT, DIALOG_STYLE_LIST, "Odaberite vreme","Test (100$)\n....", ""zelena"U redu", ""crvena"Odustani");
}
else return SCM(playerid, CRVENA, "Nisi u RENT VOZILU !");
return (true);
}
//
public OnPlayerDisconnect(playerid, reason) {
if(_RentVeh == true)
DestroyRentVehicle(playerid, _RentVehID);
return (true);
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
case DIALOG_RENT: {
if(response) {
if(listitem == 0) {
if(GetPlayerMoney(playerid) < 100) return SCM(playerid,-1,"Nema te dovoljno novca");
GivePlayerMoney(playerid, -200);
_RentVehID = CreateVehicle(.....);
_RentVeh = (true);
SCM(playerid,-1, "Rentao si vozilo na 10 sec test, ako ga zelis vratit kucaj /unrent");
SetTimerEx("IstekRenta", 10*1000, (false), "dd", playerid, _RentVehID);
}
// dalje ti dodaj jos koliko oces item-a listanih.
}
}
return (true);
}
//
DestroyRentVehicle(playerid, vehicleid) {
// Resetira varijable i brise vozilo.
_RentVeh = (false);
_RentVehID = INVALID_VEHICLE_ID;
DestroyVehicle(vehicleid);
return (true);
}
//
forward IstekRenta(playerid, vehicleid);
public IstekRenta(playerid, vehicleid); {
// Reset - Isteklo vrijeme renta.
DestroyRentVehicle(playerid, vehicleid);
SendClientMessage(playerid, -1, "Isteklo je vase vrijeme renta.");
return (true);
}