05.10.2013, 20:52
Bem, eu crio o carro, compro e estaciono, quando dou GMX o carro desaparece.
Me ajudem por favor.
Me ajudem por favor.
public OnPropUpdate()
{
new idx;
new File: file2;
idx = carsonserver;
while (idx < sizeof(CarInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
CarInfo[idx][cModel],
CarInfo[idx][cLocationx],
CarInfo[idx][cLocationy],
CarInfo[idx][cLocationz],
CarInfo[idx][cAngle],
CarInfo[idx][cColorOne],
CarInfo[idx][cColorTwo],
CarInfo[idx][cOwner],
CarInfo[idx][cDescription],
CarInfo[idx][cValue],
CarInfo[idx][cLicense],
CarInfo[idx][cOwned],
CarInfo[idx][cLock],
CarInfo[idx][mod1],
CarInfo[idx][mod2],
CarInfo[idx][mod3],
CarInfo[idx][mod4],
CarInfo[idx][mod5],
CarInfo[idx][mod6],
CarInfo[idx][mod7],
CarInfo[idx][mod8],
CarInfo[idx][mod9],
CarInfo[idx][mod10],
CarInfo[idx][mod11],
CarInfo[idx][mod12],
CarInfo[idx][mod13],
CarInfo[idx][mod14],
CarInfo[idx][mod15],
CarInfo[idx][mod16],
CarInfo[idx][mod17],
CarInfo[idx][paintjob]);
if(idx == carsonserver)
{
file2 = fopen("BrasilGames/masini.cfg", io_write);
}
else
{
file2 = fopen("BrasilGames/masini.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(HouseInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
HouseInfo[idx][hEntrancex],
HouseInfo[idx][hEntrancey],
HouseInfo[idx][hEntrancez],
HouseInfo[idx][hExitx],
HouseInfo[idx][hExity],
HouseInfo[idx][hExitz],
HouseInfo[idx][hHealthx],
HouseInfo[idx][hHealthy],
HouseInfo[idx][hHealthz],
HouseInfo[idx][hArmorrx],
HouseInfo[idx][hArmorry],
HouseInfo[idx][hArmorrz],
HouseInfo[idx][hOwner],
HouseInfo[idx][hDiscription],
HouseInfo[idx][hValue],
HouseInfo[idx][hHel],
HouseInfo[idx][hArm],
HouseInfo[idx][hInt],
HouseInfo[idx][hLock],
HouseInfo[idx][hOwned],
HouseInfo[idx][hRooms],
HouseInfo[idx][hRent],
HouseInfo[idx][hRentabil],
HouseInfo[idx][hTakings],
HouseInfo[idx][hVec],
HouseInfo[idx][hVcol1],
HouseInfo[idx][hVcol2],
HouseInfo[idx][hDate],
HouseInfo[idx][hLevel],
HouseInfo[idx][hWorld]);
HouseInfo[idx][hWorld] = idx;
if(idx == 0)
{
file2 = fopen("BrasilGames/Casas.cfg", io_write);
}
else
{
file2 = fopen("BrasilGames/Casas.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(BizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d\n",
BizzInfo[idx][bOwned],
BizzInfo[idx][bOwner],
BizzInfo[idx][bMessage],
BizzInfo[idx][bExtortion],
BizzInfo[idx][bEntranceX],
BizzInfo[idx][bEntranceY],
BizzInfo[idx][bEntranceZ],
BizzInfo[idx][bExitX],
BizzInfo[idx][bExitY],
BizzInfo[idx][bExitZ],
BizzInfo[idx][bLevelNeeded],
BizzInfo[idx][bBuyPrice],
BizzInfo[idx][bEntranceCost],
BizzInfo[idx][bTill],
BizzInfo[idx][bLocked],
BizzInfo[idx][bInterior]);
//BizzInfo[idx][VirtualWorld]);
if(idx == 0)
{
file2 = fopen("BrasilGames/Empresas.cfg", io_write);
}
else
{
file2 = fopen("BrasilGames/Empresas.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(SBizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%d|%d|%d|%d|%d\n",
SBizzInfo[idx][sbOwned],
SBizzInfo[idx][sbOwner],
SBizzInfo[idx][sbMessage],
SBizzInfo[idx][sbExtortion],
SBizzInfo[idx][sbEntranceX],
SBizzInfo[idx][sbEntranceY],
SBizzInfo[idx][sbEntranceZ],
SBizzInfo[idx][sbLevelNeeded],
SBizzInfo[idx][sbBuyPrice],
SBizzInfo[idx][sbEntranceCost],
SBizzInfo[idx][sbTill],
SBizzInfo[idx][sbLocked]);
if(idx == 0)
{
file2 = fopen("BrasilGames/MiniEmpresas.cfg", io_write);
}
else
{
file2 = fopen("BrasilGames/MiniEmpresas.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return true;
}
else if(strcmp(x_nr,"estacionar",true) == 0)
{
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);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo possui um carro.");
return 1;
}
if(getcarid == carid)
{
new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
GetVehicleDamageStatus(carid,panels,doors,lights,tires);
GetVehicleHealth(carid, CarHP); OldCarHP = CarHP;
format(string, sizeof(string), "~n~ Vocк estacionou seu veнculo neste local. ~n~");
GameTextForPlayer(playerid, "Vocк estacionou seu veнculo nesta posiзгo. Ele vai reaparecer aqui.", 10000, 3);
OnPropUpdate(); SavePlayerData(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);
LoadComponents(carid);
PutPlayerInVehicle(playerid,carid,0); SetVehicleHealth(carid, OldCarHP);
UpdateVehicleDamageStatus(carid,panels,doors,lights,tires);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
}
if(strcmp(cmd, "/aestacionar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x,Float:y,Float:z;
new Float:a;
new carid;
carid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
if(IsPlayerAdmin(playerid))
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ Vocк estacionou seu carro neste local. ~n~");
GameTextForPlayer(playerid, "Vocк estacionou o carro nessa posiзгo. Ele vai reaparecer aqui.", 10000, 3);
OnPropUpdate(); SavePlayerData(playerid);
DestroyVehicle(carid);
new thiscar = 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);
LoadComponents(thiscar);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo estб autorizado a usar esse comando. !");
return 1;
}
}
return 1;
}