06.03.2012, 12:21
i have two /rentcar and /rentmoto commands the bikes and cars are all placed when i enter the car i get the message if i want to rent it i should write /rentcar or /rentmoto but when i write it it says your not in a rent car
How can i make the cars that i have put for rent to rent them when i type /rentcar they are in arrays
but how can i combine it?
Код:
if(IsARentCar(newcar))
{
if (HireCar[playerid] != newcar)
{
format(string,sizeof(string),"{00C0FF}This Car is for Rent.\nDa iznajmis pisi: /rentcar.\nDa napustis vozilo /exit.\n{00C0FF}Cena: 250$.");
ShowPlayerDialog(playerid, 44, DIALOG_STYLE_MSGBOX,"{F81414}Auto Rent",string,"Ok","");
TogglePlayerControllable(playerid, 0);
}
}
Код:
if(strcmp(cmd, "/rentcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(GetPlayerVehicleID(playerid) >= 161 && GetPlayerVehicleID(playerid) <= 185)
{
new hirefee = HireCost(GetPlayerVehicleID(playerid));
if(SBizzInfo[15][sbProducts] == 0)
{
GameTextForPlayer(playerid, "~r~No more cars", 5000, 1);
return 1;
}
if (GetPlayerMoney(playerid) < 250)
{
SendClientMessage(playerid, COLOR_GRAD2, "No money !");
return 1;
}
if(HireCar[playerid] != 299)
{
gCarLock[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SendClientMessage(playerid, COLOR_GREY, "you need to return the rented car!");
return 1;
}
foreach (Player, i)
{
if(HireCar[i] == GetPlayerVehicleID(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "somebody already rented !");
return 1;
}
}
/*if(PlayerInfo[playerid][pPbiskey] == 1)
{
GameTextForPlayer(playerid, "~w~No charge for the boss", 5000, 3);
TogglePlayerControllable(playerid, 1);
return 1;
}*/
GivePlayerCash(playerid,-250);
SBizzInfo[15][sbTill] += 250;
ExtortionSBiz(15, SBizzInfo[15][sbEntranceCost]);
SBizzInfo[15][sbProducts]--;
HireCar[playerid] = GetPlayerVehicleID(playerid);
OnPropUpdate();
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "you rented this car.",hirefee);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, COLOR_YELLOW2, "you can now start the engine !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, string, 5000, 3);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW2, "This car is not for rent !");
}
}
return 1;
}
Код:
RentCar[0]

