Flashing Neon - 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: Flashing Neon (
/showthread.php?tid=307915)
Flashing Neon -
Avery - 01.01.2012
Hello everyone. This is my first post on here, so I hope it's in the correct section.
I just wanted to know if it is possible to create flashing neon lights on vehicles. I wanted to make flashing neon lights on fire trucks as sort of a "built in" ELM. A player could turn these lights on using a command such as /elm or /elights.
Thank you in advance for the help. Will add to your rep if your reply helped me.
Re: Flashing Neon -
Avery - 02.01.2012
Bump^^
Re: Flashing Neon -
Norck - 02.01.2012
You can try to attach/detach neon objects, I don't see any other way to do it.
Re: Flashing Neon -
Avery - 03.01.2012
Quote:
Originally Posted by Norck
You can try to attach/detach neon objects, I don't see any other way to do it.
|
But is there anyway to make those neon objects flash?
Re: Flashing Neon -
Basssiiie - 03.01.2012
Yeah, like Norck says, just be removing the light objects and then reattach them a second later.
Re: Flashing Neon -
Avery - 04.01.2012
Thank you both! I will figure a way to script it myself. +rep for both!
Re: Flashing Neon -
Tanush123 - 04.01.2012
You could try creating 2 timers, top
pawn Код:
new togneon[MAX_PLAYERS];
forward togneonoff(playerid);
forward togneonon(playerid);
onplayerconnect
pawn Код:
SetTimerEx("togneonon",1000,0,"i",playerid);
command
pawn Код:
CMD:neon(playerid,params[])
{
if(togneon[playerid] == 0)
{
togneon[playerid] = 1;
SendClientMessage(playerid,-1,"You enabled flashing neon.");
}
else if(togneon[playerid] == 1)
{
togneon[playerid] = 0;
SendClientMessage(playerid,-1,"You disabled flashing neon.");
}
return 1;
}
bottom
pawn Код:
public togneonon(playerid)
{
if(togneon[playerid] == 1)
{
KillTimerEx("togneonon");
SetTimerEx("togneonoff",1000,0,"i",playerid);
//code for removing neon
}
return 1;
}
public togneonoff(playerid)
{
if(togneon[playerid] == 1)
{
KillTimerEx("togneonoff");
SetTimerEx("togneonon",1000,0,"i",playerid);
//code for adding neon
}
return 1;
}
didnt tested but try
Re: Flashing Neon -
Tamao_Serizawa - 04.01.2012
lol..u must have a rep to give an Rep but yea what Norck say it correct attach it
Re: Flashing Neon -
Avery - 04.01.2012
Quote:
Originally Posted by Tamao_Serizawa
lol..u must have a rep to give an Rep but yea what Norck say it correct attach it
|
Lol. News to me. Anyway, thanks for your time!
Quote:
Originally Posted by Tanush123
You could try creating 2 timers, top
pawn Код:
new togneon[MAX_PLAYERS]; forward togneonoff(playerid); forward togneonon(playerid);
onplayerconnect
pawn Код:
SetTimerEx("togneonon",1000,0,"i",playerid);
command
pawn Код:
CMD:neon(playerid,params[]) { if(togneon[playerid] == 0) { togneon[playerid] = 1; SendClientMessage(playerid,-1,"You enabled flashing neon."); } else if(togneon[playerid] == 1) { togneon[playerid] = 0; SendClientMessage(playerid,-1,"You disabled flashing neon."); } return 1; }
bottom
pawn Код:
public togneonon(playerid) { if(togneon[playerid] == 1) { KillTimerEx("togneonon"); SetTimerEx("togneonoff",1000,0,"i",playerid); //code for removing neon } return 1; } public togneonoff(playerid) { if(togneon[playerid] == 1) { KillTimerEx("togneonoff"); SetTimerEx("togneonon",1000,0,"i",playerid); //code for adding neon } return 1; }
didnt tested but try 
|
Wow! Thank you so much! I will test it! If I could +rep I would give u some!