#1

Hello i want a timer of if it is able to disable the command after using it
here is the code:
Code:
	if(!strcmp(cmdtext, "/g7190", true))
	{
		new string4[658], pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
		strcat(string4, "Key activated: g7190\n");
		strcat(string4, "\n");
		strcat(string4, "In this key you will have:\n");
		strcat(string4, "\n");
		strcat(string4, "10000$\n");
		strcat(string4, "2 Gold-Bars");
		ShowPlayerDialog(playerid, DIALOG_UPDATES, DIALOG_STYLE_MSGBOX, "Gift:", string4, "Okay", "");
		PlayerInfo[playerid][pCash] += 10000;
		PlayerInfo[playerid][pGoldBars] += 2;
		printf("Key activated: g7190");
		printf("Player: %s", pName);
		SetTimerEx("gKey", 3600, false, "i", playerid);
		return 1;
	}
Reply
#2

pawn Code:
SetTimerEx("giftagain", 1000*60*2, false, "d", playerid); // This is your Timer put it in your command 2 mins countdown 1000 mil seconds x 60 x 2 = 120000 = 2 Mins

forward giftagain(playerid);
public giftagain(playerid);
{
    //Your code here
    return 1;
}
You can read more about Timers here
Reply
#3

Thank you m8!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)