Problem with rent cars.
#8

Quote:
Originally Posted by bijoyekuza
View Post
UPPP
Some one please ?
because of

pawn Code:
if( newstate == PLAYER_STATE_DRIVER )
and

pawn Code:
GetPlayerVehicleSeat(playerid) == 1)
He should be driver and on a passenger seat => Cant work

So, I rly hate it if guys use array for something like that
pawn Code:
new
    rentcar_Last,
    rentcar_First,
    bool: rentkey[MAX_PLAYERS];
pawn Code:
//OnGameModeInit
rentcar_First = AddStaticVehicleEx(510,1560.93286133,-2309.08129883,13.24319458,91.99993896,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1560.88171387,-2311.87597656,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.00732422,-2315.56152344,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.11535645,-2318.67944336,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.23120117,-2321.97534180,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.34765625,-2325.31958008,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.46789551,-2328.74047852,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.57324219,-2331.73730469,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(510,1561.69628906,-2335.23388672,13.24319458,91.99951172,-1,-1,5); //Mountain Bike
AddStaticVehicleEx(468,-1330.38940430,-284.64837646,13.90843773,0.00000000,-1,-1,15); //Sanchez
AddStaticVehicleEx(468,-1331.91455078,-285.06213379,13.90843773,0.00000000,-1,-1,5); //Sanchez
AddStaticVehicleEx(462,1305.86437988,1278.80163574,10.49053192,0.00000000,-1,-1,5); //Faggio
AddStaticVehicleEx(462,1308.87707520,1278.86083984,10.49053192,0.00000000,-1,-1,5); //Faggio
AddStaticVehicleEx(462,1311.88745117,1278.89587402,10.49053192,0.00000000,-1,-1,5); //Faggio
AddStaticVehicleEx(462,1314.59558105,1278.92578125,10.49053192,0.00000000,-1,-1,5); //Faggio
AddStaticVehicleEx(462,1317.93640137,1278.68676758,10.49053192,0.00000000,-1,-1,5); //Faggio
AddStaticVehicleEx(481,1282.74865723,1290.92309570,10.42908859,272.00000000,-1,-1,5); //BMX
AddStaticVehicleEx(481,1282.62097168,1293.31713867,10.42908859,271.99951172,-1,-1,5); //BMX
AddStaticVehicleEx(481,1282.70117188,1296.41113281,10.42908859,271.99951172,-1,-1,5); //BMX
rentcar_Last = AddStaticVehicleEx(481,1282.96948242,1299.54357910,10.42908859,271.99951172,-1,-1,5); //BMX
pawn Code:
//IsARentableCar(vehicleid) - Should be somewhere above
#define IsARentableCar(%0) (rentcar_First <= (%0) <= rentcar_Last)
pawn Code:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        newstate = GetPlayerVehicleID(playerid);
        if(IsARentableCar(newstate))
        {
            if(rentkey[playerid] == false)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid,COLOR_RED,"You do not have a rent card.Go buy one.");
            } else {
                SendClientMessage(playerid,COLOR_RED,"Watch out,When you exit the vehicle you wont be able to ride it again.");
            }
        }  
    }
    return true;
}
Reply


Messages In This Thread
Problem with rent cars. - by bijoyekuza - 28.02.2011, 19:42
Re: Problem with rent cars. - by Mean - 28.02.2011, 19:56
Re: Problem with rent cars. - by bijoyekuza - 01.03.2011, 04:30
Re: Problem with rent cars. - by Steven82 - 01.03.2011, 04:33
Re: Problem with rent cars. - by bijoyekuza - 01.03.2011, 09:23
Re: Problem with rent cars. - by bijoyekuza - 01.03.2011, 09:34
Re: Problem with rent cars. - by bijoyekuza - 02.03.2011, 09:54
AW: Re: Problem with rent cars. - by Nero_3D - 02.03.2011, 10:09
Re: AW: Re: Problem with rent cars. - by bijoyekuza - 02.03.2011, 14:13
Re: Problem with rent cars. - by bijoyekuza - 03.03.2011, 12:29

Forum Jump:


Users browsing this thread: 2 Guest(s)