if(strcmp(cmd, "/rentcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(rentcar); i++)
{
if(GetPlayerVehicleID(playerid) == rentcar[i]) continue;
}
new hirefee = HireCost(GetPlayerVehicleID(playerid));
/*if(SBizzInfo[1][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}*/
if(SBizzInfo[0][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
return 1;
}
if (GetPlayerCash(playerid) < SBizzInfo[1][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash !");
return 1;
}
if (GetPlayerCash(playerid) < SBizzInfo[0][sbEntranceCost])
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much cash !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Ai deja un vehicol inchiriat,dai /unrentveh,ca sa poti inchiria altceva!");
return 1;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Cineva are deja inchirieata masina asta !");
return 1;
}
}
GivePlayerCash(playerid,-SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
SBizzInfo[1][sbProducts]--;
//
GivePlayerCash(playerid,-SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
SBizzInfo[0][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~Don't forget to ~r~/unrentveh~n~~g~/lock ~w~to lock your car.",hirefee);
SendClientMessage(playerid, COLOR_RED, "Dai /engine ca sa pornesti motorul!");
SendClientMessage(playerid, COLOR_WHITE, "Dati /unrentveh ca sa poti inchiria,alt vehicol!");
SendClientMessage(playerid, COLOR_RED, "Dai /lock ca sa inchizi/deschizi masina inchiriata.");
GameTextForPlayer(playerid, string, 5000, 3);
}
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
HireCar[playerid] = GetPlayerVehicleID(playerid);
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "Ai deja un vehicol inchiriat,dai /unrentveh,ca sa poti inchiria altceva!");
return 1;
}
for(new i = 0; i < sizeof(rentcar); i++)
{
if(GetPlayerVehicleID(playerid) == rentcar[i] && HireCar[playerid] == rentcar[i]) continue;
}
stock IsARentCar(carid)
{
for(new i=0;i<sizeof(rentcar);i++)
{
if(carid == rentcar[i]) return 1;
}
return 0;
}
if(IsARentCar(GetPlayerVehicleID(playerid) && HireCar[playerid] == GetPlayerVehicleID(playerid))
{
......
}
else { return 1; }
not but there is the freeze thing when I enter rentcar and plaayers do /exit do unfreeze..and go..
|
/exit
{
TogglePlayerControllable(playerid, 1);
return 1;
}
/engine
{
TogglePlayerControllable(playerid, 1); //motorul este pornit!
}
else
{
TogglePlayerControllable(playerid, 0); //motorul este oprit!
}