SA-MP Forums Archive
[FilterScript] 0.3.7 Siren command - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] 0.3.7 Siren command (/showthread.php?tid=573271)



0.3.7 Siren command - benjaminjones - 06.05.2015

Hello there people. I received a request to create a siren command with the object of 0.3.7 version and here it is. It is not very customized because I wanted it to be as simple as possible. If you need help with adding it to your script, just reply below.
pawn Код:
CMD:siren(playerid, params[])
{
        if (GetFactionType(playerid) != POLICE) // Only members of the PD are able to use the cmmand.
        return SendErrorMessage(playerid, "You are not memebr of the Police Department");
       
        if (!IsADetectiveVehicle(GetPlayerVehicleID(playerid))) // Using the stock below.
        return SendErrorMessage(playerid, "You are not inside a detective vehicle.");
        new objectid = CreateObject(19620, 0, 0, 0, 0, 0, 0);
        AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.854999, 0.000000, 0.000000, 0.000000);
        SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s places a siren on their vehicle and turns it on.", ReturnName(playerid, 0));
        return 1;
}
pawn Код:
stock IsADetectiveVehicle(vehicleid)
{
    switch (GetVehicleModel(vehicleid)) {
        case 560, 426, 507, 490: return 1; // If you want more cars to use the siren, just add their IDs here.
    }
    return 0;
}
SCREENS





Re: 0.3.7 Siren command - benjaminjones - 06.05.2015

Added pastebin link for those who prefer to use it: http://pastebin.com/AZk7zQbD


Re: 0.3.7 Siren command - LMaxCo - 06.05.2015

Simple but very good
Good Job


Re: 0.3.7 Siren command - X337 - 07.05.2015

Is it automatically detected the coordinate of every vehicles to attach the sirens?
I see it's just attaching siren with same coordinate for every vehicles.
Код:
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.854999, 0.000000, 0.000000, 0.000000);
What will be happen if i attach the siren to a monster truck mate?
*Sorry for my bad english.


Re: 0.3.7 Siren command - benjaminjones - 07.05.2015

Quote:
Originally Posted by bondowocopz
Посмотреть сообщение
Is it automatically detected the coordinate of every vehicles to attach the sirens?
I see it's just attaching siren with same coordinate for every vehicles.
Код:
AttachObjectToVehicle(objectid, GetPlayerVehicleID(playerid), 0.009999, -0.019999, 0.854999, 0.000000, 0.000000, 0.000000);
What will be happen if i attach the siren to a monster truck mate?
*Sorry for my bad english.
pawn Код:
stock IsADetectiveVehicle(vehicleid)
{
    switch (GetVehicleModel(vehicleid)) {
        case 560, 426, 507, 490: return 1; // If you want more cars to use the siren, just add their IDs here.
    }
    return 0;
}
As you can see from this, the siren is available for IsADetectiveVehicle. Vehicle with IDs: 560, 426, 507, 490. It is not a problem more to be added.