[+REP]Help (SetVehicleNumberPlate)
#1

There appears to me to car number plate.
PHP код:
enum vehicleE {
    
vVehicleModelID,
    
FloatvVehiclePosition[3],
    
FloatvVehicleRotation,
    
vVehicleGroup,
    
vVehicleJob,
    
vVehicleGroupRank,
    
vVehicleColour[2],
    
vVehicleScriptID,
    
vVehicleNumber,

PHP код:
public IniVehs()
{
    new 
Cacheresult5 mysql_query (handle"SELECT * FROM `vehicles` ORDER BY `vehicles`.`vehicleID` ASC");
    
    new 
success 1;
     
     for ( new 
icache_get_row_count ( ); != j; ++)
    {
        new 
xstringcar[256];
        
cache_get_field_content(i"vehicleID"result); strval(result);
        if(
systemVariables[vehicleCounts][0] + systemVariables[vehicleCounts][1] + systemVariables[vehicleCounts][2] < MAX_VEHICLES
        {
            
cache_get_field_content(i"vehicleModelID"result); vehicleVariables[x][vVehicleModelID] = strval(result);
            
cache_get_field_content(i"vehiclePosX"result); vehicleVariables[x][vVehiclePosition][0] = floatstr(result);
            
cache_get_field_content(i"vehiclePosY"result); vehicleVariables[x][vVehiclePosition][1] = floatstr(result);
            
cache_get_field_content(i"vehiclePosZ"result); vehicleVariables[x][vVehiclePosition][2] = floatstr(result);
            
cache_get_field_content(i"vehiclePosRotation"result); vehicleVariables[x][vVehicleRotation] = floatstr(result);
            
cache_get_field_content(i"vehicleGroup"result); vehicleVariables[x][vVehicleGroup] = strval(result);    
            
cache_get_field_content(i"vehicleGroupRank"result); vehicleVariables[x][vVehicleGroupRank] = strval(result);
            
cache_get_field_content(i"vehicleJob"result); vehicleVariables[x][vVehicleJob] = strval(result);    
            
cache_get_field_content(i"vehicleCol1"result); vehicleVariables[x][vVehicleColour][0] = strval(result);
            
cache_get_field_content(i"vehicleCol2"result); vehicleVariables[x][vVehicleColour][1] = strval(result);
            
cache_get_field_content(i"vehicleNumberPlate"result); vehicleVariables[x][vVehicleNumber] = strval(result);
            
            if(
vehicleVariables[x][vVehicleColour][0] < 0) {
                
vehicleVariables[x][vVehicleColour][0] = random(126);
            }
            if(
vehicleVariables[x][vVehicleColour][1] < 0) {
                
vehicleVariables[x][vVehicleColour][1] = random(126);
            }
            
format(stringcar256"Group %d",vehicleVariables[x][vVehicleGroup]);
            
vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 300);
            if(
vehicleVariables[x][vVehicleGroup] >= 1)
            {
                
SetVehicleNumberPlate(xstringcar);
            }
            
systemVariables[vehicleCounts][0]++;
        }
        else 
        {
            
success 0;
            
printf("ERROR: Vehicle limit reached (MODEL %d, VEHICLEID %d, MAXIMUM %d, TYPE STATIC) [01x08]"vehicleVariables[x][vVehicleModelID], xMAX_VEHICLES);
        }
    }
    
cache_delete(result5);
    if(
successprintf("[script] %d vehicles loaded."systemVariables[vehicleCounts][0]);
    return 
1;

Database line
PHP код:
`vehicleNumberPlatevarchar(255NOT NULL DEFAULT 'TEST' 
Reply


Messages In This Thread
[+REP]Help (SetVehicleNumberPlate) - by Andrei04072 - 27.08.2015, 19:23
Re: [+REP]Help (SetVehicleNumberPlate) - by jlalt - 27.08.2015, 19:35
Re: [+REP]Help (SetVehicleNumberPlate) - by Logofero - 27.08.2015, 19:41
Re: [+REP]Help (SetVehicleNumberPlate) - by Andrei04072 - 27.08.2015, 19:42
Re: [+REP]Help (SetVehicleNumberPlate) - by Andrei04072 - 27.08.2015, 19:49
Re: [+REP]Help (SetVehicleNumberPlate) - by Andrei04072 - 27.08.2015, 19:51
Re: [+REP]Help (SetVehicleNumberPlate) - by Andrei04072 - 27.08.2015, 20:24
Re: [+REP]Help (SetVehicleNumberPlate) - by Logofero - 28.08.2015, 02:20

Forum Jump:


Users browsing this thread: 2 Guest(s)