CMD:portamalas(playerid, params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(portamalas[playerid] == 0)
{
new string[256];
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
portamalas[playerid] = 1;
format(string, sizeof(string), "* %s leva sua mгo atй o porta-malas do veнculo, logo abrindo-o.", GetName(playerid));
ProxDetector(20.0, playerid, string,COLOR_PURPLE);
}
else if(portamalas[playerid] == 1)
{
new string[256];
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
portamalas[playerid] = 0;
format(string, sizeof(string), "* %s leva sua mгo atй o porta-malas do veнculo, logo fechando-o.", GetName(playerid));
ProxDetector(20.0, playerid, string,COLOR_PURPLE);
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "[Erro]: Vocк nгo estб prуximo a um veнculo.");
}
return 1;
}
CMD:capo(playerid, params[])
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(capo[playerid] == 0)
{
new string[256];
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
capo[playerid] = 1;
format(string, sizeof(string), "* %s leva sua mгo atй o capo do veнculo, logo abrindo-o.", GetName(playerid));
ProxDetector(20.0, playerid, string,COLOR_PURPLE);
}
else if(capo[playerid] == 1)
{
new string[256];
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
capo[playerid] = 0;
format(string, sizeof(string), "* %s leva sua mгo atй o capo do veнculo, logo fechando-o.", GetName(playerid));
ProxDetector(20.0, playerid, string,COLOR_PURPLE);
}
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "[Erro]: Vocк nгo estб prуximo a um veнculo.");
}
return 1;
}
tente usar essa funзгo
GetVehiclePos(GetPlayerVehicleID(playerid), x,y,z); //para pegar a posiзгo do veiculo if(IsPlayerInRangeOfPoint(playerid, 4.0, x,y,z)) voce tambem pode esta adicionando valores em x,y,z para setar a posiзгo que voce deseja |