SA-MP Forums Archive
addsiren 0.3.7 help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: addsiren 0.3.7 help (/showthread.php?tid=640993)



addsiren 0.3.7 help - Puff - 09.09.2017

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?


Re: addsiren 0.3.7 help - Kane - 09.09.2017

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


Re: addsiren 0.3.7 help - pepetorres194 - 09.09.2017

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...


Re: addsiren 0.3.7 help - Puff - 10.09.2017

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);




Re: addsiren 0.3.7 help - FuNkYTheGreat - 10.09.2017

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..


Re: addsiren 0.3.7 help - Puff - 10.09.2017

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