[Ajuda] Sistema de Concessionaria
#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


Messages In This Thread
Sistema de Concessionaria - by SmokeKiLL - 27.01.2019, 06:55
Re: Sistema de Concessionaria - by Felipealves - 27.01.2019, 10:49
Re: Sistema de Concessionaria - by SmokeKiLL - 27.01.2019, 12:13
Re: Sistema de Concessionaria - by Felipealves - 27.01.2019, 22:26
Re: Sistema de Concessionaria - by SmokeKiLL - 27.01.2019, 22:30
Re: Sistema de Concessionaria - by Felipealves - 27.01.2019, 22:46
Re: Sistema de Concessionaria - by SmokeKiLL - 27.01.2019, 22:53
Re: Sistema de Concessionaria - by SmokeKiLL - 27.01.2019, 23:15
Re: Sistema de Concessionaria - by Felipealves - 28.01.2019, 01:29
Re: Sistema de Concessionaria - by SmokeKiLL - 28.01.2019, 01:51

Forum Jump:


Users browsing this thread: 3 Guest(s)