AVS Problem
#2

pawn Код:
CMD:vlock(playerid, params[])
{
    new vehicleid;
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        vehicleid = GetPlayerVehicleID(playerid);
    }
    else
    {
        vehicleid = GetClosestVehicle(playerid);
        if(!PlayerToVehicle(playerid, vehicleid, 5.0)) vehicleid = 0;
    }
    if(!vehicleid) return SendClientMessage(playerid, COLOR_RED, "You are not close to a vehicle!");
    new id = GetVehicleID(vehicleid);
    if(!IsValidVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
    if(GetPlayerVehicleAccess(playerid, id) < 2)
        return SendClientMessage(playerid, COLOR_RED, "You don't have the keys for this vehicle!");
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    if(doors == 1)
    {
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
        VehicleLock[id] = 0;
        GameTextForPlayer(playerid, "~g~doors unlocked", 3000, 6 );
    }
    else
    {
        SetVehicleParamsEx(vehicleid, engine, lights, alarm, 1, bonnet, boot, objective);
        VehicleLock[id] = 1;
        GameTextForPlayer(playerid, "~r~doors locked", 3000, 6 );
    }
    SaveVehicle(id);
    return 1;
}
NOTE: Untested
Reply


Messages In This Thread
AVS Problem - by yLuSsSIoN - 12.09.2012, 12:13
Re: AVS Problem - by clarencecuzz - 12.09.2012, 12:22
Re: AVS Problem - by yLuSsSIoN - 12.09.2012, 12:57
Re: AVS Problem - by mamorunl - 12.09.2012, 15:01
Re: AVS Problem - by yLuSsSIoN - 12.09.2012, 15:05
Re: AVS Problem - by mamorunl - 12.09.2012, 15:26
Re: AVS Problem - by yLuSsSIoN - 12.09.2012, 15:26
Re: AVS Problem - by jameskmonger - 12.09.2012, 17:53
Re: AVS Problem - by yLuSsSIoN - 12.09.2012, 18:04
Re: AVS Problem - by jameskmonger - 12.09.2012, 18:46

Forum Jump:


Users browsing this thread: 3 Guest(s)