addsiren 0.3.7 help
#1

PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128];
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
       new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0);
       if(!
IsACar(model)) {
        
VehicleInfo[carid][EVEngine] = 1;
    } else {
        
VehicleInfo[carid][EVEngine] = 0;
    }
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(carid,VehicleInfo[carid][EVEngine],lights,alarm,doors,bonnet,boot,objective);
    
VehicleInfo[carid][EVToDelete] = 0;
    
VehicleInfo[carid][EVOwner] = factionid;
    
VehicleInfo[carid][EVColour][0] = c1;
    
VehicleInfo[carid][EVColour][1] = c2;
    
VehicleInfo[carid][EVFuel] = 100;
    
VehicleInfo[carid][EVRadioStation] = -1;
    
VehicleInfo[carid][EVLockType] = ELockType_Default;
    
VehicleInfo[carid][EVSQLID] = id;
    
VehicleInfo[carid][EVType] = EVehicleType_Faction;
    if(
getFactionType(VehicleInfo[carid][EVOwner]) != EFactionType_Hitman) {
        
SetVehicleNumberPlate(caridGetFactionName(factionid));
    }
    
SetVehicleStation(carid0);

If I change the addsiren in the end to 1 all of the faction vehicles get the police siren as horn.. I want to restrict it to only faction ID 1 which is LSPD.. is it possible?
Reply
#2

Just add a parameter for sirens and assign it to faction ID 1 only when you make it.
Reply
#3

PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128];
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
        if(
factionid == 1)
       { 
          new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,1); 
      }
       else 
      { 
          new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0); 
      }

I think is how you do it...
Reply
#4

Quote:
Originally Posted by pepetorres194
Посмотреть сообщение
PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128];
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
        if(
factionid == 1)
       { 
          new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,1); 
      }
       else 
      { 
          new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0); 
      }

I think is how you do it...
My fault, let me give you full public oncreatefactioncar.. this way I get carid error


PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128];
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
       new 
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0);
       if(!
IsACar(model)) {
        
VehicleInfo[carid][EVEngine] = 1;
    } else {
        
VehicleInfo[carid][EVEngine] = 0;
    }
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(carid,VehicleInfo[carid][EVEngine],lights,alarm,doors,bonnet,boot,objective);
    
VehicleInfo[carid][EVToDelete] = 0;
    
VehicleInfo[carid][EVOwner] = factionid;
    
VehicleInfo[carid][EVColour][0] = c1;
    
VehicleInfo[carid][EVColour][1] = c2;
    
VehicleInfo[carid][EVFuel] = 100;
    
VehicleInfo[carid][EVRadioStation] = -1;
    
VehicleInfo[carid][EVLockType] = ELockType_Default;
    
VehicleInfo[carid][EVSQLID] = id;
    
VehicleInfo[carid][EVType] = EVehicleType_Faction;
    if(
getFactionType(VehicleInfo[carid][EVOwner]) != EFactionType_Hitman) {
        
SetVehicleNumberPlate(caridGetFactionName(factionid));
    }
    
SetVehicleStation(carid0);

Reply
#5

PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128],carid;
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
      if(
factionid == 1)
      {
       
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,1);
       } else {  
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0);}
       if(!
IsACar(model)) {
        
VehicleInfo[carid][EVEngine] = 1;
    } else {
        
VehicleInfo[carid][EVEngine] = 0;
    }
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(carid,VehicleInfo[carid][EVEngine],lights,alarm,doors,bonnet,boot,objective);
    
VehicleInfo[carid][EVToDelete] = 0;
    
VehicleInfo[carid][EVOwner] = factionid;
    
VehicleInfo[carid][EVColour][0] = c1;
    
VehicleInfo[carid][EVColour][1] = c2;
    
VehicleInfo[carid][EVFuel] = 100;
    
VehicleInfo[carid][EVRadioStation] = -1;
    
VehicleInfo[carid][EVLockType] = ELockType_Default;
    
VehicleInfo[carid][EVSQLID] = id;
    
VehicleInfo[carid][EVType] = EVehicleType_Faction;
    if(
getFactionType(VehicleInfo[carid][EVOwner]) != EFactionType_Hitman) {
        
SetVehicleNumberPlate(caridGetFactionName(factionid));
    }
    
SetVehicleStation(carid0);

Same as that guy said, It can be done by this thing..
Reply
#6

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
PHP код:
public onCreateFactionVehicle(factionidmodelFloat:XFloat:YFloat:ZFloat:Anglec1c2) {
    new 
id mysql_insert_id();
    new 
msg[128],carid;
    
format(msgsizeof(msg), "* Faction Vehicle SQL ID: %d"id);
    
ABroadcast(X11_YELLOWmsgEAdminFlags_FactionAdmin);
      if(
factionid == 1)
      {
       
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,1);
       } else {  
carid CreateVehicle(model,X,Y,Z,Angle,c1,c2,DEF_RESPAWN_DELAY,0);}
       if(!
IsACar(model)) {
        
VehicleInfo[carid][EVEngine] = 1;
    } else {
        
VehicleInfo[carid][EVEngine] = 0;
    }
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    
GetVehicleParamsEx(carid,engine,lights,alarm,doors,bonnet,boot,objective);
    
SetVehicleParamsEx(carid,VehicleInfo[carid][EVEngine],lights,alarm,doors,bonnet,boot,objective);
    
VehicleInfo[carid][EVToDelete] = 0;
    
VehicleInfo[carid][EVOwner] = factionid;
    
VehicleInfo[carid][EVColour][0] = c1;
    
VehicleInfo[carid][EVColour][1] = c2;
    
VehicleInfo[carid][EVFuel] = 100;
    
VehicleInfo[carid][EVRadioStation] = -1;
    
VehicleInfo[carid][EVLockType] = ELockType_Default;
    
VehicleInfo[carid][EVSQLID] = id;
    
VehicleInfo[carid][EVType] = EVehicleType_Faction;
    if(
getFactionType(VehicleInfo[carid][EVOwner]) != EFactionType_Hitman) {
        
SetVehicleNumberPlate(caridGetFactionName(factionid));
    }
    
SetVehicleStation(carid0);

Same as that guy said, It can be done by this thing..
Thanks both of you, fixed +REP
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)