[Ajuda] Concessionaria
#3

PHP код:
SaveVehicles()
{
    new 
file[64];
    for(new 
1MAX_CARS++)
    {
        
format(file64CARROSv);
        if(
DOF2_FileExists(file))
        
DOF2_SetInt(file"ModelID"VehicleInfo[v][ModelID]);
        
DOF2_SetString(file"Owner"VehicleInfo[v][Owner]);
        
DOF2_SetString(file"NrPlate"VehicleInfo[v][NrPlate]);
        
DOF2_SetFloat(file"Position X"VehicleInfo[v][posX]);
        
DOF2_SetFloat(file"Position Y"VehicleInfo[v][posY]);
        
DOF2_SetFloat(file"Position Z"VehicleInfo[v][posZ]);
        
DOF2_SetFloat(file"Position A"VehicleInfo[v][posA]);
        
DOF2_SetInt(file"ColorA"VehicleInfo[v][ColorA]);
        
DOF2_SetInt(file"ColorB"VehicleInfo[v][ColorB]);
        
DOF2_SetInt(file"Locked"VehicleInfo[v][Locked]);
        
DOF2_SetInt(file"Faction"VehicleInfo[v][Faction]);
        
DOF2_SaveFile();
    }
    return 
1;

PHP код:
stock CreatePlayerVehicle(playeridmodel)
{
    new 
file[64], playercarv;
    
playercar CreateVehicle(model, -156.0357,1181.0258,19.3808,179.2710random(5), random(5), -1);
    
PutPlayerInVehicle(playeridplayercar0);
    
VehicleInfo[playercar][ModelID] = model;
    
VehicleInfo[playercar][NrPlate] = "BB-0000";
    
format(VehicleInfo[playercar][Owner], 100"%s"RPName(playerid));
    
VehicleInfo[playercar][posX] = -156.0357;
    
VehicleInfo[playercar][posY] = 1181.0258;
    
VehicleInfo[playercar][posZ] = 19.3808;
    
VehicleInfo[playercar][posA] = 179.2710;
    
VehicleInfo[playercar][ColorA] = random(5);
    
VehicleInfo[playercar][ColorB] = random(5);
    
VehicleInfo[playercar][Locked] = 1;
    
VehicleInfo[playercar][Faction] = 0;
    
format(file64CARROSv);
    if(!
DOF2_FileExists(file)) DOF2_CreateFile(file);
    {
        
DOF2_SetInt(file"ModelID"VehicleInfo[v][ModelID]);
        
DOF2_SetString(file"Owner"VehicleInfo[v][Owner]);
        
DOF2_SetString(file"NrPlate"VehicleInfo[v][NrPlate]);
        
DOF2_SetFloat(file"Position X"VehicleInfo[v][posX]);
        
DOF2_SetFloat(file"Position Y"VehicleInfo[v][posY]);
        
DOF2_SetFloat(file"Position Z"VehicleInfo[v][posZ]);
        
DOF2_SetFloat(file"Position A"VehicleInfo[v][posA]);
        
DOF2_SetInt(file"ColorA"VehicleInfo[v][ColorA]);
        
DOF2_SetInt(file"ColorB"VehicleInfo[v][ColorB]);
        
DOF2_SetInt(file"Locked"VehicleInfo[v][Locked]);
        
DOF2_SetInt(file"Faction"VehicleInfo[v][Faction]);
        
        
DOF2_SaveFile();
    }
    
PlayerInfo[playerid][VehicleOwner] = playercar;
    return 
1;

Reply


Messages In This Thread
Concessionaria - by FernandoDutra - 30.06.2016, 16:52
Re: Concessionaria - by Cleyson - 30.06.2016, 16:59
Re: Concessionaria - by FernandoDutra - 30.06.2016, 17:02
Re: Concessionaria - by Cleyson - 30.06.2016, 19:10
Re: Concessionaria - by Whoo - 30.06.2016, 19:48
Respuesta: Re: Concessionaria - by SammyJ - 01.07.2016, 02:14

Forum Jump:


Users browsing this thread: 2 Guest(s)