Armanish
Компетентный
Почему то личный транспорт любого игрок может открывать даже если тс не твой, то есть лежит на дороге транспорт личный другого, я могу ее открыть а ведь стоят проверки что может открывать только владелец.
Pastebin -
Pastebin -
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
PHP:
CMD:lock ( playerid )
{
if ( IsValidVehicle ( GetPlayerVehicleID ( playerid ) ) )
{
new veh_id = GetPlayerVehicleID ( playerid ) ;
if ( ( veh_info [ veh_id - 1 ] [ v_type ] != vehicle_type_player || veh_info [ veh_id - 1 ] [ v_owner ] != p_info [ playerid ] [ id ] ) && p_t_info [ playerid ] [ v_key ] != veh_id )return SendClientMessage ( playerid, col_gray,"{"#cRD"}* {"#cGR"}У вас нет ключей от данного транспорта." ) ;
PlayerPlaySound ( playerid, 1145, 0.0, 0.0, 0.0 ) ;
if ( veh_info [ veh_id - 1 ] [ v_locked ] )
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = false ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, false, bonnet, boot, objective ) ;
me_action ( playerid, "открыл(а) транспорт" ) ;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = true ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, true, bonnet, boot, objective ) ;
me_action ( playerid, "закрыл(а) транспорт" ) ;
}
}
else
{
new Float:pl_pos_x,
Float:pl_pos_y,
Float:pl_pos_z ;
GetPlayerPos ( playerid, pl_pos_x, pl_pos_y, pl_pos_z ) ;
if ( p_t_info [ playerid ] [ v_key ] != 0 && IsVehicleInRangeOfPoint ( p_t_info [ playerid ] [ v_key ], 5.0, pl_pos_x, pl_pos_y, pl_pos_z ) )
{
new veh = p_t_info [ playerid ] [ v_key ] ;
PlayerPlaySound ( playerid, 1145, 0.0, 0.0, 0.0 ) ;
if ( veh_info [ veh - 1 ] [ v_locked ] )
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh - 1 ] [ v_locked ] = false ;
GetVehicleParamsEx ( veh, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh, engine, lights, alarm, false, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~ BOAT UNLOCK", 3000, 3 ) ;
me_action ( playerid, "открыл(а) транспорт" ) ;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh - 1 ] [ v_locked ] = true ;
GetVehicleParamsEx ( veh, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh, engine, lights, alarm, true, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~ BOAT LOCK", 3000, 3 ) ;
me_action ( playerid, "закрыл(а) транспорт" ) ;
}
return 1 ;
}
foreach ( new veh_id:player_vehicles[playerid])
{
if ( v_boat ( veh_id ) )
{
if ( IsVehicleInRangeOfPoint ( veh_id, 5.0, pl_pos_x, pl_pos_y, pl_pos_z ) ){}
else continue ;
PlayerPlaySound ( playerid, 1145, 0.0, 0.0, 0.0 ) ;
if ( veh_info [ veh_id - 1 ] [ v_locked ] )
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = false ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, false, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~ BOAT UNLOCK", 3000, 3 ) ;
me_action ( playerid, "открыл(а) транспорт" ) ;
break ;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = true ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, true, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~ BOAT LOCK", 3000, 3 ) ;
me_action ( playerid, "закрыл(а) транспорт" ) ;
break ;
}
}
else
{
if ( IsVehicleInRangeOfPoint ( veh_id, 2.5, pl_pos_x, pl_pos_y, pl_pos_z ) ){}
else continue ;
PlayerPlaySound ( playerid, 1145, 0.0, 0.0, 0.0 ) ;
if ( veh_info [ veh_id - 1 ] [ v_locked ] )
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = false ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, false, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~ CAR UNLOCK", 3000, 3 ) ;
me_action ( playerid, "открыл(а) транспорт" ) ;
break ;
}
else
{
new engine, lights, alarm, doors, bonnet, boot, objective ;
veh_info [ veh_id - 1 ] [ v_locked ] = true ;
GetVehicleParamsEx ( veh_id, engine, lights, alarm, doors, bonnet, boot, objective ) ;
SetVehicleParamsEx ( veh_id, engine, lights, alarm, true, bonnet, boot, objective ) ;
GameTextForPlayer ( playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~ CAR LOCK", 3000, 3 ) ;
me_action ( playerid, "закрыл(а) транспорт" ) ;
break ;
}
}
}
}
return 1 ;
}
