Timer problem?
#1

Hey guys i have a timer under onplayerconnect for payday but the timer gives pay every 10 minutes when it should be an hour Here it is...
Quote:

SetTimerEx("payday", 7200000, true, "d", playerid);

Quote:

public payday(playerid)
{
if(IsPoliceFaction(PlayerInfo[playerid][pFaction]))
{
GivePlayerMoney(playerid,30000);
SendClientMessage(playerid,COLOR_BLUE,"[PAYDAY]-[LEO CHECK]-[$25000]");
}
else if(IsGangFaction(PlayerInfo[playerid][pFaction]))
{
GivePlayerMoney(playerid,45000);
SendClientMessage(playerid,COLOR_GREEN,"[PAYDAY]-[CRIMINAL CHECK]-[$45000]");
}
else if(PlayerInfo[playerid][pFaction] > 4 && PlayerInfo[playerid][pFaction] < 6)
{
GivePlayerMoney(playerid,25000);
SendClientMessage(playerid,COLOR_RED,"[PAYDAY]-[EMERGENCY SERVICE CHECK]-[$25000]");
}
else if(PlayerInfo[playerid][pFaction] == 0)
{
GivePlayerMoney(playerid,5000);
SendClientMessage(playerid,COLOR_WHITE,"[PAYDAY]-[WELFARE CHECK]-[$5000]");
}
else if(PlayerInfo[playerid][pJob] == JOB_TOWER)
{
GivePlayerMoney(playerid,5000);
SendClientMessage(playerid,COLOR_ORANGE,"[PAYDAY]-[TOWING COMPANY]-[$12000]");
}
else if(PlayerInfo[playerid][pJob] == JOB_PROSTITUTE)
{
GivePlayerMoney(playerid,10000);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Someon e just gave you a check for 10000 and said be ready at 9");
}
}

ALSO when i alt tab for like 5 minutes i get 4 pay checks
Reply
#2

Are you killing the timer when the player disconnects? Otherwise the timer will run constantly and timers will just continue stacking per player that connects, you may end up having hundreds of timers for each person if you're not killing them.
Reply
#3

ill try that now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)