SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 06/05/2015, 05:42 AM   #1
benjaminjones
Huge Clucker
 
Join Date: Sep 2012
Posts: 448
Reputation: 80
Default 0.3.7 Siren command

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 Code:
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 Code:
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


benjaminjones is offline   Reply With Quote
Old 06/05/2015, 05:48 AM   #2
benjaminjones
Huge Clucker
 
Join Date: Sep 2012
Posts: 448
Reputation: 80
Default Re: 0.3.7 Siren command

Added pastebin link for those who prefer to use it: http://pastebin.com/AZk7zQbD
benjaminjones is offline   Reply With Quote
Old 06/05/2015, 06:59 AM   #3
LMaxCo
Big Clucker
 
Join Date: Dec 2014
Location: Indonesia
Posts: 153
Reputation: 11
Default Re: 0.3.7 Siren command

Simple but very good
Good Job
LMaxCo is offline   Reply With Quote
Old 07/05/2015, 02:35 AM   #4
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 878
Reputation: 291
Default Re: 0.3.7 Siren command

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.
Code:
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.
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 07/05/2015, 03:36 AM   #5
benjaminjones
Huge Clucker
 
Join Date: Sep 2012
Posts: 448
Reputation: 80
Default Re: 0.3.7 Siren command

Quote:
Originally Posted by bondowocopz View Post
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.
Code:
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 Code:
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.
benjaminjones is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Siren command Lajko1 Scripting Help 26 04/11/2013 08:22 PM
/siren command, won't work Gecko75 Scripting Help 1 05/09/2013 07:49 AM
Siren command is defective lramos15 Scripting Help 2 06/06/2013 10:37 PM
Siren on my server command. SAM the MAN Server Support 5 12/07/2012 03:08 PM
My /siren command Mr.McGuire Scripting Help 2 26/02/2012 03:11 PM


All times are GMT. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.