22.07.2016, 16:42
Boa tarde
Tenho um FS de ligar veнculo, porйm se o player entrar no carro e acelerar, ele anda numa boa. Quero bloquear para quando o player entrar e acelerar o carro nгo andar. Somente se ele apertar CTRL, aн sim liga o veнculo e ele consegue sair com o carro. Alguйm pode ajudar?
Tenho um FS de ligar veнculo, porйm se o player entrar no carro e acelerar, ele anda numa boa. Quero bloquear para quando o player entrar e acelerar o carro nгo andar. Somente se ele apertar CTRL, aн sim liga o veнculo e ele consegue sair com o carro. Alguйm pode ajudar?
PHP код:
public OnGameModeInit()
{
ManualVehicleEngineAndLights();
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsPlayerInAnyVehicle(playerid) && newkeys == 1)
{
if(motor[playerid] == 0)
{
new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
SetVehicleParamsEx(car, VEHICLE_PARAMS_ON, ll, ia, n, dlc, dmais, he);
motor[playerid] = 1;
SendClientMessage(playerid, -1, "Motor Ligado com Sucesso.");
return 1;
}
else if(motor[playerid] == 1)
{
new car = GetPlayerVehicleID(playerid), wi, ll, ia, n, dlc, dmais, he;
GetVehicleParamsEx(car, wi, ll, ia, n, dlc, dmais, he);
SetVehicleParamsEx(car, VEHICLE_PARAMS_OFF, ll, ia, n, dlc, dmais, he);
motor[playerid] = 0;
SendClientMessage(playerid,-1, "Motor Desligado com Sucesso.");
return 1;
}
return 1;
}