04.12.2010, 19:13
in raven's roleplay how to make a car rentable. i posted in raven's roleplay topic but no one replied
in raven's roleplay how to make a car rentable. i posted in raven's roleplay topic but no one replied
|
b) Do not bump Some people apparently think they are important enough to bump their own topic after 10 minutes. You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem. |
new RentCar[10]; //10 rentable cars
public OnGameModeInit()
{
RentCar[0] = CreateVehicle(.......);
RentCar[1] = CreateVehicle(.......);
RentCar[2] = CreateVehicle(.......);
RentCar[3] = CreateVehicle(.......);
RentCar[4] = CreateVehicle(.......);
RentCar[5] = CreateVehicle(.......);
RentCar[6] = CreateVehicle(.......);
RentCar[7] = CreateVehicle(.......);
RentCar[8] = CreateVehicle(.......);
RentCar[9] = CreateVehicle(.......);
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
new vehicleid = GetPlayerVehicleID(playerid);
for(new i=0; i<sizeof(RentCar); i++)
{
if (vehicleid == RentCar[i]) {
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_COLOR,"Would you like to rent this vehicle? Type /rentveh or /exit");
}
}
return 1;
}
if(strcmp(cmd,"/exit",true)==0)
{
for(new i=0; i<sizeof(RentCar); i++)
{
if (GetPlayerVehicleID(playerid) == RentCar[i]) {
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
if(strcmp(cmd,"/rentveh",true)==0)
{
for(new i=0; i<sizeof(RentCar); i++)
{
if (GetPlayerVehicleID(playerid) == RentCar[i]) {
TogglePlayerControllable(playerid, 1);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, COLOR_COLOR,"You have rent this vehicle");
}
}
return 1;
}