27.11.2013, 08:15
olб. quando ligo e logo no meu servidor os carros das casas estгo todos destrancado. mas depois se fizer o /trancar. o. carro fecha normalmente.
cumprimentos
cumprimentos
// em ongamemodeint
for(new i=0; i < MAX_VEHICLES; i++)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(i, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
}
if(strcmp(cmd, "/trancar", true) == 0)
{
new carid;
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
if(gLastCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo tem um carro de casa/alugado.");
return 1;
}
else if(gLastCar[playerid] != 0)
{
if (HireCar[playerid] != gLastCar[playerid] && HireCar[playerid] > 0)
{
gLastDriver[HireCar[playerid]] = 300;
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
}
HireCar[playerid] = gLastCar[playerid];
}
}
if (PlayerInfo[playerid][pPHousekey] == 255)
{
if(HireCar[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro.");
return 1;
}
}
if(PlayerInfo[playerid][pPHousekey] != 255) carid = HouseInfo[PlayerInfo[playerid][pPHousekey]][hV_ID];
if(HireCar[playerid] > 0 && !SwitchKey[playerid])
{
carid = HireCar[playerid];
}
new lockstatus = VTrancado[carid];
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(carid, cx, cy, cz);
switch (lockstatus)
{
case 0:
{
if(HireCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Veiculo Alugado~r~Fechado", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
VTrancado[carid] = 1;
LockCar(carid);
return 1;
}
else if(HouseInfo[PlayerInfo[playerid][pPHousekey]][hV_ID] == carid)
{
GameTextForPlayer(playerid, "~w~Veiculo da Casa ~r~Fechado", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
VTrancado[carid] = 1;
LockCar(carid);
return 1;
}
}
case 1:
{
if(HireCar[playerid] == 0 && PlayerInfo[playerid][pPHousekey] == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro");
return 1;
}
if(HireCar[playerid] == carid && !SwitchKey[playerid])
{
GameTextForPlayer(playerid, "~w~Veiculo Alugado~g~Aberto", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
VTrancado[carid] = 0;
UnLockCar(carid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
return 1;
}
if (HouseInfo[PlayerInfo[playerid][pPHousekey]][hV_ID] == carid)
{
GameTextForPlayer(playerid, "~w~Veiculo da Casa ~g~Aberto", 5000, 6);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
VTrancado[carid] = 0;
UnLockCar(carid);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
return 1;
}
}
default:
{
SendClientMessage(playerid, COLOR_GRAD2, "Erro");
}
}
if(carid == 256)
{
SendClientMessage(playerid, COLOR_GRAD2, "Voce nгo tem um carro!");
}
return 1;
}
if(HireCar[playerid] > 0)
{
VTrancado[HireCar[playerid]] = 0;
UnLockCar(HireCar[playerid]);
SetVehicleToRespawn(HireCar[playerid]);
HireCar[playerid] = 0;
}
for(new h = 0; h < sizeof(HouseInfo); h++){HouseInfo[h][hV_ID] = AddStaticVehicleEx(HouseInfo[h][hVec], HouseCarSpawns[h][0], HouseCarSpawns[h][1], HouseCarSpawns[h][2], HouseCarSpawns[h][3], HouseInfo[h][hVcol1], HouseInfo[h][hVcol2], 6000000);
VTrancado[h+totalveiculosh] = 1;
LockCar(h+totalveiculosh);
SetVehicleToRespawn(h+totalveiculosh);}
for(new i = 1; i < sizeof(CarInfo); i++){CarInfo[i][ownedvehicle] = AddStaticVehicleEx(CarInfo[i][cModel],CarInfo[i][cLocationx],CarInfo[i][cLocationy],CarInfo[i][cLocationz],CarInfo[i][cAngle],CarInfo[i][cColorOne],CarInfo[i][cColorTwo],-1);}