[Ajuda] Paycheck
#1

Oii, tenho um problema com os paychecks.....


Quais os problemas?

Os problemas sao o seguinte:

1є Como adicionar salario a uma faction do rank 1?

Faction Policial || Faction ID1:
Код:
PlayerInfo[playerid][pFac] = 1
Rank ID 1
Код:
PlayerInfo[playerid][pFacRank] = 1
- E quanto mais level tenho mais dinheiro recebo... mas eu quero alterar os valores :// nгo sei onde

ta ai o paycheck se alguem poder ajudar agradeзo

pawn Код:
stock Paycheck()
{
    // Bank Robbery
    if(BankRobberyTime) BankRobberyTime --;
    // Bonus Calculation
    new bonus;
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i)) bonus ++;
    }
    bonus = bonus*2;
    // Paycheck
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i))
        {
            if(PlayerInfo[i][pMinutes] >= 45)
            {
                new string[128], idx;
                // Calculating Paycheck
                new paycheck = ((PlayerInfo[i][pMinutes]*PlayerInfo[i][pMinutes]) / 12) * PlayerInfo[i][pLevel];
                new taxamount = (TaxPercent * paycheck) / 100;
                new finalpaycheck = paycheck - taxamount;
                if(PlayerInfo[i][pInternet]) {finalpaycheck = finalpaycheck - 50; TaxMoney += 50;}
                idx = PlayerInfo[i][pBiz];
                if(PlayerInfo[i][pBiz]) {finalpaycheck = finalpaycheck - (BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]); TaxMoney += (BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]);}
                idx = PlayerInfo[i][pHouse];
                if(PlayerInfo[i][pHouse]) {finalpaycheck = finalpaycheck - (HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]); TaxMoney += (HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]);}
                if(PlayerInfo[i][pVIP] == 2) {finalpaycheck = finalpaycheck * (125/100);}
                if(PlayerInfo[i][pVIP] == 3) {finalpaycheck = finalpaycheck * (150/100);}
                if(PlayerInfo[i][pVIP] == 4) {finalpaycheck = finalpaycheck * (200/100);}
                finalpaycheck = finalpaycheck + ((bonus/100)*finalpaycheck);
                // Increasing Respect
                new calc, stack[4];
                if(PlayerInfo[i][pMinutes] >= 120)
                {
                    calc = (PlayerInfo[i][pMinutes]/60);
                    format(stack, sizeof(stack), "%d", calc);
                    PlayerInfo[i][pExp] += strval(stack);
                }
                else
                {
                    PlayerInfo[i][pExp] ++;
                    PlayerInfo[i][pHours] ++;
                }
                if(DayRespect == 1)
                {
                    PlayerInfo[i][pExp] ++;
                    SendClientMessage(i, COLOR_LIGHTBLUE, "* You have been given 1 additional respect point due to the current day ((/day))");
                }
                /*// Levels: 1-30
                new OldLevel = PlayerInfo[i][pLevel];
                if(PlayerInfo[i][pLevel] == 1 && PlayerInfo[i][pExp] >= 4) PlayerInfo[i][pLevel]++;
                else if(PlayerInfo[i][pLevel] == 2 && PlayerInfo[i][pExp] >= 8) PlayerInfo[i][pLevel]++;
                else if(PlayerInfo[i][pLevel] == 30 && PlayerInfo[i][pExp] >= 369) PlayerInfo[i][pLevel]++;
                else if(PlayerInfo[i][pLevel] == 31 && PlayerInfo[i][pExp] >= 425) PlayerInfo[i][pLevel]++;
                new NewLevel = PlayerInfo[i][pLevel];
                // Setting Level
                SetPlayerScore(i, PlayerInfo[i][pLevel]);*/

                new oldbalance = PlayerInfo[i][pBank];
                PlayerInfo[i][pBank] += finalpaycheck;
                TaxMoney += taxamount;
                // Paycheck Report
                PlayerInfo[i][pGift] = 0;
                format(string, sizeof(string), "{FF6347}Minutes Played: {FFFFFF}%d {00FF00} {FF6347}Level: {FFFFFF}%d  {FF6347}Respect: {FFFFFF}%d", PlayerInfo[i][pMinutes], PlayerInfo[i][pLevel], PlayerInfo[i][pExp]);
                SendClientMessage(i, COLOR_FADE1, string);
                format(string, sizeof(string), "{FF6347}Paycheck: {FFFFFF}$%d  {FF6347}Tax Amount: {FFFFFF}$%d (%d percent)  {FF6347}Total Paycheck: {FFFFFF}$%d", paycheck, taxamount, TaxPercent, finalpaycheck);
                SendClientMessage(i, COLOR_FADE1, string);
                format(string, sizeof(string), "{FF6347}Old Balance: {FFFFFF}$%d  {FF6347}New Balance: {FFFFFF}$%d", oldbalance, PlayerInfo[i][pBank]);
                SendClientMessage(i, COLOR_FADE1, string);
                if(PlayerInfo[i][pMinutes] >= 120)
                {
                    format(string, sizeof(string), "* You have been given %d respect points for playing for %d minutes.", strval(stack), PlayerInfo[i][pMinutes]);
                    if(PlayerInfo[i][pVIPBuddy]) PlayerInfo[i][pVIPBuddy] -= strval(stack);
                }
                else
                {
                    format(string, sizeof(string), "* You have been given 1 respect point for playing for %d minutes.", PlayerInfo[i][pMinutes]);
                    if(PlayerInfo[i][pVIPBuddy]) PlayerInfo[i][pVIPBuddy] --;
                }
                SendClientMessage(i, COLOR_LIGHTBLUE, string);
                if(PlayerInfo[i][pInternet]) SendClientMessage(i, COLOR_LIGHTBLUE, "* You have been charged $50 for having smartphone internet service activated.");
                idx = PlayerInfo[i][pBiz];
                if(PlayerInfo[i][pBiz])
                {
                    format(string, sizeof(string), "* You have been charged $%d for having a business.", BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]);
                    SendClientMessage(i, COLOR_LIGHTBLUE, string);
                }
                idx = PlayerInfo[i][pHouse];
                if(PlayerInfo[i][pHouse])
                {
                    format(string, sizeof(string), "* You have been charged $%d for having a house.", HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]);
                    SendClientMessage(i, COLOR_LIGHTBLUE, string);
                }
                if(PlayerInfo[i][pVIP] == 2) SendClientMessage(i, COLOR_VIP, "* Silver VIP: Your paycheck was 25 percent higher than usual.");
                else if(PlayerInfo[i][pVIP] == 3) SendClientMessage(i, COLOR_VIP, "* Gold VIP: Your paycheck was 50 percent higher than usual.");
                else if(PlayerInfo[i][pVIP] == 4) SendClientMessage(i, COLOR_VIP, "* Platinum VIP: Your paycheck was 100 percent higher than usual.");
                // Clearing Playing Minutes
                PlayerInfo[i][pMinutes] = 0;
            /*  // Giving a reward point
                if(!PlayerInfo[i][pVIP])
                {
                    PlayerInfo[i][pReward] ++;
                    if(PlayerInfo[i][pReward] >= 2124)
                    {
                        PlayerInfo[i][pReward] = 0;
                        PlayerInfo[i][pVIP] = 1;
                        PlayerInfo[i][pVIPTemp] = 60*24;
                        format(string, sizeof(string), "RewardWarn: %s has been rewarded a Bronze VIP package for 24 hours for being active.", RPN(i));
                        SendClientMessageToAll(COLOR_VIP, string);
                        Log("logs/makevip.log", string);
                        SendClientMessage(i, COLOR_LIGHTBLUE, " You will not be rewarded again until your Bronze VIP reward time is over.");
                    }
                    else
                    {
                        format(string, sizeof(string), "* You have gained an activity point, you have total of %d points.", PlayerInfo[i][pReward]);
                        SendClientMessage(i, COLOR_VIP, string);
                    }
                }*/

                // Loyal Points
                if(PlayerInfo[i][pVIP])
                {
                    PlayerInfo[i][pLPoints] ++;
                    format(string, sizeof(string), "* You have gained a VIP point, you have total of %d points.", PlayerInfo[i][pLPoints]);
                    SendClientMessage(i, COLOR_LIME, string);
                }
            }
            else
            {
                SendClientMessage(i, COLOR_LIGHTRED, " You haven't played long enough to recieve a paycheck.");
            }
            PayChecks = 1;
            SetTimer("PayCheckDone", 5000, false);
        }
    }
    return 1;
}
Reply
#2

Voce sabe se tem alguma define pra definir o valor do dinheiro ou uma variavel ? array ? algo ? poste mais amigo
Reply
#3

Quote:
Originally Posted by N3XTMapper
Посмотреть сообщение
Voce sabe se tem alguma define pra definir o valor do dinheiro ou uma variavel ? array ? algo ? poste mais amigo
Nгo tem
Reply
#4

Na variбvel abaixo armazena a quantia que o player irб ganhar.
Irei colocar o cуdigo original e irei tentar fazer um exemplo de como adicionar mais dinheiro para ele receber.

Original:
PHP код:
finalpaycheck finalpaycheck + ((bonus/100)*finalpaycheck); 
Editado:
PHP код:
finalpaycheck finalpaycheck 250 + ((bonus/100)*finalpaycheck); 
Ele irб continuar a dar o valor do paycheck + 250 reais para o player, Caso queira alterar fique a vontade.
Para fazer alteraзхes modifique o: 250 para o valor desejado.

Ajudei? + Rep
Reply
#5

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Na variбvel abaixo armazena a quantia que o player irб ganhar.
Irei colocar o cуdigo original e irei tentar fazer um exemplo de como adicionar mais dinheiro para ele receber.

Original:
PHP код:
finalpaycheck finalpaycheck + ((bonus/100)*finalpaycheck); 
Editado:
PHP код:
finalpaycheck finalpaycheck 250 + ((bonus/100)*finalpaycheck); 
Ele irб continuar a dar o valor do paycheck + 250 reais para o player, Caso queira alterar fique a vontade.
Para fazer alteraзхes modifique o: 250 para o valor desejado.

Ajudei? + Rep
mas eu gostava de dar mais salario as factions, como faзo?
Reply
#6

Bom eu jб fiz o cуdigo inteiro e abaixo irei explicar.

Ajudei? + Rep

Faction Policial:
PHP код:

/*-- Altere o 225 para aumentar a quantia de dinheiro para a Faction Policial --*/
if(PlayerInfo[i][pFac] == 1) {finalpaycheck finalpaycheck * (225/100);} 
Faction Rank ID 1:
PHP код:

/*-- Altere o 250 para aumentar a quantia de dinheiro para a Faction Rank ID 1 --*/
if(PlayerInfo[i][pFacRank] == 1) {finalpaycheck finalpaycheck * (250/100);} 
Cуdigo Pronto:
PHP код:

stock Paycheck
()
{
    
/*-- Banco Robbery --*/
    
if(BankRobberyTimeBankRobberyTime --;
    
/*-- Calculaзгo dos Bonus --*/
    
new bonus;
    foreach(
Playeri)
    {
        if(
IsPlayerLoggedIn(i)) bonus ++;
    }
    
bonus bonus*2;
    
/*-- PayChecks --*/
    
foreach(Playeri)
    {
        if(
IsPlayerLoggedIn(i))
        {
            if(
PlayerInfo[i][pMinutes] >= 45)
            {
                new 
string[128], idx;
                
/*-- Calculaзгo do PayCheck --*/
                
new paycheck = ((PlayerInfo[i][pMinutes]*PlayerInfo[i][pMinutes]) / 12) * PlayerInfo[i][pLevel];
                new 
taxamount = (TaxPercent paycheck) / 100;
                new 
finalpaycheck paycheck taxamount;
                if(
PlayerInfo[i][pInternet]) {finalpaycheck finalpaycheck 50TaxMoney += 50;}
                
idx PlayerInfo[i][pBiz];
                if(
PlayerInfo[i][pBiz]) {finalpaycheck finalpaycheck - (BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]); TaxMoney += (BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]);}
                
idx PlayerInfo[i][pHouse];
                if(
PlayerInfo[i][pHouse]) {finalpaycheck finalpaycheck - (HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]); TaxMoney += (HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]);}
                if(
PlayerInfo[i][pVIP] == 2) {finalpaycheck finalpaycheck * (125/100);}
                if(
PlayerInfo[i][pVIP] == 3) {finalpaycheck finalpaycheck * (150/100);}
                if(
PlayerInfo[i][pVIP] == 4) {finalpaycheck finalpaycheck * (200/100);}
                if(
PlayerInfo[i][pFac] == 1) {finalpaycheck finalpaycheck * (225/100);} /*-- Altere o 225 para aumentar a quantia de dinheiro para a Faction Policial --*/
                
if(PlayerInfo[i][pFacRank] == 1) {finalpaycheck finalpaycheck * (250/100);} /*-- Altere o 250 para aumentar a quantia de dinheiro para a Faction Rank ID 1 --*/
                
finalpaycheck finalpaycheck + ((bonus/100)*finalpaycheck);
                new 
calcstack[4];
                if(
PlayerInfo[i][pMinutes] >= 120)
                {
                    
calc = (PlayerInfo[i][pMinutes]/60);
                    
format(stacksizeof(stack), "%d"calc);
                    
PlayerInfo[i][pExp] += strval(stack);
                }
                else
                {
                    
PlayerInfo[i][pExp] ++;
                    
PlayerInfo[i][pHours] ++;
                }
                if(
DayRespect == 1)
                {
                    
PlayerInfo[i][pExp] ++;
                    
SendClientMessage(iCOLOR_LIGHTBLUE"* You have been given 1 additional respect point due to the current day ((/day))");
                }
                new 
oldbalance PlayerInfo[i][pBank];
                
PlayerInfo[i][pBank] += finalpaycheck;
                
TaxMoney += taxamount;
                
PlayerInfo[i][pGift] = 0;
                
format(stringsizeof(string), "{FF6347}Minutes Played: {FFFFFF}%d {00FF00} {FF6347}Level: {FFFFFF}%d  {FF6347}Respect: {FFFFFF}%d"PlayerInfo[i][pMinutes], PlayerInfo[i][pLevel], PlayerInfo[i][pExp]);
                
SendClientMessage(iCOLOR_FADE1string);
                
format(stringsizeof(string), "{FF6347}Paycheck: {FFFFFF}$%d  {FF6347}Tax Amount: {FFFFFF}$%d (%d percent)  {FF6347}Total Paycheck: {FFFFFF}$%d"paychecktaxamountTaxPercentfinalpaycheck);
                
SendClientMessage(iCOLOR_FADE1string);
                
format(stringsizeof(string), "{FF6347}Old Balance: {FFFFFF}$%d  {FF6347}New Balance: {FFFFFF}$%d"oldbalancePlayerInfo[i][pBank]);
                
SendClientMessage(iCOLOR_FADE1string);
                if(
PlayerInfo[i][pMinutes] >= 120)
                {
                    
format(stringsizeof(string), "* You have been given %d respect points for playing for %d minutes."strval(stack), PlayerInfo[i][pMinutes]);
                    if(
PlayerInfo[i][pVIPBuddy]) PlayerInfo[i][pVIPBuddy] -= strval(stack);
                }
                else
                {
                    
format(stringsizeof(string), "* You have been given 1 respect point for playing for %d minutes."PlayerInfo[i][pMinutes]);
                    if(
PlayerInfo[i][pVIPBuddy]) PlayerInfo[i][pVIPBuddy] --;
                }
                
SendClientMessage(iCOLOR_LIGHTBLUEstring);
                if(
PlayerInfo[i][pInternet]) SendClientMessage(iCOLOR_LIGHTBLUE"* You have been charged $50 for having smartphone internet service activated.");
                
idx PlayerInfo[i][pBiz];
                if(
PlayerInfo[i][pBiz])
                {
                    
format(stringsizeof(string), "* You have been charged $%d for having a business."BizInfo[idx][bLevel] * PlayerInfo[i][pLevel]);
                    
SendClientMessage(iCOLOR_LIGHTBLUEstring);
                }
                
idx PlayerInfo[i][pHouse];
                if(
PlayerInfo[i][pHouse])
                {
                    
format(stringsizeof(string), "* You have been charged $%d for having a house."HouseInfo[idx][hLevel] * PlayerInfo[i][pLevel]);
                    
SendClientMessage(iCOLOR_LIGHTBLUEstring);
                }
                if(
PlayerInfo[i][pVIP] == 2SendClientMessage(iCOLOR_VIP"* Silver VIP: Your paycheck was 25 percent higher than usual.");
                else if(
PlayerInfo[i][pVIP] == 3SendClientMessage(iCOLOR_VIP"* Gold VIP: Your paycheck was 50 percent higher than usual.");
                else if(
PlayerInfo[i][pVIP] == 4SendClientMessage(iCOLOR_VIP"* Platinum VIP: Your paycheck was 100 percent higher than usual.");
                
PlayerInfo[i][pMinutes] = 0;
                if(
PlayerInfo[i][pVIP])
                {
                    
PlayerInfo[i][pLPoints] ++;
                    
format(stringsizeof(string), "* You have gained a VIP point, you have total of %d points."PlayerInfo[i][pLPoints]);
                    
SendClientMessage(iCOLOR_LIMEstring);
                }
            }
            else
            {
                
SendClientMessage(iCOLOR_LIGHTRED" You haven't played long enough to recieve a paycheck.");
            }
            
PayChecks 1;
            
SetTimer("PayCheckDone"5000false);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)