cmd with settimerex
#1

Код:
CMD:getgift(playerid, params[])
{
	for(new i=0;i<sizeof(GiftInfo);i++)
	{
		if(IsPlayerInRangeOfPoint(playerid,5,GiftInfo[i][pokX],GiftInfo[i][pokY],GiftInfo[i][pokZ]))
		{
		    if(IsValidDynamicObject(GiftObj[i]))
		    {
	            DestroyDynamic3DTextLabel(PLabel[i]);
			    DestroyDynamicObject(GiftObj[i]);
			    SetTimerEx("MakeGift", 600000, false,"i",i);
		 		new money = random(5000);
				GiveHimScore(playerid, money);
				new string[128];
				format(string, 264, "%s is take gift and get {FFFFFF}%d$",             PlayerName(playerid), money);
				SCMToAll(-1, string);
   			  } 
		}
	}
	}
	return 1;
}
This is my getgift cmd how to make with settimerex to player can use she every 10 minutes only
Reply
#2

My English is bad, I might have misunderstood.

Код:
CMD:getgift(playerid, params[])
{
if(GetPVarInt(playerid, "CommandBlock") > GetTickCount()) return SendClientMessage(playerid, 0xFF0000FF,"You have to wait 10 minutes to use this command again.");
SetPVarInt(playerid, "CommandBlock", GetTickCount() + 600000);

	for(new i=0;i<sizeof(GiftInfo);i++)
	{
		if(IsPlayerInRangeOfPoint(playerid,5,GiftInfo[i][pokX],GiftInfo[i][pokY],GiftInfo[i][pokZ]))
		{
		    if(IsValidDynamicObject(GiftObj[i]))
		    {
	            DestroyDynamic3DTextLabel(PLabel[i]);
			    DestroyDynamicObject(GiftObj[i]);
			    SetTimerEx("MakeGift", 600000, false,"i",i);
		 		new money = random(5000);
				GiveHimScore(playerid, money);
				new string[128];
				format(string, 264, "%s is take gift and get {FFFFFF}%d$",             PlayerName(playerid), money);
				SCMToAll(-1, string);
   			  } 
		}
	}
	}
	return 1;
}
Reply
#3

i want with timer..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)