[Ajuda] Sistema de Concessionaria
#1

Bom, eu estou criando esse sistema de concessionaria, nгo sei se foi o melhor jeito para criar, mas... eu estou com uma dъvida, como eu faзo para verificar se o carro que o cara estб й dele realmente e tambйm como eu verifico se ele estб no carro 1, 2 ou 3, por que estou querendo fazer um /estacionar e sem saber em qual carro ele estб, fica difнcil, se alguйm puder me ajudar eu agradeзo.

Se alguйm quiser me mostrar outra maneira de criar esse sistema eu agradeзo tambйm.

PHP код:
enum vConceInfo
{
    
vTemCarro,
    
vModel,
    
vColorOne,
    
vColorTwo,
    
Float:vLocalx,
    
Float:vLocaly,
    
Float:vLocalz,
    
Float:vAngle,
    
vehicleconce,
    
vTemCarro2,
    
vModel2,
    
vColorOne2,
    
vColorTwo2,
    
Float:vLocalx2,
    
Float:vLocaly2,
    
Float:vLocalz2,
    
Float:vAngle2,
    
vehicleconce2,
    
vTemCarro3,
    
vModel3,
    
vColorOne3,
    
vColorTwo3,
    
Float:vLocalx3,
    
Float:vLocaly3,
    
Float:vLocalz3,
    
Float:vAngle3,
    
vehicleconce3
}
new 
ConceInfo[MAX_PLAYERS][vConceInfo];
stock SalvarPlayerCarro(playerid)
{
    new 
file[100], nome[24];
    
GetPlayerName(playeridnome24);
    
format(file74"Concessionaria/%s.txt"nome);
    if(!
DOF2_FileExists(file))DOF2_CreateFile(file);
    
// # Carro 1 #
    
DOF2_SetInt(file"TemCarro"ConceInfo[playerid][vTemCarro]);
    
DOF2_SetInt(file"Modelo"ConceInfo[playerid][vModel]);
    
DOF2_SetInt(file"Cor1"ConceInfo[playerid][vColorOne]);
    
DOF2_SetInt(file"Cor2"ConceInfo[playerid][vColorTwo]);
    
DOF2_SetFloat(file"CarroX"ConceInfo[playerid][vLocalx]);
    
DOF2_SetFloat(file"CarroY"ConceInfo[playerid][vLocaly]);
    
DOF2_SetFloat(file"CarroZ"ConceInfo[playerid][vLocalz]);
    
DOF2_SetFloat(file"CarroA"ConceInfo[playerid][vAngle]);
    
// # Carro 2 #
    
DOF2_SetInt(file"TemCarro-2"ConceInfo[playerid][vTemCarro2]);
    
DOF2_SetInt(file"Modelo-2"ConceInfo[playerid][vModel2]);
    
DOF2_SetInt(file"Cor1-2"ConceInfo[playerid][vColorOne2]);
    
DOF2_SetInt(file"Cor2-2"ConceInfo[playerid][vColorTwo2]);
    
DOF2_SetFloat(file"CarroX-2"ConceInfo[playerid][vLocalx2]);
    
DOF2_SetFloat(file"CarroY-2"ConceInfo[playerid][vLocaly2]);
    
DOF2_SetFloat(file"CarroZ-2"ConceInfo[playerid][vLocalz2]);
    
DOF2_SetFloat(file"CarroA-2"ConceInfo[playerid][vAngle2]);
    
// # Carro 3 #
    
DOF2_SetInt(file"TemCarro-3"ConceInfo[playerid][vTemCarro3]);
    
DOF2_SetInt(file"Modelo-3"ConceInfo[playerid][vModel3]);
    
DOF2_SetInt(file"Cor1-3"ConceInfo[playerid][vColorOne3]);
    
DOF2_SetInt(file"Cor2-3"ConceInfo[playerid][vColorTwo3]);
    
DOF2_SetFloat(file"CarroX-3"ConceInfo[playerid][vLocalx3]);
    
DOF2_SetFloat(file"CarroY-3"ConceInfo[playerid][vLocaly3]);
    
DOF2_SetFloat(file"CarroZ-3"ConceInfo[playerid][vLocalz3]);
    
DOF2_SetFloat(file"CarroA-3"ConceInfo[playerid][vAngle3]);
    
DOF2_SaveFile();
    return 
1;
}
stock CarregarCarro(playerid)
{
    new 
file[100], nome[24];
    
GetPlayerName(playeridnome24);
    
format(file74"Concessionaria/%s.txt"nome);
    if(
DOF2_FileExists(file))
    {
        
        
ConceInfo[playerid][vTemCarro] = DOF2_GetInt(file"TemCarro");
        
ConceInfo[playerid][vModel] = DOF2_GetInt(file"Modelo");
        
ConceInfo[playerid][vColorOne] = DOF2_GetInt(file"Cor1");
        
ConceInfo[playerid][vColorTwo] = DOF2_GetInt(file"Cor2");
        
ConceInfo[playerid][vLocalx] = DOF2_GetFloat(file"CarroX");
        
ConceInfo[playerid][vLocaly] = DOF2_GetFloat(file"CarroY");
        
ConceInfo[playerid][vLocalz] = DOF2_GetFloat(file"CarroZ");
        
ConceInfo[playerid][vAngle] = DOF2_GetFloat(file"CarroA");
        
ConceInfo[playerid][vTemCarro2] = DOF2_GetInt(file"TemCarro-2");
        
ConceInfo[playerid][vModel2] = DOF2_GetInt(file"Modelo-2");
        
ConceInfo[playerid][vColorOne2] = DOF2_GetInt(file"Cor1-2");
        
ConceInfo[playerid][vColorTwo2] = DOF2_GetInt(file"Cor2-2");
        
ConceInfo[playerid][vLocalx2] = DOF2_GetFloat(file"CarroX-2");
        
ConceInfo[playerid][vLocaly2] = DOF2_GetFloat(file"CarroY-2");
        
ConceInfo[playerid][vLocalz2] = DOF2_GetFloat(file"CarroZ-2");
        
ConceInfo[playerid][vAngle2] = DOF2_GetFloat(file"CarroA-2");
        
ConceInfo[playerid][vTemCarro3] = DOF2_GetInt(file"TemCarro-3");
        
ConceInfo[playerid][vModel3] = DOF2_GetInt(file"Modelo-3");
        
ConceInfo[playerid][vColorOne3] = DOF2_GetInt(file"Cor1-3");
        
ConceInfo[playerid][vColorTwo3] = DOF2_GetInt(file"Cor2-3");
        
ConceInfo[playerid][vLocalx3] = DOF2_GetFloat(file"CarroX-3");
        
ConceInfo[playerid][vLocaly3] = DOF2_GetFloat(file"CarroY-3");
        
ConceInfo[playerid][vLocalz3] = DOF2_GetFloat(file"CarroZ-3");
        
ConceInfo[playerid][vAngle3] = DOF2_GetFloat(file"CarroA-3");
        if(
ConceInfo[playerid][vTemCarro] == 1)
        {
            
            
ConceInfo[playerid][vehicleconce] = CreateVehicle(ConceInfo[playerid][vModel],
            
ConceInfo[playerid][vLocalx], ConceInfo[playerid][vLocaly], ConceInfo[playerid][vLocalz],
            
ConceInfo[playerid][vAngle], ConceInfo[playerid][vColorOne], ConceInfo[playerid][vColorTwo], -1);
            
SetVehicleVirtualWorld(ConceInfo[playerid][vehicleconce], 0);
            
LinkVehicleToInterior(ConceInfo[playerid][vehicleconce], 0);
        }
        if(
ConceInfo[playerid][vTemCarro2] == 1)
        {
            
            
ConceInfo[playerid][vehicleconce2] = CreateVehicle(ConceInfo[playerid][vModel2],
            
ConceInfo[playerid][vLocalx2], ConceInfo[playerid][vLocaly2], ConceInfo[playerid][vLocalz2],
            
ConceInfo[playerid][vAngle2], ConceInfo[playerid][vColorOne2], ConceInfo[playerid][vColorTwo2], -1);
            
SetVehicleVirtualWorld(ConceInfo[playerid][vehicleconce2], 0);
            
LinkVehicleToInterior(ConceInfo[playerid][vehicleconce2], 0);
        }
        if(
ConceInfo[playerid][vTemCarro3] == 1)
        {
            
            
ConceInfo[playerid][vehicleconce3] = CreateVehicle(ConceInfo[playerid][vModel3],
            
ConceInfo[playerid][vLocalx3], ConceInfo[playerid][vLocaly3], ConceInfo[playerid][vLocalz3],
            
ConceInfo[playerid][vAngle3], ConceInfo[playerid][vColorOne3], ConceInfo[playerid][vColorTwo3], -1);
            
SetVehicleVirtualWorld(ConceInfo[playerid][vehicleconce3], 0);
            
LinkVehicleToInterior(ConceInfo[playerid][vehicleconce3], 0);
        }
    }
    return 
1;

Reply
#2

Basicamente vocк vai seguir o MAX_PLAYERCAR

no caso ele vai sempre o i, ConceInfo[playerid][i] aqui entra ele [vTemCarro] e depois й chamado o enum, entгo se vocк quiser verificar o carro 3 bota, ConceInfo[playerid][2][vTemCarro] ou carro 1 ConceInfo[playerid][1][vTemCarro]. enfim й isso, qualquer coisa mais tarde eu vejo sua duvida.

PHP код:
#define MAX_PLAYERCAR   3
enum vConceInfo 

    
vTemCarro
    
vModel
    
vColorOne
    
vColorTwo
    
Float:vLocal[3], 
    
Float:vAngle
    
vehicleconce

new 
ConceInfo[MAX_PLAYERS][MAX_PLAYERCAR][vConceInfo];
stock SalvarPlayerCarro(playerid

    new 
file[100], nome[24]; 
    
GetPlayerName(playeridnome24); 
    
format(file74"Concessionaria/%s.txt"nome); 
    if(!
DOF2_FileExists(file)) DOF2_CreateFile(file); 
    
// Carros
    
for(new 0MAX_PLAYERCARi++){
        
DOF2_SetInt(file"TemCarro"ConceInfo[playerid][i][vTemCarro]); 
        
DOF2_SetInt(file"Modelo"ConceInfo[playerid][i][vModel]); 
        
DOF2_SetInt(file"Cor1"ConceInfo[playerid][i][vColorOne]); 
        
DOF2_SetInt(file"Cor2"ConceInfo[playerid][i][vColorTwo]); 
        
DOF2_SetFloat(file"CarroX"ConceInfo[playerid][i][vLocal][0]); 
        
DOF2_SetFloat(file"CarroY"ConceInfo[playerid][i][vLocal][1]); 
        
DOF2_SetFloat(file"CarroZ"ConceInfo[playerid][i][vLocal][2]); 
        
DOF2_SetFloat(file"CarroA"ConceInfo[playerid][i][vAngle]); 
    }
    
DOF2_SaveFile(); 
    return 
1

stock CarregarCarro(playerid

    new 
file[100], nome[24]; 
    
GetPlayerName(playeridnome24); 
    
format(file74"Concessionaria/%s.txt"nome); 
    if(
DOF2_FileExists(file)) 
    { 
        for(new 
0MAX_PLAYERCARi++){   
            
ConceInfo[playerid][i][vTemCarro] = DOF2_GetInt(file"TemCarro"); 
            
ConceInfo[playerid][i][vModel] = DOF2_GetInt(file"Modelo"); 
            
ConceInfo[playerid][i][vColorOne] = DOF2_GetInt(file"Cor1"); 
            
ConceInfo[playerid][i][vColorTwo] = DOF2_GetInt(file"Cor2"); 
            
ConceInfo[playerid][i][vLocal][0] = DOF2_GetFloat(file"CarroX"); 
            
ConceInfo[playerid][i][vLocal][1] = DOF2_GetFloat(file"CarroY"); 
            
ConceInfo[playerid][i][vLocal][2] = DOF2_GetFloat(file"CarroZ"); 
            
ConceInfo[playerid][i][vAngle] = DOF2_GetFloat(file"CarroA"); 
            if(
ConceInfo[playerid][i][vTemCarro] == i
            { 
                
ConceInfo[playerid][i][vehicleconce] = CreateVehicle(ConceInfo[playerid][i][vModel], 
                
ConceInfo[playerid][i][vLocal][0], ConceInfo[playerid][i][vLocal][1], ConceInfo[playerid][i][vLocal][2], 
                
ConceInfo[playerid][i][vAngle], ConceInfo[playerid][i][vColorOne], ConceInfo[playerid][i][vColorTwo], -1); 
                
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0); 
                
LinkVehicleToInterior(ConceInfo[playerid][i][vehicleconce], 0); 
            } 
        }
    } 
    return 
1
}  
CMD:estacionar(playerid){
    new 
vehicleid GetPlayerVehicleID(playerid);
    for(new 
0MAX_PLAYERCARi++){
        if(
ConceInfo[playerid][i][vehicleconce] == vehicleid){
            new 
Float:pPos[4];
            
GetPlayerPos(playeridpPos[0], pPos[1], pPos[2]);
            
GetPlayerFacingAngle(playeridpPos[3]);
            
ConceInfo[playerid][i][vLocal][0] = 0.0;
            
ConceInfo[playerid][i][vLocal][1] = pPos[1];
            
ConceInfo[playerid][i][vLocal][2] = pPos[2];
            
ConceInfo[playerid][i][vAngle] = pPos[3];
            
DestroyVehicle(ConceInfo[playerid][i][vehicleconce]);
            
ConceInfo[playerid][i][vehicleconce] = CreateVehicle(ConceInfo[playerid][i][vModel], 
            
ConceInfo[playerid][i][vLocal][0], ConceInfo[playerid][i][vLocal][1], ConceInfo[playerid][i][vLocal][2], 
            
ConceInfo[playerid][i][vAngle], ConceInfo[playerid][i][vColorOne], ConceInfo[playerid][i][vColorTwo], -1); 
            
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0); 
            
LinkVehicleToInterior(ConceInfo[playerid][i][vehicleconce], 0); 
            break;
        }
    }    
    return 
1;

Reply
#3

Humm... entendi mais ou menos. Tipo... eu coloquei assim:
PHP код:
// Quando ele cria o veнculo
carro_conce[playerid] = CreateVehicle(strval(inputtext), ....);
if(
dialogid == 10)
{
    if(!
response)
    {
        
SendClientMessage(playeridCOLOR_GREY"Voce cancelou a compra do veiculo.");
        return 
1;
    }
    if(
response)
    {
        new 
vehicleid GetPlayerVehicleID(playerid),
        
color_1color_2Float:XFloat:YFloat:Z,
        
Float:Angle;
        
GetVehicleColor(vehicleidcolor_1color_2);
        
GetVehiclePos(vehicleidXYZ);
        
GetVehicleZAngle(vehicleidAngle);
        if(
ConceInfo[playerid][1][vTemCarro] == 0)
        {
            
ConceInfo[playerid][1][vTemCarro] = 1;
            
ConceInfo[playerid][1][vModel] =  GetVehicleModel(vehicleid);
            
ConceInfo[playerid][1][vColorOne] = color_1;
            
ConceInfo[playerid][1][vColorTwo] = color_2;
            
ConceInfo[playerid][1][vLocal][0] = X;
            
ConceInfo[playerid][1][vLocal][1] = Y;
            
ConceInfo[playerid][1][vLocal][2] = Z;
            
ConceInfo[playerid][1][vAngle] = Angle;
        }
        
SetVehicleVirtualWorld(carro_conce[playerid], 0);
        
SetPlayerVirtualWorld(playerid0);
        
SetCameraBehindPlayer(playerid);
        
SalvarPlayerCarro(playerid);
    }
    return 
1;

Ai tipo, ele nгo estб salvando, ele cria o arquivo mas nгo salva os dados, to fazendo errado nй?
Reply
#4

essa й uma das forma de vc salvar, lembrando que, vocк pode optar por salvar apenas qnd o player sair do servidor ou qnd ele comprar o veiculo, mas lembre de carregar, pd ser dessa mesma forma sу q invertido ;0
que nгo vai
PHP код:
    new string[34], file[24];
    
// Carros 
    
format(filesizeof(file), "Concessionaria/%s.txt"nome);
    
DOF2_CreateFile(file);
    for(new 
03i++){ 
        
format(stringsizeof(string), "TemCarro_%d"i);
        
DOF2_SetInt(filestringConceInfo[0][i][vTemCarro]);  
        
format(stringsizeof(string), "Modelo_%d"i);
        
DOF2_SetInt(filestringConceInfo[0][i][vModel]);  
        
format(stringsizeof(string), "Cor1_%d"i);
        
DOF2_SetInt(filestringConceInfo[0][i][vColorOne]);  
        
format(stringsizeof(string), "Cor2_%d"i);
        
DOF2_SetInt(filestringConceInfo[0][i][vColorTwo]);  
        
format(stringsizeof(string), "CarroX_%d"i);
        
DOF2_SetFloat(filestringConceInfo[0][i][vLocal][0]);  
        
format(stringsizeof(string), "CarroY_%d"i);
        
DOF2_SetFloat(filestringConceInfo[0][i][vLocal][1]);  
        
format(stringsizeof(string), "CarroZ_%d"i);
        
DOF2_SetFloat(filestringConceInfo[0][i][vLocal][2]);  
        
format(stringsizeof(string), "CarroA_%d"i);
        
DOF2_SetFloat(filestringConceInfo[0][i][vAngle]);  
    } 
    
DOF2_SaveFile(); 
@edit: o 'zero' ali й o player id.
Reply
#5

Pera... agora buguei de vez kkkk tipo... pra mim setar esses valores, eu tenho que colocar isso que vocк mandou e tambйm colocar exemplo:

PHP код:
            ConceInfo[playerid][1][vTemCarro] = 1
            
ConceInfo[playerid][1][vModel] =  GetVehicleModel(vehicleid); 
            
ConceInfo[playerid][1][vColorOne] = color_1
            
ConceInfo[playerid][1][vColorTwo] = color_2
            
ConceInfo[playerid][1][vLocal][0] = X
            
ConceInfo[playerid][1][vLocal][1] = Y
            
ConceInfo[playerid][1][vLocal][2] = Z
            
ConceInfo[playerid][1][vAngle] = Angle
Colocar essas informaзхes, й isso?

@edit Ah entendi mano, estб pegando aqui, vlw +REP Qualquer coisa eu venho encher teu saco de novo aqui ksksks
Reply
#6

Sim, isso que vc vai colocar pra armazenar as informaзхes do veiculo novo do player, qnd ele comprar, dps sу salva.


coloque abaixo, ou crie uma funзгo para salvar desse jeito.
PHP код:
    new string[34], file[18+24+1]; 
    
// Carros  
    
format(filesizeof(file), "Concessionaria/%s.txt"nome); 
    if(!
DOF2_FileExists(file)){
        
DOF2_CreateFile(file); 
        for(new 
03i++){  
            
format(stringsizeof(string), "TemCarro_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vTemCarro]);   
            
format(stringsizeof(string), "Modelo_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vModel]);   
            
format(stringsizeof(string), "Cor1_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vColorOne]);   
            
format(stringsizeof(string), "Cor2_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vColorTwo]);   
            
format(stringsizeof(string), "CarroX_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][playerid]);   
            
format(stringsizeof(string), "CarroY_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][1]);   
            
format(stringsizeof(string), "CarroZ_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][2]);   
            
format(stringsizeof(string), "CarroA_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vAngle]);   
        }  
        
DOF2_SaveFile();
    }else{
        for(new 
03i++){  
            
format(stringsizeof(string), "TemCarro_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vTemCarro]);   
            
format(stringsizeof(string), "Modelo_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vModel]);   
            
format(stringsizeof(string), "Cor1_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vColorOne]);   
            
format(stringsizeof(string), "Cor2_%d"i); 
            
DOF2_SetInt(filestringConceInfo[playerid][i][vColorTwo]);   
            
format(stringsizeof(string), "CarroX_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][playerid]);   
            
format(stringsizeof(string), "CarroY_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][1]);   
            
format(stringsizeof(string), "CarroZ_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vLocal][2]);   
            
format(stringsizeof(string), "CarroA_%d"i); 
            
DOF2_SetFloat(filestringConceInfo[playerid][i][vAngle]);   
        }  
        
DOF2_SaveFile();  
    } 
Reply
#7

Blz, vou dar uma testada aqui.
Reply
#8

@Edit Refiz o sistema aqui, estб salvando de boas, cada um dos carros, o problema й que nгo estб carregando o carro quando ele destrуi.

PHP код:
stock CarregarCarros(playerid)
{
    new 
file[100], nome[24];
    
GetPlayerName(playeridnome24);
    
format(file74"Concessionaria/%s.txt"nome);
    if(
DOF2_FileExists(file))
    {
        for(new 
0MAX_PLAYERCARi++)
        {
            
ConceInfo[playerid][i][vTemCarro] = DOF2_GetInt(file"TemCarro");
            
ConceInfo[playerid][i][vModel] = DOF2_GetInt(file"Modelo");
            
ConceInfo[playerid][i][vColorOne] = DOF2_GetInt(file"Cor1");
            
ConceInfo[playerid][i][vColorTwo] = DOF2_GetInt(file"Cor2");
            
ConceInfo[playerid][i][vLocal][0] = DOF2_GetFloat(file"CarroX");
            
ConceInfo[playerid][i][vLocal][1] = DOF2_GetFloat(file"CarroY");
            
ConceInfo[playerid][i][vLocal][2] = DOF2_GetFloat(file"CarroZ");
            
ConceInfo[playerid][i][vAngle] = DOF2_GetFloat(file"CarroA");
            if(
ConceInfo[playerid][i][vTemCarro] == i)
            {
                
ConceInfo[playerid][i][vehicleconce] = CreateVehicle(ConceInfo[playerid][i][vModel],
                
ConceInfo[playerid][i][vLocal][0], ConceInfo[playerid][i][vLocal][1], ConceInfo[playerid][i][vLocal][2],
                
ConceInfo[playerid][i][vAngle], ConceInfo[playerid][i][vColorOne], ConceInfo[playerid][i][vColorTwo], -1);
                
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0);
                
LinkVehicleToInterior(ConceInfo[playerid][i][vehicleconce], 0);
            }
        }
    }
    return 
1;

Reply
#9

Eu falei pra carregar igual salvar...
ex: faz isso em todos...
PHP код:
format(stringsizeof(string), "TemCarro_%d"i);  
ConceInfo[playerid][i][vTemCarro] = DOF2_GetInt(filestring); 
Reply
#10

Estб carregando apenas 1 carro

PHP код:
stock CarregarCarros(playerid)
{
    new 
string[34], file[100], nome[24];
    
GetPlayerName(playeridnome24);
    
format(file74"Concessionaria/%s.txt"nome);
    if(
DOF2_FileExists(file))
    {
        for(new 
0MAX_PLAYERCARi++)
        {
            
format(stringsizeof(string), "TemCarro_%d"i);
            
ConceInfo[playerid][i][vTemCarro] = DOF2_GetInt(filestring);
            
format(stringsizeof(string), "Modelo_%d"i);
            
ConceInfo[playerid][i][vModel] = DOF2_GetInt(filestring);
            
format(stringsizeof(string), "Cor1_%d"i);
            
ConceInfo[playerid][i][vColorOne] = DOF2_GetInt(filestring);
            
format(stringsizeof(string), "Cor2_%d"i);
            
ConceInfo[playerid][i][vColorTwo] = DOF2_GetInt(filestring);
            
format(stringsizeof(string), "CarroX_%d"i);
            
ConceInfo[playerid][i][vLocal][0] = DOF2_GetFloat(filestring);
            
format(stringsizeof(string), "CarroY_%d"i);
            
ConceInfo[playerid][i][vLocal][1] = DOF2_GetFloat(filestring);
            
format(stringsizeof(string), "CarroZ_%d"i);
            
ConceInfo[playerid][i][vLocal][2] = DOF2_GetFloat(filestring);
            
format(stringsizeof(string), "CarroA_%d"i);
            
ConceInfo[playerid][i][vAngle] = DOF2_GetFloat(filestring);
            if(
ConceInfo[playerid][i][vTemCarro] == i)
            {
                
ConceInfo[playerid][i][vehicleconce] = CreateVehicle(ConceInfo[playerid][i][vModel],
                
ConceInfo[playerid][i][vLocal][0], ConceInfo[playerid][i][vLocal][1], ConceInfo[playerid][i][vLocal][2],
                
ConceInfo[playerid][i][vAngle], ConceInfo[playerid][i][vColorOne], ConceInfo[playerid][i][vColorTwo], -1);
                
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0);
                
LinkVehicleToInterior(ConceInfo[playerid][i][vehicleconce], 0);
            }
        }
    }
    return 
1;

@Edit Dialog caso precise...
PHP код:
if(dialogid == D_Conce)
{
    
    if(
response)
    {
        
        if(!
strlen(inputtext) || (!IsNumeric(inputtext)))
        return 
ForT:conce(playerid);
        if(
strval(inputtext) < 400 || (strval(inputtext) > 611))
        return 
SendClientMessage(playerid, -1"Modelo Do Carro Tem Que Ser Entre 411 e 600 !");
        if(!
IsACarrosConce(strval(inputtext))) return SendClientMessage(playerid, -1"Este modelo nao esta disponivel !");
        
SetPVarInt(playerid"idcarro_conce"strval(inputtext));
        new 
randomMundo;
        
randomMundo random(50000);
        if(
ConceInfo[playerid][0][vTemCarro] == 0)
        {
            
            
ConceInfo[playerid][0][vehicleconce] = CreateVehicle(strval(inputtext), 2148.0720, -1143.066525.0160, -90.000011, -1);
            
PutPlayerInVehicle(playeridConceInfo[playerid][0][vehicleconce], 0);
            
SetVehicleVirtualWorld(ConceInfo[playerid][0][vehicleconce], randomMundo);
        }
        else if(
ConceInfo[playerid][1][vTemCarro] == 0)
        {
            
            
ConceInfo[playerid][1][vehicleconce] = CreateVehicle(strval(inputtext), 2148.0720, -1143.066525.0160, -90.000011, -1);
            
PutPlayerInVehicle(playeridConceInfo[playerid][1][vehicleconce], 0);
            
SetVehicleVirtualWorld(ConceInfo[playerid][1][vehicleconce], randomMundo);
        }
        else if(
ConceInfo[playerid][2][vTemCarro] == 0)
        {
            
            
ConceInfo[playerid][2][vehicleconce] = CreateVehicle(strval(inputtext), 2148.0720, -1143.066525.0160, -90.000011, -1);
            
PutPlayerInVehicle(playeridConceInfo[playerid][2][vehicleconce], 0);
            
SetVehicleVirtualWorld(ConceInfo[playerid][2][vehicleconce], randomMundo);
        }
        
SetPlayerCameraPos(playerid2152.5361, -1133.951829.8716);
        
SetPlayerCameraLookAt(playerid2152.0764, -1134.839229.5416);
        
SetPlayerVirtualWorld(playeridrandomMundo);
        
SetPlayerInterior(playerid0);
        
SetTimerEx("Dialog_Conce_Preco"2000false"i"playerid);
    }
    return 
1;
}
if(
dialogid == D_Conce_Preco)
{
    
    if(!
response)
    {
        
        if(
ConceInfo[playerid][0][vTemCarro] == 0){DestroyVehicle(ConceInfo[playerid][0][vehicleconce]);}
        else if(
ConceInfo[playerid][1][vTemCarro] == 0){DestroyVehicle(ConceInfo[playerid][1][vehicleconce]);}
        else if(
ConceInfo[playerid][2][vTemCarro] == 0){DestroyVehicle(ConceInfo[playerid][2][vehicleconce]);}
        
SetPlayerPos(playerid2131.8552, -1151.322924.0606);
        
SetPlayerFacingAngle(playerid178.9879);
        
SetPlayerInterior(playerid0);
        
SetPlayerVirtualWorld(playerid0);
        
SetCameraBehindPlayer(playerid);
        
SendClientMessage(playerid, -1"Voce cancelou a compra do veiculo.");
        return 
1;
    }
    if(
response)
    {
        
        new 
vehicleid GetPlayerVehicleID(playerid),
        
color_1color_2Float:PosVeh[4];
        for(new 
0MAX_PLAYERCARi++)
        {
            
            if(
ConceInfo[playerid][i][vehicleconce] == vehicleid)
            {
                
                
GetVehicleColor(vehicleidcolor_1color_2);
                
GetVehiclePos(vehicleidPosVeh[0], PosVeh[1], PosVeh[2]);
                
GetVehicleZAngle(vehicleidPosVeh[3]);
                
ConceInfo[playerid][i][vTemCarro] = 1;
                
ConceInfo[playerid][i][vModel] =  GetVehicleModel(vehicleid);
                
ConceInfo[playerid][i][vColorOne] = color_1;
                
ConceInfo[playerid][i][vColorTwo] = color_2;
                
ConceInfo[playerid][i][vLocal][0] = PosVeh[0];
                
ConceInfo[playerid][i][vLocal][1] = PosVeh[1];
                
ConceInfo[playerid][i][vLocal][2] = PosVeh[2];
                
ConceInfo[playerid][i][vAngle] = PosVeh[3];
                
SetVehicleVirtualWorld(ConceInfo[playerid][i][vehicleconce], 0);
                
SetPlayerVirtualWorld(playerid0);
            }
        }
        
SetCameraBehindPlayer(playerid);
        
SalvarCarros(playerid);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)