Payday System help
#1

Hello!

I have some problem with payday. I need to give money every hour when player is in faction and One score too!
I have tax system in my gm but now I want to add this:
PHP код:
(PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 1)
                {
                    {
                        if(
PlayerInfo[i][pRank] == 1)
                        {
                            
SafeGivePlayerMoney(i20000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 20.000$ (Rank 1)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 2)
                        {
                            
SafeGivePlayerMoney(i40000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 40.000$ (Rank 2)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 3)
                        {
                            
SafeGivePlayerMoney(i60000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 60.000$ (Rank 3)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 4)
                        {
                            
SafeGivePlayerMoney(i80000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 80.000$ (Rank 4)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 5)
                        {
                            
SafeGivePlayerMoney(i90000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 90.000$ (Rank 5)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 6)
                        {
                            
SafeGivePlayerMoney(i100000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 100.000$ (Rank 6)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 7)
                        {
                            
SafeGivePlayerMoney(i110000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 110.000$ (Rank 7)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 8)
                        {
                            
SafeGivePlayerMoney(i120000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 120.000$ (Rank 8)");
                            
SendClientMessage(iCOLOR_GREYstring); 
Here:
PHP код:
public PayDay() // 
{
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && !IsPlayerNPC(i))
        {
              if(
PlayerInfo[i][pLevel] > 0)
            {
                new 
tax = (Tax 2)*(PlayerInfo[i][pLevel]);
                if(
PlayerInfo[i][pAccount] > PlayerInfo[i][pCash])
                {
                    
PlayerInfo[i][pAccount] -= tax;
                    
banksys[dCash] += tax;
                    
SaveCityhallSystem()
                    
GivePlayerScore(i, +1);
                    
SendClientMessageToAll(-1"Payday!");
                    
format(stringsizeof(string), "  Government Tax: -$%d"tax);
                    
SendClientMessage(iCOLOR_GREENstring);
                }
                else
                {
                    
PlayerInfo[i][pCash] -= tax;
                    
banksys[dCash] += tax;
                    
SaveCityhallSystem()
                    
format(stringsizeof(string), "  Government Tax: -$%d"tax);
                    
SendClientMessage(iCOLOR_GREENstring);
                }
                if(
PlayerInfo[i][pAddict] == 1)
                {
                    
PlayerInfo[i][pExp]+= 4;
                }
                
//PlayerInfo[i][pExp]+= 2;
                /*if(dxp == 1)
                {
                    PlayerInfo[i][pExp]+= 4;
                    SendClientMessage(i, COLOR_GREEN, "Happy Hours You earned 4-XP Points");
                    //PlayerInfo[i][pExp]+= 2;
                }
                else if(dxp == 0)
                {*/
                
PlayerInfo[i][pExp]+= 2;
                
//}
                
else if
            }
        }
    }
    return 
1;

Thanks for help!
Reply
#2

do you have a STOCK for SafeGivePlayerMoney
if yes , give it to me soi can see if there is a problem
Reply
#3

I don't have stock for safegiveplayermoney.
Reply
#4

then i think that's why payday wont work ,

try with this one ,

add this stock at the botum of your script & recompile

PHP код:
stock SafeGivePlayerMoney(playeridcash)
{
    
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] += cash;
    return 
1;

Reply
#5

mm.. ok so, but I need to know how to add that rank money thing to payday. Right now I have two different systems I have this system:
PHP код:
if(strcmp(cmd"/factionpayday"true) == || strcmp(cmd"/payteam"true) == 0)
    {
      if(
PlayerInfo[playerid][pAdmin] >= 1338)
      {
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
SendClientMessage(playeridCOLOR_GREEN,"All online faction members have retrieved their faction Payday.");
        
format(string256"News: %s has started the Faction PayDay !"sendername);
        
ABroadCast(COLOR_YELLOW,string,1);
        for(new 
i=0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pLeader] == 1||PlayerInfo[i][pMember] == 1)
                    {
                        if(
PlayerInfo[i][pRank] == 1)
                        {
                            
SafeGivePlayerMoney(i20000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 20.000$ (Rank 1)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 2)
                        {
                            
SafeGivePlayerMoney(i40000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 40.000$ (Rank 2)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 3)
                        {
                            
SafeGivePlayerMoney(i60000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 60.000$ (Rank 3)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 4)
                        {
                            
SafeGivePlayerMoney(i80000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 80.000$ (Rank 4)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 5)
                        {
                            
SafeGivePlayerMoney(i90000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 90.000$ (Rank 5)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 6)
                        {
                            
SafeGivePlayerMoney(i100000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 100.000$ (Rank 6)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 7)
                        {
                            
SafeGivePlayerMoney(i90000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 110.000$ (Rank 5)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                        else if(
PlayerInfo[i][pRank] == 8)
                        {
                            
SafeGivePlayerMoney(i100000);
                            
format(stringsizeof(string), "*You have retrieved your Faction PayDay of 120.000$ (Rank 6)");
                            
SendClientMessage(iCOLOR_GREYstring);
                        }
                    }
                }
            }
        }
        return 
1;
    } 
and I want to do it automatically like every hour player get this money amount. to payday and every hour player get +1 score.
I have payday system almost but I need to put these together
PHP код:
public PayDay() //  

    new 
string[128]; 
    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i) && !IsPlayerNPC(i)) 
        { 
              if(
PlayerInfo[i][pLevel] > 0
            { 
                new 
tax = (Tax 2)*(PlayerInfo[i][pLevel]); 
                if(
PlayerInfo[i][pAccount] > PlayerInfo[i][pCash]) 
                { 
                    
PlayerInfo[i][pAccount] -= tax
                    
banksys[dCash] += tax
                    
SaveCityhallSystem() 
                    
GivePlayerScore(i, +1); 
                    
SendClientMessageToAll(-1"Payday!"); 
                    
format(stringsizeof(string), "  Government Tax: -$%d"tax); 
                    
SendClientMessage(iCOLOR_GREENstring); 
                } 
                else 
                { 
                    
PlayerInfo[i][pCash] -= tax
                    
banksys[dCash] += tax
                    
SaveCityhallSystem() 
                    
format(stringsizeof(string), "  Government Tax: -$%d"tax); 
                    
SendClientMessage(iCOLOR_GREENstring); 
                } 
                if(
PlayerInfo[i][pAddict] == 1
                { 
                    
PlayerInfo[i][pExp]+= 4
                } 
                
//PlayerInfo[i][pExp]+= 2; 
                /*if(dxp == 1) 
                { 
                    PlayerInfo[i][pExp]+= 4; 
                    SendClientMessage(i, COLOR_GREEN, "Happy Hours You earned 4-XP Points"); 
                    //PlayerInfo[i][pExp]+= 2; 
                } 
                else if(dxp == 0) 
                {*/ 
                
PlayerInfo[i][pExp]+= 2
                
//} 
                
else if 
            } 
        } 
    } 
    return 
1

Reply
#6

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)