Vehicle keys.
#2

hope this will give you some ideas
pawn Код:
new VehKeys[MAX_PLAYERS]; // we will have a player variable vehkeys which is based on the vehicle id

CMD:buyveh(playerid,params[])
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(playerid,X,Y,Z);
    VehKeys[playerid]=CreateVehicle(520, X, Y, Z, 82.2873, 0, 1, 60);// storing the vehicle id to the player variable
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(VehKeys[playerid]!=vehicleid)// this checks if the player have the keys to the vehicle hes about to enter
    {
        ClearAnimations(playerid);// this stops the player from entering the vehicle if he dont have the keys for the vehicle
        SendClientMessage(playerid,-1,"you cant enter this car because you dont have the key to this vehicle");
    }
    else
    {
        SendClientMessage(playerid,-1,"You are the owner of this vehicle");
    }
    return 1;
}
Reply


Messages In This Thread
Vehicle keys. - by mkmk - 30.10.2014, 11:44
Re: Vehicle keys. - by Quickie - 30.10.2014, 12:01
Re: Vehicle keys. - by mkmk - 30.10.2014, 12:14
Re: Vehicle keys. - by mkmk - 30.10.2014, 14:23
Re: Vehicle keys. - by mkmk - 30.10.2014, 18:49
Re: Vehicle keys. - by Quickie - 31.10.2014, 00:33
Re: Vehicle keys. - by Abagail - 31.10.2014, 00:37
Re: Vehicle keys. - by mkmk - 31.10.2014, 01:49
Re: Vehicle keys. - by mkmk - 31.10.2014, 11:34

Forum Jump:


Users browsing this thread: 1 Guest(s)