How to block vehicle slot 14?
#1

My script has a problem

if veh id is 14 it will display the trunk object even its a bike


PHP код:
stock LoadCarIDObjects(key) {
    if(!
IsNotAEngineCar(key))
    {
        if(!
IsHelmetCar(key) && !IsBike(key))
        {
            new 
item[6], Float:xFloat:yFloat:zcount 0;
            if(
VehicleInfo[key][vType] == VEHICLE_PERSONAL && IsTrunkCar(GetVehicleModel(key)))
            {
                
GetVehicleModelInfo(GetVehicleModel(key), 6xyz);
                
item[1]=VehicleInfo[key][vInvID][1], item[2]=VehicleInfo[key][vInvID][2];
                
item[3]=VehicleInfo[key][vInvID][3], item[4]=VehicleInfo[key][vInvID][4];
                
item[5]=VehicleInfo[key][vInvID][5];
                
forEx(new 16i++)
                {
                    if(
VehicleInfo[key][cObject][i] > 0)
                    {
                        if(
IsValidDynamicObject(VehicleInfo[key][cObject][i])) { DestroyDynamicObject(VehicleInfo[key][cObject][i]); }
                        
VehicleInfo[key][cObject][i] = 0;
                    }
                    if(
item[i] > 0)
                    {
                        if(
TrunkObject(item[i], 1))
                        {
                            
count++;
                        }
                    }
                }
                if(
count 0)
                {
                    
forEx(new 16i++)
                    {
                        if(
item[i] > 0)
                        {
                            if(
TrunkObject(item[i], 1))
                            {
                                
VehicleInfo[key][cObject][i]=CreateDynamicObject(TrunkObject(item[i], 2), xyz0.00.00.0GetVehicleVirtualWorld(key));
                                new 
Float:offset 0.0Float:offset2 0.0;
                                switch(
count)
                                {
                                    case 
1:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.0offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    case 
2:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    case 
3:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=0.9offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
3: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    case 
4:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=1.0offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
3: { offset=0.7offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
4: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    case 
5:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=1.0offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
3: { offset=0.9offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
4: { offset=0.7offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
5: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    case 
6:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=1.2offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
3: { offset=1.0offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
4: { offset=0.8offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
5: { offset=0.6offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
6: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                        }
                                    }
                                    default:
                                    {
                                        switch(
i)
                                        {
                                            case 
1: { offset=1.5offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
2: { offset=1.4offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
3: { offset=1.2offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
4: { offset=1.0offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
5: { offset=0.8offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
6: { offset=0.6offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                            case 
7: { offset=0.4offset2=TrunkOffset(GetVehicleModel(key), 1); }
                                            case 
8: { offset=0.2offset2=TrunkOffset(GetVehicleModel(key), 1)-0.1; }
                                        }
                                    }
                                }
                                
AttachDynamicObjectToVehicle(VehicleInfo[key][cObject][i], keyx-offsety-offset2z+TrunkOffset(GetVehicleModel(key), 2), 0.0+TrunkObject(item[i], 3), 0.00.0+90.0);
                            }
                        }
                    }
                }
            }
        }
    }
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)