Timer Help
#1

I just wanted to know how I can create a timer, so every 20 seconds... it will add vehicle component to a certain car.

Код:
	new comp = AddVehicleComponent(tsultan,1026),
	AddVehicleComponent(tsultan,1027),
	AddVehicleComponent(tsultan,1028),
	AddVehicleComponent(tsultan,1032),
	AddVehicleComponent(tsultan,1098),
	AddVehicleComponent(tsultan,1010),
	AddVehicleComponent(tsultan,1138),
	AddVehicleComponent(tsultan,1141),
	AddVehicleComponent(tsultan,1169),
	ChangeVehiclePaintjob(tsultan, 0),
	AddVehicleComponent(gelegy, 1035),
	AddVehicleComponent(gelegy, 1037),
	AddVehicleComponent(gelegy, 1039),
	AddVehicleComponent(gelegy, 1046),
	AddVehicleComponent(gelegy, 1048),
	AddVehicleComponent(gelegy, 1172),
	AddVehicleComponent(gelegy, 1096),
	ChangeVehiclePaintjob(gelegy, 1);
I want the component to reload every 20 seconds, please help me
Reply
#2

OnPlayerConnect add
pawn Код:
SetTimerEx("AddMod",20000,true,"i",playerid);
Then at the end of ur pawno add
pawn Код:
forward AddMod(playerid);
public AddMod(playerid)
{
        new comp = AddVehicleComponent(tsultan,1026),
    AddVehicleComponent(tsultan,1027),
    AddVehicleComponent(tsultan,1028),
    AddVehicleComponent(tsultan,1032),
    AddVehicleComponent(tsultan,1098),
    AddVehicleComponent(tsultan,1010),
    AddVehicleComponent(tsultan,1138),
    AddVehicleComponent(tsultan,1141),
    AddVehicleComponent(tsultan,1169),
    ChangeVehiclePaintjob(tsultan, 0),
    AddVehicleComponent(gelegy, 1035),
    AddVehicleComponent(gelegy, 1037),
    AddVehicleComponent(gelegy, 1039),
    AddVehicleComponent(gelegy, 1046),
    AddVehicleComponent(gelegy, 1048),
    AddVehicleComponent(gelegy, 1172),
    AddVehicleComponent(gelegy, 1096),
    ChangeVehiclePaintjob(gelegy, 1);
        return 1;
idk if it would work but try it, i am sure it could
Reply
#3

The end of the script looked like this

Код:
forward AddMod(playerid);
	public AddMod(playerid)
	{
	AddVehicleComponent(tsultan,1026);
	AddVehicleComponent(tsultan,1027);
	AddVehicleComponent(tsultan,1028);
	AddVehicleComponent(tsultan,1032);
    AddVehicleComponent(tsultan,1098);
    AddVehicleComponent(tsultan,1010);
    AddVehicleComponent(tsultan,1138);
    AddVehicleComponent(tsultan,1141);
    AddVehicleComponent(tsultan,1169);
    ChangeVehiclePaintjob(tsultan, 0);
    AddVehicleComponent(gelegy, 1035);
    AddVehicleComponent(gelegy, 1037);
    AddVehicleComponent(gelegy, 1039);
    AddVehicleComponent(gelegy, 1046);
    AddVehicleComponent(gelegy, 1048);
    AddVehicleComponent(gelegy, 1172);
    AddVehicleComponent(gelegy, 1096);
    ChangeVehiclePaintjob(gelegy, 1);
    return 1;
 }
Thanks for your help buddy
Rep +1
Reply
#4

pawn Код:
SetTimerEx("AddMod",20000,true,"i",playerid);
Then at the end of ur pawno add
pawn Код:
forward AddMod(playerid);
public AddMod(playerid)
{
        new comp = AddVehicleComponent(tsultan,1026),
    AddVehicleComponent(tsultan,1027),
    AddVehicleComponent(tsultan,1028),
    AddVehicleComponent(tsultan,1032),
    AddVehicleComponent(tsultan,1098),
    AddVehicleComponent(tsultan,1010),
    AddVehicleComponent(tsultan,1138),
    AddVehicleComponent(tsultan,1141),
    AddVehicleComponent(tsultan,1169),
    ChangeVehiclePaintjob(tsultan, 0),
    AddVehicleComponent(gelegy, 1035),
    AddVehicleComponent(gelegy, 1037),
    AddVehicleComponent(gelegy, 1039),
    AddVehicleComponent(gelegy, 1046),
    AddVehicleComponent(gelegy, 1048),
    AddVehicleComponent(gelegy, 1172),
    AddVehicleComponent(gelegy, 1096),
    ChangeVehiclePaintjob(gelegy, 1);
        return 1;
Reply
#5

Sir, you trying to copy me?
Reply
#6

I believe he is dear sir.
Reply
#7

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Sir, you trying to copy me?
Super_Panda he copy that you type here lol (copycat)
Reply
#8

i think that dude has no words to say since he copyed my code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)