/v estacionar bug larp -
GuikBretas - 22.02.2011
Koй pessoal alguйm ajuda eu a resolver o bug
sempre quando eu digito /v estacionar o carro some, eu redefini o meu sistema de veнculos, como arrumar esse comando?
pawn Код:
else if(strcmp(x_nr,"estacionar",true) == 0)
{
//new carid = GetPlayerVehicleID(playerid);
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um carro.");
return 1;
}
if(IsAnOwnableCar(carid))
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ Voce estacionou o veiculo aqui. ~n~");
GameTextForPlayer(playerid, "Voce estacionou o veiculo nesta posicao, ele dara spawn aqui.", 10000, 3);
OnPropUpdate();
OnPlayerUpdate(playerid);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
Re: /v estacionar bug larp -
steki. - 22.02.2011
Acho que isso faz parte, pq depois vocк tem que spawnar ele de volta, mas tem que ver se tem zica aqui:
pawn Код:
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
Re: /v estacionar bug larp - rjjj - 22.02.2011
Isto deve resolver o seu problema:
pawn Код:
if(strcmp(tmp, "estacionar", true) == 0)
{
new Float:x,Float:y,Float:z;
new Float:a;
new getcarid;
new carid;
new Veiculo = PlayerInfo[playerid][pVeiculo];
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) { carid = PlayerInfo[playerid][pCarKey]; }
if(IsPlayerInVehicle(playerid,carid) && CarInfo[Veiculo][cOwned] == 1)
{
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
if(PlayerInfo[playerid][pCarKey] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Veiculo!");
return 1;
}
if(getcarid == carid)
{
CarInfo[Veiculo][cLocationx] = x;
CarInfo[Veiculo][cLocationy] = y;
CarInfo[Veiculo][cLocationz] = z;
CarInfo[Veiculo][cAngle] = a;
format(string, sizeof(string), "~n~ Voce estacionou o veiculo aqui. ~n~");
GameTextForPlayer(playerid, "Voce estacionou o veiculo nesta posicao, ele dara spawn aqui.", 10000, 3);
DestroyVehicle(Veiculo);
CreateVehicle(CarInfo[Veiculo][cModel],CarInfo[Veiculo][cLocationx],CarInfo[Veiculo][cLocationy],CarInfo[Veiculo][cLocationz]+1.0,CarInfo[Veiculo][cAngle],CarInfo[Veiculo][cColorOne],CarInfo[Veiculo][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
SaveCars();
return 1;
}
return 1;
}
return 1;
}
Espero ter ajudado
Re: /v estacionar bug larp -
GuikBretas - 22.02.2011
Esse cуdigo nгo й pro larp, e nгo funcionou aqui...
mais vlw mesmo assim
Re: /v estacionar bug larp -
zbt_Daimyo - 22.02.2011
retire a linha
DestroyVehicle(carid);
Quando voce estaciona o carro ele e destruido altomaticamente: d
Re: /v estacionar bug larp -
Ricop522 - 22.02.2011
se tirar o destroy, tira o create tambйm