09.06.2013, 13:33
If I go in car and do /exit + /engine I start rentcar and for free I don't rent it I just start it..how can I make it not start?but I want /exit to work..
PHP код:
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;
}