o passegueiro liga o carro como faz so pra o condutor ligar? -
SnowBorn - 27.12.2017
PHP код:
if((newkeys == KEY_YES) && (IsPlayerInAnyVehicle(playerid)))
{
//Ligar/desligar vйiculo
new carroa = GetPlayerVehicleID(playerid);
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx( carroa, mot, lu, alar, por, cap, porma, ob );
if(mot == VEHICLE_PARAMS_OFF)
{
SendClientMessage(playerid, Azul, "Veiculo Ligado");
SetVehicleParamsEx( carroa, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob );
}else{
SendClientMessage(playerid, Vermelho, "Veiculo Desligado");
SetVehicleParamsEx(carroa, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
}
}
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
Sky™ - 27.12.2017
Use o estado DRIVER.
https://sampwiki.blast.hk/wiki/GetPlayerState
Seu cуdigo ficaria semelhante a isso:
PHP код:
if((newkeys == KEY_YES)&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)) {
static
carroa = GetPlayerVehicleID(playerid),
mot, lu, alar, por, cap, porma, ob
;
GetVehicleParamsEx( carroa, mot, lu, alar, por, cap, porma, ob );
return mot == VEHICLE_PARAMS_OFF ? (SendClientMessage(playerid, Azul, "Veiculo Ligado"),
SetVehicleParamsEx( carroa, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob )):(SendClientMessage(playerid, Vermelho, "Veiculo Desligado"),
SetVehicleParamsEx(carroa, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob));
}
Na verdade й isso, digo semelhante, pelo fato de eu nгo ter compilado.
Abз!
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
SnowBorn - 27.12.2017
Obrigado SKY, vou testar aqui
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
Sky™ - 27.12.2017
Notei alguns erros no cуdigo, jб efetuei a correзгo, vк se compila ai ..
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
SnowBorn - 27.12.2017
Pois kk C:\Users\Hйlder\Desktop\N.R.V\Gamemode oficial NRV\gamemodes\GMNRV.pwn(41132) : error 029: invalid expression, assumed zero
C:\Users\Hйlder\Desktop\N.R.V\Gamemode oficial NRV\gamemodes\GMNRV.pwn(41135) : error 008: must be a constant expression; assumed zero deu aq tb ksks
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
SnowBorn - 27.12.2017
Compilou nгo amigo..
Deu um erro.. '-'
Nessa parte aq
carroa = GetPlayerVehicleID(playerid),
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
Sky™ - 27.12.2017
PHP код:
if((newkeys == KEY_YES)&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)) {
static
carroa,
mot, lu, alar, por, cap, porma, ob
;
carroa = GetPlayerVehicleID(playerid);
GetVehicleParamsEx( carroa, mot, lu, alar, por, cap, porma, ob );
return mot == VEHICLE_PARAMS_OFF ? (SendClientMessage(playerid, Azul, "Veiculo Ligado"),
SetVehicleParamsEx( carroa, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob )):(SendClientMessage(playerid, Vermelho, "Veiculo Desligado"),
SetVehicleParamsEx(carroa, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob));
}
caso nгo der, tente assim.
PHP код:
if((newkeys == KEY_YES)&&(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)) {
static vComp[7],
vehicle
;
vehicle = GetPlayerVehicleID(playerid);
GetVehicleParamsEx( vehicle, vComp[0], vComp[1], vComp[2], vComp[3], vComp[4], vComp[5], vComp[6] );
if( mot == VEHICLE_PARAMS_OFF)
SendClientMessage(playerid, Azul, "Veiculo Ligado"),
SetVehicleParamsEx( carroa, VEHICLE_PARAMS_ON, vComp[1], vComp[2], vComp[3], vComp[4], vComp[5], vComp[6]);
else
SendClientMessage(playerid, Vermelho, "Veiculo Desligado"),
SetVehicleParamsEx(carroa, VEHICLE_PARAMS_OFF, vComp[1], vComp[2], vComp[3], vComp[4], vComp[5], vComp[6]);
}
Olha se vai agora, rsrs, perdгo estou muito tempo sem programar..
Re: o passegueiro liga o carro como faz so pra o condutor ligar? -
SnowBorn - 27.12.2017
Obrigado.. agora compilou sem erros..
Da pra me chmar no privado depois se puder obrigado e nos