22.07.2015, 20:16
yeah, it's locked for everybody except you, do you wanna lock if for everybody ?
if so, just remove "if(i != playerid)"
or try this
if so, just remove "if(i != playerid)"
or try this
pawn Код:
new CurrentVehicle[MAX_PLAYERS] = { -1, ... };
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) CurrentVehicle[playerid] = GetPlayerVehicleID(playerid);
return 1;
}
CMD:lock(playerid, params[])
{
new vehicleid = CurrentVehicle[playerid];
if(vehicleid != -1)
{
new doors, engine, lights, alarm, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
}
return 1;
}