|
if(strcmp(tmp, "estacionar", true) == 0) { new Float ,Float:y,Float:z;new Float:a; new carid; new getcarid; 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 seu Veiculo aqui. ~n~"); GameTextForPlayer(playerid, "Agora seu Veiculo ira dar respawn aqui, ou seja nascer aqui.", 10000, 3); DestroyVehicle(carid); 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; } |
if(strcmp(tmp, "estacionar", true) == 0)
{
if(PlayerInfo[playerid][pCarKey] == 0)
return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Veiculo!");
new Float,Float:y,Float:z,Float:a;
new carid, getcarid;
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(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 seu Veiculo aqui. ~n~");
GameTextForPlayer(playerid, "Agora seu Veiculo ira dar respawn aqui, ou seja nascer aqui.", 10000, 3);
SaveCars();
}
return 1;
}
return 1;
}
if(!strcmp(tmp, "estacionar", true))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "<!> Vocк nгo estб em um carro."); //Checando se estб em um veнculo.
if(PlayerInfo[playerid][pCarKey] == 0) return SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Veiculo!"); //Adicione isso antes.
new Float:Pos[4]; //X,Y,Z,В
new carroid; //Carro ID
new v = PlayerInfo[playerid][pVeiculo]; //chave
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pCarKey]) carroid = PlayerInfo[playerid][pCarKey];
if(IsPlayerInVehicle(playerid, carroid) && CarInfo[v][cOwned] == 1)
{
GetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
CarInfo[carroid][cLocationx] = x;
CarInfo[carroid][cLocationy] = y;
CarInfo[carroid][cLocationz] = z;
CarInfo[carroid][cAngle] = a;
//format(string, sizeof(string), "~n~ Voce estacionou seu Veiculo aqui. ~n~"); //vocк nгo usou essa string.
GameTextForPlayer(playerid, "Agora seu Veiculo ira dar respawn aqui, ou seja nascer aqui.", 10000, 3);
DestroyVehicle(carroid);
CreateVehicle(CarInfo[carroid][cModel],CarInfo[carroid][cLocationx],CarInfo[carroid][cLocationy],CarInfo[carroid][cLocationz]+1.0,CarInfo[carroid][cAngle],CarInfo[carroid][cColorOne],CarInfo[carroid][cColorTwo],60000);
TogglePlayerControllable(playerid, 1);
SaveCars();
return 1;
}
return 1;
}