04.11.2013, 18:47
Can anyone script me flashing traffic advisor like in this video
[ame]http://www.youtube.com/watch?v=vcLZLTJ2_I8[/ame]
[ame]http://www.youtube.com/watch?v=vcLZLTJ2_I8[/ame]
pawn Код:
CMD:tdl(playerid, params[])
{
new veh, type[8], string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LAPD Oficer/FBI Agent.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not driving a vehicle.");
if(sscanf(params, "s[8]", type))
{
SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /siren [position]");
SendClientMessage(playerid, COLOR_WHITE, "POSITIONS: inside | roof | off");
return 1;
}
if(Siren[veh]) return SendClientMessage(playerid, COLOR_GREY, "This vehicle already has a siren attached.");
veh = GetPlayerVehicleID(playerid);
if(!strcmp(type, "inside"))
{
if(Siren[veh]) return SendClientMessage(playerid, COLOR_GREY, "There is already a siren attached to this vehicle.");
Siren[veh] = 1;
SirenObject[veh] = CreateDynamicObject(19294, 10.0, 10.0, 10.0, 0, 0, 0);
AttachDynamicObjectToVehicle(SirenObject[veh],veh, 0.0, 0.75, 0.275, 0.0, 0.1, 0.0);
format(string, sizeof(string), "* %s attaches a siren to the dashboard.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
else if(!strcmp(type, "roof"))
{
if(Siren[veh]) return SendClientMessage(playerid, COLOR_GREY, "There is already a siren attached to this vehicle.");
Siren[veh] = 2;
SirenObject[veh] = CreateDynamicObject(18646, 10.0, 10.0, 10.0, 0, 0, 0);
AttachDynamicObjectToVehicle(SirenObject[veh], veh, -0.43, 0.0, 0.785, 0.0, 0.1, 0.0);
format(string, sizeof(string), "* %s attaches a siren to the vehicle's roof.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
else if(!strcmp(type, "off"))
{
if(!Siren[veh]) return SendClientMessage(playerid, COLOR_GREY, "There is no siren attached to this vehicle.");
Siren[veh] = 0;
DestroyDynamicObject(SirenObject[veh]);
format(string, sizeof(string), "* %s takes the siren back down.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
return 1;
}
return 1;
}