Need help creating Timers.
#1

I am creating a mode in which Player gets a car after killing some players.
It workes fine.

Now I want to destroy his/her car after 2 minutes.
I have already created array to give player his/her own car.

Here is code for better understanding

Код:
forward DestroyCar(playerid);
{
pCar[playerid] = CreateVehicle(bla bla);
//SetTimer("DestroyCar",12000,false); for 2 minutes here
}

//After 2 Minutes
public DestroyCar(playerid)
{
DestroyVehicle(pCar[playerid]);//Car should be destroyed of that particular player only.
}
Reply
#2

You have to use SetTimerX and forward the playerid as well.

pawn Код:
SetTimerEx("DestroyCar",12000,false, "i", playerid);
// the i specifies the type of value you are forwarding (i for integer)
// playerid is the value of i to forward
Reply
#3

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
I am creating a mode in which Player gets a car after killing some players.
It workes fine.

Now I want to destroy his/her car after 2 minutes.
I have already created array to give player his/her own car.

Here is code for better understanding

Код:
forward DestroyCar(playerid);
{
pCar[playerid] = CreateVehicle(bla bla);
//SetTimer("DestroyCar", 12000, false); for 2 minutes here
}

//After 2 Minutes
public DestroyCar(playerid)
{
DestroyVehicle(pCar[playerid]);//Car should be destroyed of that particular player only.
}
pawn Код:
SetTimerEx("DestroyCar", 12000, false, "d", playerid);
Reply
#4

pawn Код:
SetTimerEx("DestroyCar",12000,false,"i",playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)