public CooldownTimer(playerid)
{
new msg[120];
if(Player[playerid][playerWanted] > 0 )
{
Player[playerid][playerWanted]--;
format(msg,sizeof(msg),"Your wanted level has been reduced to %d.",Player[playerid][playerWanted]);
SendClientMessage(playerid,COLOR_YELLOW,msg);
setWanted(playerid,Player[playerid][playerWanted]);
return 1;
}
else
{
TextDrawHideForPlayer(playerid, GM[loadObjectTD][0]);
}
return 1;
}
public InterestTimer(playerid)
{
new giveintr,deduction,msg3[100];
Player[playerid][interestTimer]++;
//SendClientMessage(playerid,COLOR_YELLOW,"DEBUG: ID 1");
if(Player[playerid][interestTimer] >= 10)
{
deduction = 10000;
giveintr = Player[playerid][moneyBank]/deduction;
Player[playerid][interest] = Player[playerid][interest] + giveintr;
format(msg3,sizeof(msg3),"You have recieved your interest payment of $%s. Head to nearest local bank to collect it.",FormatNumber(giveintr));
SendClientMessage(playerid,COLOR_YELLOW,msg3);
Player[playerid][interestTimer] = 0;
return 1;
}
return 1;
}
well the timer starts onplayerlogin
its like Cooldowntimer = SetTimerEx("Cooldown",180000,true,"d",playerid); same method for interest timer.... |
case DIALOG_LOGIN:
{
if(!response)
return KickDelay(playerid);
WP_Hash(hash, sizeof(hash), inputtext);
if(!strcmp(hash, Player[playerid][playerPassword], true))
{
new country[256];
GetPlayerCountry(playerid, country, sizeof(country));
format(message, 256, "{0066ff}* %s(%d) has connected to the server from %s.", GetName(playerid),playerid,country);
SendClientMessageToAll(COLOR_WHITE,message);
//ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Welcome back", message, "Submit", "");
Player[playerid][tryLogin] = 0;
Player[playerid][playerLogged] = GetTickCount();
Player[playerid][useCommand] = true;
Player[playerid][loggedIn] = true;
Player[playerid][savedHealth] = 0;
Player[playerid][cooldown] = SetTimerEx("CooldownTimer",180000, true, "d", playerid); //Wanted level reducing timer (5 mins)
Player[playerid][intresttimer] = SetTimerEx("InterestTimer",360000, true, "d", playerid); //Interest Timer (6 mins update) //3600000
initTextdraw(playerid);
}
else
{
Player[playerid][tryLogin]++;
if(Player[playerid][tryLogin] < 3)
{
new pesan[300];
//format(message, 256, CHAT_WHITE"Wrong password, \nPlease enter your password in the field below. (%d/3)", Player[playerid][tryLogin]);
//ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", message, "Login", "Leave");
format(pesan, sizeof(pesan), "{ffffff}Welcome to Los Santos {0066ff}Cops {ffffff}and {ff0000}Robbers.\n\n{ffffff}User Name: {ff7a00}%s.\n{ffffff}Ip Address: {ff7a00}%s\n\n{ff0000}You have entered a wrong password (%d/3)\n{ffffff}Enter your password..", GetName(playerid),getIP(playerid),Player[playerid][tryLogin]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LSCNR - LOGIN", pesan, "Login", "Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Wrong Password", "You have mistyped your password too often (3 times)", "Okay", "");
KickDelay(playerid);
}
}
}