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;
}
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;
}