SA-MP Forums Archive
Small problem with my payday (+rep) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Small problem with my payday (+rep) (/showthread.php?tid=579668)



Small problem with my payday (+rep) - Sc0pion - 29.06.2015

Fixed!


Re: Small problem with my payday (+rep) - X337 - 29.06.2015

"&&" Is for statement.
Код:
           if(ServerHour == 18)
           {
		if(ServerMinute == 00) 
                {
                    Payday();
                    SendClientMessageToAll(-1, "{00FFEE}[ PAYDAY: Thank you for playing San Andreas - Gang War, and you have received your payday. ]");
                }
           }
Код:
        if(ServerDay == 06)
           if(ServerHour == 10)
              if(ServerMinute == 31)
              {
                 totallotto=25000;
                 SendClientMessageToAll(-1, "{B7FF00}[ LOTTERY NOTIFICATION: The lottery has been reset back to $25000! ]");
              }



Re: Small problem with my payday (+rep) - Sc0pion - 29.06.2015

Fixed!


Re: Small problem with my payday (+rep) - Sc0pion - 29.06.2015

Fixed!


Re : Small problem with my payday (+rep) - Terrorizt - 29.06.2015

Payday function works fine only the Game Text is not working well. I've tried it with SendClientMessage(i, -1, string); and it worked so you have to change GameTextForAll to SendClientMessage.
Another thing, you wrote GameTextForAll and this is a fault you should use GameTextForPlayer but not in this case.
Here is the code:
Код:
public Payday()
{
    new string[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        new payday = GetPlayerScore(i)*10; //Depends on player's score.
        format(string,sizeof(string),"Payday: You have recieved $%i", payday);
		SendClientMessage(i,-1, string);
        GivePlayerMoney(i,payday);
    }
	return 1;
}