PAYDAY System. Welfare . Help. -
PhoeNiX778 - 15.06.2012
Код:
public PayDay(playerid)
{
new string[128];
new account,interest;
new rent = 0;
if(PlayerInfo[playerid][pCellplan] == 2 && PlayerInfo[playerid][pCellphone] == 1)
{
PlayerInfo[playerid][pCelltime] -= 10;
}
if(PlayerInfo[playerid][pBreakAllow] > 0)
{
PlayerInfo[playerid][pBreakAllow]--;
}
if(GetPVarInt(playerid, "PlayerLogged") == 1)
{
if(PlayerInfo[playerid][pJailTime] == 0)
{
if(PlayerInfo[playerid][pJailed] == 0)
{
account = PlayerInfo[playerid][pAccount];
new key = PlayerInfo[playerid][pHousekey];
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
new tmpintrate;
switch(PlayerInfo[playerid][pDonateRank])
{
case 0:
{
tmpintrate = 1;
}
case 1:
{
tmpintrate = 1;
}
case 2:
{
tmpintrate = 2;
}
case 3:
{
tmpintrate = 3;
}
}
if(PlayerInfo[playerid][pPayDay] >= 0)
{
Tax += TaxValue;
PlayerInfo[playerid][pAccount] -= TaxValue;
new checks;
checks = 700;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 10;
checks += bonus;
}
new ebill = 125;
account += checks;
if(PlayerInfo[playerid][pAccount] > 0)
{
PlayerInfo[playerid][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[playerid][pAccount]/1000)*(tmpintrate);
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pAccount] = account+interest;
SendClientMessage(playerid,0x4D903DAA,"---------------------------------------------------------------");
SendClientMessage(playerid,0x4D903DAA," Bank Statement ");
SendClientMessage(playerid,0x4D903DAA,"---------------------------------------------------------------");
format(string, 128, "Paycheck: $%d | Tax Money: -$150", checks);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pAccount] -= 150;
if(PlayerInfo[playerid][pHousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255)
{
format(string, 128, "Electricity Bill: -$%d | Rent: -$%d", ebill,rent);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(PlayerInfo[playerid][pHousekey] == 255 || PlayerInfo[playerid][pPbiskey] == 255)
{
format(string, 128, "Rent: -$%d", rent);
SendClientMessage(playerid, COLOR_WHITE, string);
}
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pMember] == 14)
{
switch (PlayerInfo[playerid][pRank])
{
case 0:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 1:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 2:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 3:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $300");
PlayerInfo[playerid][pAccount] += 300;
}
case 4:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $400");
PlayerInfo[playerid][pAccount] += 400;
}
case 5:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 6:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
}
}
else if(PlayerInfo[playerid][pMember] == 6)
{
switch (PlayerInfo[playerid][pRank])
{
case 0:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 1:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 2:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $200");
PlayerInfo[playerid][pAccount] += 200;
}
case 3:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $350");
PlayerInfo[playerid][pAccount] += 350;
}
case 4:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $375");
PlayerInfo[playerid][pAccount] += 375;
}
case 5:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $400");
PlayerInfo[playerid][pAccount] += 400;
}
case 6:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $425");
PlayerInfo[playerid][pAccount] += 425;
}
case 7:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $450");
PlayerInfo[playerid][pAccount] += 450;
}
case 8:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $475");
PlayerInfo[playerid][pAccount] += 475;
}
case 9:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 10:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 11:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 12:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 13:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 14:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 15:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
case 16:
{
SendClientMessage(playerid, COLOR_WHITE, "Bonus Check: $500");
PlayerInfo[playerid][pAccount] += 500;
}
}
}
if(PlayerInfo[playerid][pCarkey] != SCRIPT_CARS)
{
new carkey = PlayerInfo[playerid][pCarkey];
if(CarInfo[carkey][cInsur] == 1)
{
new amount = VehiclePrice(carkey);
format(string, 128, "Insurance Vehicle 1: -$%d", amount);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
if(PlayerInfo[playerid][pCarkey2] != SCRIPT_CARS)
{
new carkey2 = PlayerInfo[playerid][pCarkey2];
if(CarInfo[carkey2][cInsur] == 1)
{
new amount = VehiclePrice(carkey2);
format(string, 128, "Insurance Vehicle 2: -$%d", amount);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
if(PlayerInfo[playerid][pCarkey3] != SCRIPT_CARS)
{
new carkey3 = PlayerInfo[playerid][pCarkey3];
if(CarInfo[carkey3][cInsur] == 1)
{
new amount = VehiclePrice(carkey3);
format(string, 128, "Insurance Vehicle 3: -$%d", amount);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerInfo[playerid][pAccount] -= amount;
}
}
format(string, 128, "Old Balance: $%d | New Balance: $%d", account - checks, PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid,0x4D903DAA,"---------------------------------------------------------------");
format(string, 128, "~g~PayDay~n~~w~Check paid into your account");
GameTextForPlayer(playerid, string, 5000, 1);
rent = 0;
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
if((4+(PlayerInfo[playerid][pLevel]*8)) == PlayerInfo[playerid][pConnectTime])
{
PlayerInfo[playerid][pConnectTime] += 1;
}
new LevScore;
LevScore = PlayerInfo[playerid][pConnectTime];
SetPlayerScore(playerid,LevScore);
if(ConnectUpgrade(PlayerInfo[playerid][pConnectTime]))
{
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay.");
}
}
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hBreakTime] > 0)
{
HouseInfo[h][hBreakTime]--;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
return 1;
}
Hello, guys. This is my payday code.
I would like to do the following things.
1. The player has more than 30k (in the bank and cash - both) AND has a job - Do not receive "Welfare" (welfare is the check value), receive only salary (bonus check value).
2. The player has more than 30k (in the bank and cash - both) AND do NOT has a job. - Do not receive "Welfare" (welfare is the check value), in result, receive nothing.
3. The player has less than 30k (in the bank and cash - both) AND has a job. - Receive "Welfare" (welfare is the check value) + Salary (bonus check value).
4. The player has less than 30k (in the bank and cash - both) AND do NOT has a job. - Receive only "Welfare" (welfare is the check value).
Thank you all in advance.
Re: PAYDAY System. Welfare . Help. -
Infinity90 - 15.06.2012
Wrong section, post it in the request thread.
https://sampforum.blast.hk/showthread.php?tid=187229
Re: PAYDAY System. Welfare . Help. -
PhoeNiX778 - 16.06.2012
Can someone help me?
Re: PAYDAY System. Welfare . Help. -
PhoeNiX778 - 17.06.2012
PLEASE help me if you can.
Re: PAYDAY System. Welfare . Help. -
PhoeNiX778 - 17.06.2012
BUMP
Re: PAYDAY System. Welfare . Help. -
PhoeNiX778 - 18.06.2012
BUMP
Re: PAYDAY System. Welfare . Help. -
PhoeNiX778 - 18.06.2012
BUMP
Re: PAYDAY System. Welfare . Help. -
A7X_CEEJAY - 18.06.2012
You're a bit impatient, I'm not going to do this but I will however give you the snippets needed.
pawn Код:
if(PlayerInfo[playerid][pAccount] >= 30000 && PlayerInfo[playerid][pMember] != 0)
That's if they have over 30 grand + has job.
pawn Код:
if(PlayerInfo[playerid][pAccount] >= 30000 && PlayerInfo[playerid][pMember] == 0)
Over 30 grand but dont have job.
pawn Код:
if(PlayerInfo[playerid][pAccount] < 30000 && PlayerInfo[playerid][pMember] != 0)
That's if they have less than 30 grand + has job.
pawn Код:
if(PlayerInfo[playerid][pAccount] < 30000 && PlayerInfo[playerid][pMember] == 0)
Less 30 grand but dont have job.
Now for being so impatient, you can work where to put them yourself.