Cars don't lock when you do /lock
#6

you should add this at the top of your script !!!!
pawn Код:
new vehicleid [ MAX_PLAYERS ];
pawn Код:
new vehicleid [ MAX_PLAYERS ];

command:(lock, playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You must be in a vehicle to use this command!");

    new
        VehicleID = GetPlayerVehicleID(playerid);
       
    if(OwnedCar(VehicleID) != 0)
    {
        if(strmatch(Vehicles[OwnedCar(VehicleID)][VehicleOwner], pName(playerid)))
        {
            Vehicles[OwnedCar(VehicleID)][vLocked] = 1;
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicleid, engine, lights, alarm, 0, bonnet, boot, objective);
            SendClientMessage(playerid, -1, "You've successfully locked your vehicle!");
            SaveOwnedCar(OwnedCar(VehicleID));
            return 1;
        }
        else return SendClientMessage(playerid, RED, "This vehicle does not belong to you!");
    }
    else return SendClientMessage(playerid, RED, "This is not a private vehicle!");
}
TRy now with this !!!
Reply


Messages In This Thread
Cars don't lock when you do /lock - by Luke_James - 20.09.2012, 19:56
Re: Cars don't lock when you do /lock - by mamorunl - 20.09.2012, 20:12
Re: Cars don't lock when you do /lock - by Luke_James - 20.09.2012, 20:15
Re: Cars don't lock when you do /lock - by Riddy - 20.09.2012, 20:35
Re: Cars don't lock when you do /lock - by Luke_James - 21.09.2012, 10:54
Re: Cars don't lock when you do /lock - by M3mPHi$_S3 - 21.09.2012, 11:12
Re: Cars don't lock when you do /lock - by mamorunl - 21.09.2012, 12:42
Re: Cars don't lock when you do /lock - by TaLhA XIV - 21.09.2012, 12:57
Re: Cars don't lock when you do /lock - by clarencecuzz - 21.09.2012, 13:30
Re: Cars don't lock when you do /lock - by Luke_James - 21.09.2012, 15:21

Forum Jump:


Users browsing this thread: 1 Guest(s)