Police car sirens - 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: Police car sirens (
/showthread.php?tid=308111)
Police car sirens -
Yako - 02.01.2012
Hello, maybe somebody knows bug with police car. I am creating gamemode from scratch and when I enter police car and turn on the sirens it doesn't glowing, the police light object also not glowing, it's glowing only when you are in tunning shop. But when I copy my code of police light attaching to another gamemode everything okay.
Re: Police car sirens -
silvan - 02.01.2012
erm no its like that in default that they glow only during night / evening time.
Re: Police car sirens -
Yako - 02.01.2012
Any solution for that?
Re: Police car sirens -
vincee - 02.01.2012
You have to have SetWeather(2); thats the only way it works and
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_SUBMISSION) && !(oldkeys & KEY_SUBMISSION)) && IsPlayerInAnyVehicle(playerid))
{
if(!pLightStatus[playerid])
{
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Emergency lighting activated.");
pLightObject[playerid] = CreateObject(18646, 0, 0, 0, 0, 0, 0);
AttachObjectToVehicle(pLightObject[playerid], GetPlayerVehicleID(playerid), -0.34, -0.17, 0.89, -2.00, 0.00, 4.00);
pLightStatus[playerid] = true;
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Emergency lighting de-activated.");
DestroyObject(pLightObject[playerid]);
pLightStatus[playerid] = false;
}
}
return 1;
}
pawn Код:
new bool:pLightStatus[MAX_PLAYERS];//global variable
new pLightObject[MAX_PLAYERS];//global variable
Press 2 for the light
Re: Police car sirens -
Yako - 02.01.2012
Okay, I'll try it soon and post the result here
Re: Police car sirens -
Yako - 03.01.2012
Thanks for vincee

Everything works fine.