it isn't loaded 255 vehicle
#1

Actually in what a problem:
If just to start the server - The vehicle is loaded from is database, but it doesn't spawn 255 vehicle.
1...254 is spawned, 255 doesn't spawn, 256...306 spawned.
If to reboot /rcon gmx - that 255 vehicle is spawned.
In what there can be a problem?
P.S CreateVehicle I tried, but hasn't helped

PHP Code:
enum tcarInfo
{
    
orgcID,
    
orgcFrac,
    
orgcRank,
    
orgcCity,
    
orgcModel,
    
Float:orgCarPos[4],
    
orgcColor1,
    
orgcColor2,
    
orgcInt,
    
orgcWorld,
    
Text3D:orgcNumber,
    
Text3D:orgcText,
    
orgcNumberColor,
    
orgcCar,
    
Float:orgcFuel,
    
bool:orgLightOnOff,
    
orgpLight,
    
Float:orgpMilage,
    
orgcLock,
    
bool:orgcMax,
    
orgcMaxSpeed,
    
orgcName[50], 
    
orgSiren
}
new 
OrgCarInfo[MAX_VEHICLES][tcarInfo]; 
PHP Code:
LoadOrgCar()
{
    new 
rows;
    
cache_get_row_count(rows);
    new 
string2[30];
    for(new 
idx 1idx <= rowsidx++)
    {
        if(
idx MAXORGCAR) break;
        
cache_get_value_name_int(idx-1,"ID",OrgCarInfo[idx][orgcID]);
        
cache_get_value_name_int(idx-1,"Frac",OrgCarInfo[idx][orgcFrac]);
        
cache_get_value_name_int(idx-1,"Rank",OrgCarInfo[idx][orgcRank]);
        
cache_get_value_name_int(idx-1,"City",OrgCarInfo[idx][orgcCity]);
        
cache_get_value_name_int(idx-1,"Model",OrgCarInfo[idx][orgcModel]);
        
cache_get_value_name_float(idx-1,"posX",OrgCarInfo[idx][orgCarPos][0]);
        
cache_get_value_name_float(idx-1,"posY",OrgCarInfo[idx][orgCarPos][1]);
        
cache_get_value_name_float(idx-1,"posZ",OrgCarInfo[idx][orgCarPos][2]);
        
cache_get_value_name_float(idx-1,"posA",OrgCarInfo[idx][orgCarPos][3]);
        
cache_get_value_name_int(idx-1,"Color1",OrgCarInfo[idx][orgcColor1]);
         
cache_get_value_name_int(idx-1,"Color2",OrgCarInfo[idx][orgcColor2]);
        
cache_get_value_name_int(idx-1,"Int",OrgCarInfo[idx][orgcInt]);
        
cache_get_value_name_int(idx-1,"World",OrgCarInfo[idx][orgcWorld]);
        
cache_get_value_name_int(idx-1,"Siren",OrgCarInfo[idx][orgSiren]);
        
OrgCarInfo[idx][orgcNumberColor] = FracColors[OrgCarInfo[idx][orgcFrac]];
        
OrgCarInfo[idx][orgcCar] = P_AddStaticVehicleEx(OrgCarInfo[idx][orgcModel],OrgCarInfo[idx][orgCarPos][0],OrgCarInfo[idx][orgCarPos][1],OrgCarInfo[idx][orgCarPos][2],OrgCarInfo[idx][orgCarPos][3],
            
OrgCarInfo[idx][orgcColor1],OrgCarInfo[idx][orgcColor2],1800,OrgCarInfo[idx][orgSiren],0);
        
//printf(" * idx = %d            orgcCar = %d    ",idx,OrgCarInfo[idx][orgcCar]);
        
new tmpobjid;
        if(
OrgCarInfo[idx][orgcModel] == 498)
        {
            
tmpobjid CreateDynamicObject(19420,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], 0.0002.0312.0090.0000.0000.000);
            
tmpobjid CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterialText(tmpobjid0"S.W.A.T"130"Ariel"801, -101);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], 1.261, -1.0001.2500.0000.0000.000);
            
tmpobjid CreateDynamicObject(19482,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterialText(tmpobjid0"S.W.A.T"130"Ariel"801, -101);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], -1.261, -1.0311.3000.0000.000179.900);
            
tmpobjid CreateDynamicObject(2937,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterial(tmpobjid018996"mattextures""sampblack"0);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], 1.144, -1.441, -0.3960.000, -91.1990.000);
            
tmpobjid CreateDynamicObject(2937,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterial(tmpobjid018996"mattextures""sampblack"0);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], -1.114, -1.441, -0.3970.00091.1990.000);
        }
        if(
OrgCarInfo[idx][orgcModel] == 552)
        {
            
tmpobjid CreateDynamicObject(11702,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], 0.0000.5501.3900.0000.0000.000);
            
tmpobjid CreateDynamicObject(19483,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterialText(tmpobjid0"FIRE DEPT"130"Ariel"351, -101);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], 1.261, -2.5120.5400.0000.0000.000);
            
tmpobjid CreateDynamicObject(19483,0.0,0.0,-1000.0,0.0,0.0,0.0,-1,-1,-1,300.0,300.0);
            
SetDynamicObjectMaterialText(tmpobjid0"FIRE DEPT"130"Ariel"351, -101);
            
AttachDynamicObjectToVehicle(tmpobjidOrgCarInfo[idx][orgcCar], -1.261, -2.5120.5400.0000.000179.399);
        }
        
//OnVehicleSpawn(OrgCarInfo[idx][orgcCar]);
        
if(OrgCarInfo[idx][orgcInt] > 0LinkVehicleToInterior(OrgCarInfo[idx][orgcCar],OrgCarInfo[idx][orgcInt]);
        if(
OrgCarInfo[idx][orgcWorld] > 0SetVehicleVirtualWorld(OrgCarInfo[idx][orgcCar],OrgCarInfo[idx][orgcWorld]);
        switch(
OrgCarInfo[idx][orgcCity])
        {
            case 
1format(string2,sizeof(string2),"[LA%dUS]",idx);
            case 
2format(string2,sizeof(string2),"[SF%dUS]",idx);
            case 
3format(string2,sizeof(string2),"[LV%dUS]",idx);
            case 
4format(string2,sizeof(string2),"[CA%dUS]",idx);
        }
        
SetVehicleNumberPlate(OrgCarInfo[idx][orgcCar],string2);
        
OrgCarInfo[idx][orgcNumber] = CreateDynamic3DTextLabel(string2,0xAFAFAF90,0,0,0.0,15.0,INVALID_PLAYER_ID,OrgCarInfo[idx][orgcCar],1);
        if(
OrgCarInfo[idx][orgcFrac] == 15)
        {
            
format(string2,sizeof(string2),"%s",OrgInfo[OrgCarInfo[idx][orgcFrac]][orgName]);
            
OrgCarInfo[idx][orgcText] = CreateDynamic3DTextLabel(string2,0xFFA500FF,0,0,1.25,15.0,INVALID_PLAYER_ID,OrgCarInfo[idx][orgcCar],1);
        }
        
Fuel[idx] = VehicleParams[OrgCarInfo[idx][orgcModel]-400][vMaxFuel];
        
Engine[idx] = false;
        
Light[idx] = false;
        
OrgCarInfo[idx][orgLightOnOff] = false;
        
OrgCarInfo[idx][orgpLight] = 0;
        
OrgCarInfo[idx][orgpMilage] = 0;
        
OrgCarInfo[idx][orgcLock] = 0;
        
OrgCarInfo[idx][orgcMax] = false;
        
Door[idx] = OrgCarInfo[idx][orgcLock];
        
TOTALORGCAR idx;
    }
    
printf(" * [Load System] : %d.",TOTALORGCAR);
    return 
true;

PHP Code:
P_AddStaticVehicleEx(model,Float:x,Float:y,Float:z,Float:a,color_1,color_2,spawntime 99999sirenFloat:health 1000.0)
{
    new 
vid AddStaticVehicleEx(modelxyzacolor_1color_2,spawntime,siren);
    if(
health 0ACVehInfo[vid][acVHealth] = health;
    else 
ACVehInfo[vid][acVHealth] = 1000.0;
    return 
vid;

Reply
#2

help guy's
Reply
#3

help guy's
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)