Help Rent - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Rent (
/showthread.php?tid=323619)
Help Rent -
Dark Crow - 06.03.2012
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
Код:
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;
}
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?
Re: Help Rent -
Dark Crow - 06.03.2012
i have just found out that the
Код:
if(GetPlayerVehicleID(playerid) >= 161 && GetPlayerVehicleID(playerid) <= 185)
to the RENT CARS AND BIKES are Mixed up theres a Cop car for rent and many others how can i fix that so it checks if its a RentCar without the ID??
Re: Help Rent -
Dark Crow - 07.03.2012
anyone??