tax = (GovTax/100)*PlayerInfo[playerid][pSigncheck];//random(50) + 10;
format(m, sizeof(m), "Tax: %i", tax);
CMD:signcheck(playerid,params[]){
new m[512], tax;
if(TodayPlayingHour[playerid]>300)
{
if(PlayerInfo[playerid][pSavingMoney] > 0)
{
if(PlayerInfo[playerid][pSavingMoney] >= 50000) return SendClientMessage(playerid, COLOR_YELLOW, "You won't recieve anymore interest in saving account, your saving balance has reached maximum.");
SavingMoney[playerid] = PlayerInfo[playerid][pSavingMoney]*5/100; //Gets 2 percents from the savings, i guess it has to be *PERCENTAGE NUMBER WE WANT and divided by 100
PlayerInfo[playerid][pSavingMoney] += 2*SavingMoney[playerid];
}
if(PlayerHaveSigncheck[playerid]==0) return SendClientMessage(playerid, COLOR_RED, "There is no active signcheck.");
PlayerInfo[playerid][pEXP] += 1;
SendClientMessage(playerid, COLOR_GREY, "___________________| Signcheck Received |___________________");
format(m, sizeof(m), "Paycheck: $%i", PlayerInfo[playerid][pSigncheck]);
SendClientMessage(playerid, COLOR_GREY, m);
format(m, sizeof(m), "Savings Bonus: $%i", SavingMoney[playerid]);
SendClientMessage(playerid, COLOR_GREY, m);
SendClientMessage(playerid, COLOR_GREY, "Exp: +1");
tax = (GovTax/100)*PlayerInfo[playerid][pSigncheck];//random(50) + 10;
format(m, sizeof(m), "Tax: %i", tax);
SendClientMessage(playerid, COLOR_GREY, m);
GiveMoney(playerid, -tax);
AvailableGovTax += tax;
GiveMoney(playerid,PlayerInfo[playerid][pSigncheck]);
PlayerInfo[playerid][pSigncheck] = 0;
PlayerHaveSigncheck[playerid]=0;
}else
{
SendClientMessage(playerid, COLOR_RED, "You have to play atleast 5 minutes to obtain check.");
}
return 1;
}
new tax; |
new Float: tax; |
floatdiv(Float:dividend, Float:divisor) |
tax = floatdiv(GovTax/100)*PlayerInfo[playerid][pSigncheck]; format(m, sizeof(m), "Tax: %f", tax); |
Since you are dividing 10 by 100 you are getting a float instead of an integer.
So you will have to change to For dividing floats you need to use the function: So your code would look like this: You should use the function floatround to convert this float to an integer if you intend to use it that way. https://sampwiki.blast.hk/wiki/Floatround |
GovTax / 100.0