Rent Problem
#2

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(vehicle == X || vehicle == X ...) // the rented vehicle ID's
    {
        if(CheckIfThePlayerIsRentingACar == 1)
        {
            SetTimerEx("RentRespawn", 20000, false, "i", playerid); // set the timer for the function
            SendClientMessage(playerid, 0xFFFFFFFF, "20 seconds to get back in the vehicle or you'll lose its rent.");
        }
    }
    return 1;
}

forward RentRespawn(playerid);
public RentRespawn(playerid)
{
    if(!IsPlayerInAnyVehicle(playerid)) // if he's not in a vehicle
    {
        SetVehicleToRespawn(SetRentedVehicleToRespawn);
        VariableForPlayerRentingVehicle = 0;
    }
    else
    {
        new v = GetPlayerVehicleID(playerid);
        if(v == CheckIfTheVehicleIsTheOneThatThePlayerRents) return 1; // stop the function here
        SetVehicleToRespawn(SetRentedVehicleToRespawn); // if it's not his vehicle, respawn it
        VariableForPlayerRentingVehicle = 0; // and set the variable for the player renting a vehicle to 0
    }
    return 1;
}
Reply


Messages In This Thread
Rent Problem - by Akcent_Voltaj - 21.10.2013, 14:32
Re: Rent Problem - by DanishHaq - 21.10.2013, 14:47
Re: Rent Problem - by Akcent_Voltaj - 21.10.2013, 18:23
Re: Rent Problem - by Akcent_Voltaj - 22.10.2013, 11:45
Re: Rent Problem - by Akcent_Voltaj - 22.10.2013, 16:47

Forum Jump:


Users browsing this thread: 2 Guest(s)