SA-MP Forums Archive
How to make a car rentable - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make a car rentable (/showthread.php?tid=196122)



How to make a car rentable - Mehtab - 04.12.2010

in raven's roleplay how to make a car rentable. i posted in raven's roleplay topic but no one replied


Re: How to make a car rentable - Mean - 04.12.2010

What do you mean, in raven's RP cars ARE already rentable


Re: How to make a car rentable - Steven82 - 04.12.2010

Are you wanting to make another/more rental cars?


Re: How to make a car rentable - Hal - 04.12.2010

Quote:
Originally Posted by Mehtab
Посмотреть сообщение
in raven's roleplay how to make a car rentable. i posted in raven's roleplay topic but no one replied
Quote:
Originally Posted by Mehtab
Посмотреть сообщение
sorry for double posting. please help me fast
Wait 12 hours before bumping a topic NOT 12 MINUTES.

And maybe you should read the raven's rp topic. there is A LOT of info there.


Re: How to make a car rentable - BJaxx - 04.12.2010

<_<
Quote:

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.



The message you have entered is too short. Please lengthen your message to at least 8 characters.


Re: How to make a car rentable - Mehtab - 05.12.2010

how do i make more rentable cars and bikes in raven's roleplay


Re: How to make a car rentable - Jakku - 05.12.2010

pawn Код:
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;
}
Then just make two cmds; /exit to RemovePlayerFromVehicle(playerid); and /rentveh to TogglePlayerControllable(playerid, 1); if the player is in RentCar



EDIT:

Here

pawn Код:
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;
        }
Sorry for bad indentation, I wrote them quickly


Re: How to make a car rentable - Mehtab - 05.12.2010

thanks buddy