PDA

View Full Version : Flashing Neon


Avery
01/01/2012, 04:27 PM
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.

Avery
02/01/2012, 07:48 PM
Bump^^

Norck
02/01/2012, 08:38 PM
You can try to attach/detach neon objects, I don't see any other way to do it.

Avery
03/01/2012, 11:16 PM
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?

Basssiiie
03/01/2012, 11:19 PM
Yeah, like Norck says, just be removing the light objects and then reattach them a second later. ;)

Avery
04/01/2012, 02:52 AM
Thank you both! I will figure a way to script it myself. +rep for both!

Tanush123
04/01/2012, 06:02 AM
You could try creating 2 timers, top
new togneon[MAX_PLAYERS];
forward togneonoff(playerid);
forward togneonon(playerid);
onplayerconnect

SetTimerEx("togneonon",1000,0,"i",playerid);
command

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

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

Tamao_Serizawa
04/01/2012, 11:38 AM
lol..u must have a rep to give an Rep but yea what Norck say it correct attach it

Avery
04/01/2012, 06:28 PM
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!
You could try creating 2 timers, top
new togneon[MAX_PLAYERS];
forward togneonoff(playerid);
forward togneonon(playerid);
onplayerconnect

SetTimerEx("togneonon",1000,0,"i",playerid);
command

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

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!