Making command only available on specific vehicle?
#5

You can do it using GetVehicleModel, but use it only if you want all bobcats to be with drug!
So here are the created variables: (just removed coche from them)
PHP код:
new drug1drug2drug3drug4drug5drug6drug7drug8drug9drug10drug11drug12drug13drug14drug15drug16drug17drug18drug19
And here are the commands:
PHP код:
    if(strcmp(cmdtext,"/cargardroga",true)==0)
    {
        
drug1 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug2 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug3 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug4 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug5 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug6 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug7 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug8 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug9 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug10 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug11 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug12 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug13 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug14 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug15 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug16 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug17 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug18 CreateObject(1575,0,0,-1000,0,0,0,100);
        
drug19 CreateObject(1575,0,0,-1000,0,0,0,100);
        for(new 
0<= MAX_VEHICLESv++)
        {
            if(
GetVehicleModel(v) == 422)
            {
                
AttachObjectToVehicle(drug1v, -0.449999,-0.674999,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug2v, -0.449999,-0.974999,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug3v, -0.449999,-0.675000,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug4v, -0.449999,-0.974999,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug5v0.075000,-0.675000,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug6v0.599999,-0.675000,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug7v0.599999,-0.675000,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug8v0.599999,-0.974999,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug9v0.599999,-0.974999,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug10v0.075000,-0.675000,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug11v0.075000,-0.974999,-0.299999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug12v0.075000,-0.974999,-0.149999,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug13v0.075000,-0.600000,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug14v, -0.449999,-0.600000,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug15v0.599999,-0.600000,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug16v0.599999,-0.899999,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug17v0.075000,-0.899999,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug18v, -0.449999,-0.899999,0.000000,0.000000,0.000000,0.000000);
                
AttachObjectToVehicle(drug19v, -0.449999,-1.350000,-0.149999,2.700001,35.100006,0.000000);
            }
        }
        return 
1;
    }
    if(
strcmp(cmdtext,"/descargardroga",true)==0)
    {
        for(new 
0<= MAX_VEHICLESv++)
        {
            if(
GetVehicleModel(v) == 422)
            {
                
DestroyObject(drug1);
                
DestroyObject(drug2);
                
DestroyObject(drug3);
                
DestroyObject(drug4);
                
DestroyObject(drug5);
                
DestroyObject(drug6);
                
DestroyObject(drug7);
                
DestroyObject(drug8);
                
DestroyObject(drug9);
                
DestroyObject(drug10);
                
DestroyObject(drug11);
                
DestroyObject(drug12);
                
DestroyObject(drug13);
                
DestroyObject(drug14);
                
DestroyObject(drug15);
                
DestroyObject(drug16);
                
DestroyObject(drug17);
                
DestroyObject(drug18);
                
DestroyObject(drug19);
            }
        }
        return 
1;
    } 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)