Help payday
#1

I have another problem

I have payday every full hour...
Now on payday it will check if player was playing 20 + min. if yes - he gets the payday, if not - he gets the message that he wasn't playing enough and don't get the payday. Now if i am the only player on the server it works fine, but if there are more, some of theme gets the both (The payday and the message that they haven't played enough...)
Script:
Код:
forward paytime(playerid);
public paytime(playerid)
{
    new hh, mm, ss;
    gettime( hh, mm, ss );
    if( mm == 00 )
    {
   		for(new i = 0;i < MAX_PLAYERS;i += 1)
	        {
	        SetPlayerTime(i,hh,00);
	        if(pInfo[i][Paytime] >= 2) // If player have been playing for 20+ minutes, he gets payday.
	        {
			GivePlayerMoney(i, pInfo[i][Placa]);
			pInfo[i][EXP] ++;
			pInfo[i][Phours] ++;
			pInfo[i][Paytime] = 0;
			new string[128];
			format(string,sizeof(string),""red"[BANKA]"white" Plača je bila izplačana, na vaљ račun je nakazano: $ %i.",pInfo[i][Placa]);
		    	SendClientMessage(i, COLOR_RED,"------------------------------------------------");
		    	SendClientMessage(i, COLOR_WHITE,string);
		    	SendClientMessage(i, COLOR_RED,"------------------------------------------------");
		    	pInfo[i][Placa] = 500;
	   		TextDrawHideForPlayer(i,exps[i]);
			new expsstr[124];
			format(expsstr, sizeof(expsstr), "-     Experiance:  %i / %i", pInfo[i][EXP],pInfo[i][ExpNext]);
			TextDrawSetString(exps[i], expsstr);
			TextDrawShowForPlayer(i, exps[i]);
		}
		else return SendClientMessage(playerid, COLOR_WHITE, ""red"[BANKA]"white"Niste igrali dovolj dolgo, da bi dobili plačo."); // If player was not playing 20+ minutes, he gets the message.
		}
	}
    return 1;
}
Reply
#2

How do you give the paytime?
Reply
#3

How do you collect the paytime?
Reply
#4

Код:
forward paytimeplus(playerid);
public paytimeplus(playerid)
{
	for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
	{
		pInfo[i][Paytime] ++;
	}
    return 1;
}
This is a 20 mins. Timer
Reply
#5

Every 10 mins. Sorry
Reply
#6

Anyone help ?
Reply
#7

how do you set paytimeplus timer?
Reply
#8

OnFilterScriptInit:
http://prntscr.com/3wfodq
Timer:
http://prntscr.com/3wfolu
Reply
#9

Код:
onplayerconnect:
SetTimerEx("paytimeplus", 600000, true, "i", playerid);

forward paytimeplus(playerid);
public paytimeplus(playerid)
{
	 if(IsPlayerConnected(playerid))
	{
		pInfo[playerid][Paytime] ++;
	}
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)