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


Messages In This Thread
Help payday - by Fjclip99 - 25.06.2014, 13:35
Re: Help payday - by WardenCS - 25.06.2014, 14:30
Re: Help payday - by DaniceMcHarley - 25.06.2014, 14:43
Re: Help payday - by Fjclip99 - 25.06.2014, 14:46
Re: Help payday - by Fjclip99 - 25.06.2014, 14:49
Re: Help payday - by Fjclip99 - 25.06.2014, 15:35
Re: Help payday - by WardenCS - 25.06.2014, 18:36
Re: Help payday - by Fjclip99 - 25.06.2014, 18:42
Re: Help payday - by WardenCS - 25.06.2014, 18:45

Forum Jump:


Users browsing this thread: 1 Guest(s)