Help with Timer
#6

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
why dont you use tick count for these? Basically just check if player can use gift when he uses command.

pawn Код:
pGiftTime[playerid] = gettime();//When he gets a gift

if(gettime() > (pGiftTime[playerid] + 86400))
{
    //He can use gift, time has passed...
}


//you can also use these to get time remaining (in seconds):
((pGiftTime[playerid] + 86400) - gettime())
Quote:
Originally Posted by Troydere
Посмотреть сообщение
Sure:

Код:
forward GiftTaimer(playerid);
public GiftTaimer(playerid)
{
	if(PlayerInfo[playerid][pGiftTime] > 0) PlayerInfo[playerid][pGiftTime] --;
	else SetPVarInt(playerid,"Claimyourpresent",1);
	return 1;
}

public OnPlayerConnect(playerid)
{
	SetTimerEx("GiftTaimer",1000,true,"i",playerid);
	return 1;
}
Thanks. also i have one doubt, dont you think server will be laggy if i use timer for every second for every player?

also in /gift cmd, i will use like,
Код:
 if(GetPVarInt(playerid, "Claimyourpresent") != 1) return SCM(COLOR_RED, "You cant use /gift yet.");
is that ok?

Thanks
Reply


Messages In This Thread
Help with Timer - by GeorgeMcReary - 07.03.2017, 15:21
Re: Help with Timer - by Toroi - 07.03.2017, 15:44
Re: Help with Timer - by GeorgeMcReary - 07.03.2017, 16:06
Re: Help with Timer - by DRIFT_HUNTER - 07.03.2017, 16:16
Re: Help with Timer - by Toroi - 07.03.2017, 16:18
Re: Help with Timer - by GeorgeMcReary - 07.03.2017, 16:24
Re: Help with Timer - by Vince - 07.03.2017, 16:38
Re: Help with Timer - by Toroi - 07.03.2017, 17:04
Re: Help with Timer - by GeorgeMcReary - 08.03.2017, 08:40
Re: Help with Timer - by GTLS - 08.03.2017, 09:38

Forum Jump:


Users browsing this thread: 1 Guest(s)