[Ajuda] Problema em carros
#1

Bom dia, gostaria de pedir uma ajuda que ja tentei й tipo nгo conseguir vim pedir ajuda vocкs, й o seguinte todos sabem que a GM play Facil existem aqueles veiculos VIPs, entгo eu passei pra minha GM e tudo conseguir mais quando algum player compra o veiculo tudo bem, ele fica sendo o dono e tudo certo quando ele reloga ou quando o servidor reinicia ou da GMx, os veiculos bugгo eles falam que ja tem dono e o dono que e o dono do veiculo ate ai tudo bem mais quando o player vai entrar e digitar as informaзхes o proprio veiculo mostra que nгo e dele e quando alguem vai comprar fala que ja tem dono, alguem pode me ajudar por favor, irei deixar as stocks de carregamento e salvamento pra ver se hб algo de errado...

Quote:

static stock SalvarCarros()
{
new strsave[64];
for(new idx = 0; idx < sizeof(CarInfo); idx ++)
{
format(strsave, sizeof strsave, Pasta_Carros, idx);
DOF2_SetInt(strsave, "Modelo", CarInfo[idx][cModel]);
DOF2_SetFloat(strsave, "CarroX", CarInfo[idx][cLocationx]);
DOF2_SetFloat(strsave, "CarroY", CarInfo[idx][cLocationy]);
DOF2_SetFloat(strsave, "CarroZ", CarInfo[idx][cLocationz]);
DOF2_SetFloat(strsave, "CarroA", CarInfo[idx][cAngle]);
DOF2_SetInt(strsave, "cor1", CarInfo[idx][cColorOne]);
DOF2_SetInt(strsave, "cor2", CarInfo[idx][cColorTwo]);
DOF2_SetString(strsave, "Dono", CarInfo[idx][cOwner]);
DOF2_SetString(strsave, "Descricao", CarInfo[idx][cDescription]);
DOF2_SetInt(strsave, "Valor", CarInfo[idx][cValue]);
DOF2_SetInt(strsave, "Licence", CarInfo[idx][cLicense]);
DOF2_SetInt(strsave, "TemDono", CarInfo[idx][cOwned]);
DOF2_SetInt(strsave, "Trancado", CarInfo[idx][cLock]);
DOF2_SetInt(strsave, "Grana", CarInfo[idx][cGrana]);
DOF2_SetInt(strsave, "Entrada", CarInfo[idx][cEntrada]);
DOF2_SetInt(strsave, "Date", CarInfo[idx][cDate]);

DOF2_SetFloat(strsave, "OCarroX", CarInfo[idx][cOLocationx]);
DOF2_SetFloat(strsave, "OCarroY", CarInfo[idx][cOLocationy]);
DOF2_SetFloat(strsave, "OCarroZ", CarInfo[idx][cOLocationz]);
DOF2_SetFloat(strsave, "OCarroA", CarInfo[idx][cOAngle]);

DOF2_SaveFile();
}
return true;
}
static stock SalvarCarro(idx)
{
new strsave[64];
format(strsave, sizeof strsave, Pasta_Carros, idx);
if(DOF2_FileExists(strsave))
{
DOF2_SetInt(strsave, "Modelo", CarInfo[idx][cModel]);
DOF2_SetFloat(strsave, "CarroX", CarInfo[idx][cLocationx]);
DOF2_SetFloat(strsave, "CarroY", CarInfo[idx][cLocationy]);
DOF2_SetFloat(strsave, "CarroZ", CarInfo[idx][cLocationz]);
DOF2_SetFloat(strsave, "CarroA", CarInfo[idx][cAngle]);
DOF2_SetInt(strsave, "cor1", CarInfo[idx][cColorOne]);
DOF2_SetInt(strsave, "cor2", CarInfo[idx][cColorTwo]);
DOF2_SetString(strsave, "Dono", CarInfo[idx][cOwner]);
DOF2_SetString(strsave, "Descricao", CarInfo[idx][cDescription]);
DOF2_SetInt(strsave, "Valor", CarInfo[idx][cValue]);
DOF2_SetInt(strsave, "Licence", CarInfo[idx][cLicense]);
DOF2_SetInt(strsave, "TemDono", CarInfo[idx][cOwned]);
DOF2_SetInt(strsave, "Trancado", CarInfo[idx][cLock]);
DOF2_SetInt(strsave, "Grana", CarInfo[idx][cGrana]);
DOF2_SetInt(strsave, "Entrada", CarInfo[idx][cEntrada]);
DOF2_SetInt(strsave, "Date", CarInfo[idx][cDate]);

DOF2_SetFloat(strsave, "OCarroX", CarInfo[idx][cOLocationx]);
DOF2_SetFloat(strsave, "OCarroY", CarInfo[idx][cOLocationy]);
DOF2_SetFloat(strsave, "OCarroZ", CarInfo[idx][cOLocationz]);
DOF2_SetFloat(strsave, "OCarroA", CarInfo[idx][cOAngle]);

DOF2_SaveFile();
}
return true;
}



static stock CarregarCarros()
{
new strsave[100];
new string[128];
new idx = 0;
while(idx < sizeof(CarInfo))
{
format(strsave, sizeof strsave, Pasta_Carros, idx);
if(DOF2_FileExists(strsave))
{
CarInfo[idx][cModel] = DOF2_GetInt(strsave, "Modelo");
CarInfo[idx][cLocationx] = DOF2_GetFloat(strsave, "CarroX");
CarInfo[idx][cLocationy] = DOF2_GetFloat(strsave, "CarroY");
CarInfo[idx][cLocationz] = DOF2_GetFloat(strsave, "CarroZ");
CarInfo[idx][cAngle] = DOF2_GetFloat(strsave, "CarroA");
CarInfo[idx][cColorOne] = DOF2_GetInt(strsave, "cor1");
CarInfo[idx][cOLocationx] = DOF2_GetFloat(strsave, "OCarroX");
CarInfo[idx][cOLocationy] = DOF2_GetFloat(strsave, "OCarroY");
CarInfo[idx][cOLocationz] = DOF2_GetFloat(strsave, "OCarroZ");
CarInfo[idx][cOAngle] = DOF2_GetFloat(strsave, "OCarroA");
CarInfo[idx][cColorTwo] = DOF2_GetInt(strsave, "cor2");
strmid(CarInfo[idx][cOwner], DOF2_GetString(strsave, "Dono"), 0 , strlen(DOF2_GetString(strsave, "Dono")), 255);
strmid(CarInfo[idx][cDescription], DOF2_GetString(strsave, "Descricao"), 0, strlen(DOF2_GetString(strsave, "Descricao")), 255);
CarInfo[idx][cValue] = DOF2_GetInt(strsave, "Valor");
CarInfo[idx][cLicense] = DOF2_GetInt(strsave, "Licence");
CarInfo[idx][cOwned] = DOF2_GetInt(strsave, "TemDono");
CarInfo[idx][cLock] = DOF2_GetInt(strsave, "Trancado");
CarInfo[idx][cGrana] = DOF2_GetInt(strsave, "Grana");
CarInfo[idx][cEntrada] = DOF2_GetInt(strsave, "Entrada");
CarInfo[idx][cDate] = DOF2_GetInt(strsave, "Date");

/*if(CarInfo[idx][cColorOne] == 0){

CarInfo[idx][cColorOne] = 1;
}
if(CarInfo[idx][cColorTwo] == 0){

CarInfo[idx][cColorTwo] = 1;
}*/
if(CarInfo[idx][cModel] == 0)
{
CarInfo[idx][cModel] = 559;
}
if(CarInfo[idx][cValue] == 0)
{
CarInfo[idx][cValue] = 10000;
}
if(CarInfo[idx][cEntrada] == 0)
{
CarInfo[idx][cEntrada] = 500;
}

CarInfo[idx][ownedvehicle] = AddStaticVehicleEx(CarInfo[idx][cModel],
CarInfo[idx][cLocationx],CarInfo[idx][cLocationy],CarInfo[idx][cLocationz],
CarInfo[idx][cAngle],CarInfo[idx][cColorOne],CarInfo[idx][cColorTwo],-1);


if(strlen(CarInfo[idx][cDescription]) < 2){
strmid(CarInfo[idx][cDescription], "Nenhuma", 0, strlen("Nenhuma"), 255);
}
if(strlen(CarInfo[idx][cOwner]) < 2){
strmid(CarInfo[idx][cOwner], "Dealership", 0, strlen("Dealership"), 255);
}

/*if(CarInfo[idx][cOwned])
{
format(string, sizeof string, "{50AAFE}Dono: %s\n{FFFF00}Descriзгo\n{FFFFFF}»%s«", CarInfo[idx][cOwner], CarInfo[idx][cDescription]);
CarInfo[idx][cText] = Create3DTextLabel(string, 0xffffaa, 0.0, 0.0, 0.0, 10.0, 0);
Attach3DTextLabelToVehicle(CarInfo[idx][cText], CarInfo[idx][ownedvehicle], 0.0, 0.0, 0.0);
}
else
{
CarInfo[idx][cText] = Create3DTextLabel("{50AAFE}Dono: Ninguem\n{FFFF00}Descriзгo\n{FFFFFF}»Sem Dono«", 0xffffaa, 0.0, 0.0, 0.0, 15.0, 0);
Attach3DTextLabelToVehicle(CarInfo[idx][cText], CarInfo[idx][ownedvehicle], 0.0, 0.0, 0.0);
}*/
}
idx++;
}
return idx;

Quem puder ajudar irб me ajudar muito, Obrigado!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)