help +REP
#1

this is up: http://prntscr.com/7p2nvp

OnPCText:http://prntscr.com/7p2obq

Public:http://prntscr.com/7p2p02

When im adding it i get pawn stop working :/


Thank you very much !
Reply
#2

Lets start with your SetCarDiscOn definition. It starts a timer but only passes one argument to it but on PCarDisco you add a second parameter. It also doesn't store the timer ID anywhere which means you can never stop it and it is a repeating timer!

Why do you want to use a define? A function would make a lot more sense for it:

pawn Код:
new DiscoTimer[ MAX_VEHICLES ], bool:Disco[ MAX_VEHICLES ]; // a global variable.

TurnCarDiscOn(playerid, vehicleid, message[])
{
     SendClientMessage(playerid, green, message);
     Disco[ vehicleid ] = true;
     DiscoTimer[ vehicleid ] = SetTimerEx("PCarDisco", 200, 1, "i", vehicleid);
}
TurnCarDiscOff(playerid, vehicleid, message[])
{
     SendClientMessage(playerid, green, message);
     Disco[ vehicleid ] = false;
     KillTimer(DiscoTimer[ vehicleid ]);
}
forward PCarDisco(vehicleid);
public PCarDisco(vehicleid)
{
     if(Disco[ vehicleid ] == true)
     {
          // change the colour.
     }
}
I also changed the Disco array. I used vehicleid for its index... Its still not quite right. The TurnCarDiscOn/Off shouldn't even need a playerid argument...
Reply
#3

thanks bro I will try this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)