Quote:
Originally Posted by [BOPE]Seu._.Madruga
cade o cуdigo que vocк verifica se estб em um veнculo para verificar os pneus ?
|
eu fiz 2 pois eu acho que e a unica forma!
Apenas para motos:
PHP код:
if(PRESSED(KEY_SUBMISSION))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Vocк nгo estб dirigindo um veнculo.", "[ERROR]: You're not driving a vehicle."));
if(IsBike(vehicleid))
{
if(vInfo[vehicleid][vCombustivel] == 0)
return SendClientMessage(playerid, 0xDE6847FF, Translate(Player[playerid][pIdioma], "[ERRO]: Sem Combustнvel." ,"[ERROR]: Empty fuel."));
if(vInfo[vehicleid][vTemMotor] == false)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Este veнculo nгo tem motor.", "[ERROR]: This vehicle not have engine."));
if(vInfo[vehicleid][vPneu] <= 1)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Sem Pneus Suficiente.", "[ERROR]: Not enough tires on the vehicle."));
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(vInfo[vehicleid][vMotor] == false)
{
vInfo[vehicleid][vMotor] = true;
GameTextForPlayer(playerid, "~w~Engine: ~g~ ON!", 1000, 3);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
else if(vInfo[vehicleid][vMotor] == true)
{
vInfo[vehicleid][vMotor] = false;
GameTextForPlayer(playerid, "~w~Engine: ~r~ OFF!", 1000, 3);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
}
}
}
Para os restos dos veiculos com excessao das bicicletas!
PHP код:
if(PRESSED(KEY_SUBMISSION))
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Vocк nгo estб dirigindo um veнculo.", "[ERROR]: You're not driving a vehicle."));
if(!IsABike(vehicleid) || !IsBike(vehicleid))
{
if(vInfo[vehicleid][vCombustivel] == 0)
return SendClientMessage(playerid, 0xDE6847FF, Translate(Player[playerid][pIdioma], "[ERRO]: Sem Combustнvel." ,"[ERROR]: Empty fuel."));
if(vInfo[vehicleid][vTemMotor] == false)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Este veнculo nгo tem motor.", "[ERROR]: This vehicle not have engine."));
if(vInfo[vehicleid][vPneu] <= 3)
return SendClientMessage(playerid, COR_VERMELHO, Translate(Player[playerid][pIdioma], "[ERRO]: Sem Pneus Suficiente.", "[ERROR]: Not enough tires on the vehicle."));
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(vInfo[vehicleid][vMotor] == false)
{
vInfo[vehicleid][vMotor] = true;
GameTextForPlayer(playerid, "~w~Engine: ~g~ ON!", 1000, 3);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
else if(vInfo[vehicleid][vMotor] == true)
{
vInfo[vehicleid][vMotor] = false;
GameTextForPlayer(playerid, "~w~Engine: ~r~ OFF!", 1000, 3);
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
}
}