21.02.2014, 21:29
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:
Rank ID 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
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
Код:
PlayerInfo[playerid][pFacRank] = 1
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;
}