Jump to content

Nu se da ore la payday


RazvanCZ
 Share

Recommended Posts


// PAYDAY SAVE
DestroyNeon(playerid, OwnedVeh(personalcar[0][playerid]));
DestroyNeon(playerid, OwnedVeh(personalcar[1][playerid]));
DestroyNeon(playerid, OwnedVeh(personalcar[2][playerid]));
DestroyNeon(playerid, OwnedVeh(personalcar[3][playerid]));
DestroyNeon(playerid, OwnedVeh(personalcar[4][playerid]));
DestroyNeon(playerid, OwnedVeh(personalcar[5][playerid]));
PinLogged[playerid] = 0;
if(gPlayerLogged[playerid] != 0)
{
OnPlayerDateUpdateX2(playerid);
Update(playerid, pPayDayx);
Update(playerid, pPayCheckx);
Update(playerid, pFpunishx);
Update(playerid, pConnectTimex);
Update(playerid, pLawyerx);
Update(playerid, pBank);
Update(playerid, pCashx);
Update(playerid, pRP);
Update(playerid, pJailTimex);
Update(playerid, pLevelx);
Update(playerid, pCommandsx);
Update(playerid, pPremiumPointsx);
Update(playerid, pEurox);
Update(playerid, pStatsx);

Update(playerid, pQuestx);
Update(playerid, pQuestProgressx);
}
Link to comment
Share on other sites

	// PAYDAY SAVE
	DestroyNeon(playerid, OwnedVeh(personalcar[0][playerid]));
	DestroyNeon(playerid, OwnedVeh(personalcar[1][playerid]));
	DestroyNeon(playerid, OwnedVeh(personalcar[2][playerid]));
	DestroyNeon(playerid, OwnedVeh(personalcar[3][playerid]));
	DestroyNeon(playerid, OwnedVeh(personalcar[4][playerid]));
	DestroyNeon(playerid, OwnedVeh(personalcar[5][playerid]));
	PinLogged[playerid] = 0;
    if(gPlayerLogged[playerid] != 0)
	{
		OnPlayerDateUpdateX2(playerid);
		Update(playerid, pPayDayx);
		Update(playerid, pPayCheckx);
		Update(playerid, pFpunishx);
		Update(playerid, pConnectTimex);
		Update(playerid, pLawyerx);
		Update(playerid, pBank);
		Update(playerid, pCashx);
		Update(playerid, pRP);
		Update(playerid, pJailTimex);
		Update(playerid, pLevelx);
		Update(playerid, pCommandsx);
		Update(playerid, pPremiumPointsx);
		Update(playerid, pEurox);
		Update(playerid, pStatsx);

		Update(playerid, pQuestx);
		Update(playerid, pQuestProgressx);
	}

Vreau toata functia payday, nu doar aia save.

Edited by LolyAdv
Link to comment
Share on other sites

Nu inteleg.... Nu poti sa zici ce sa caut , tre sa dau chiar tot..

Iti este lene sa copii tot public PayDay sau function PayDay sau cum ai tu si sa pui aici? Da-mi-l si-l modific eu daca are vreo problema.

Link to comment
Share on other sites


public PayDay()
{
new string[128],
str[256],
string3[128],
interest,
account[MAX_PLAYERS],
hour,
minn,
sec,
expamount,
rent[MAX_PLAYERS];
gettime(hour,minn,sec);
foreach(Player,i)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLevel] >= 0)
{
new wakaname[25];
GetPlayerName(i,wakaname,sizeof(wakaname));
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
new rand;
rand = random(sizeof(gRandomJailSpawns));
SetPlayerInterior(i, 6);
SetPlayerPosEx(i,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
PlayerInfo[i][pJailed] = 1;
ResetPlayerWeaponsEx(i);
ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
Update(i,pJailedx);
Update(i,pJailTimex);
TogglePlayerControllable(i, 0);
SetTimerEx("UnFreezeStation", 1000, false, "i", i);
}
new key = PlayerInfo[i][pPhousekey];
if(key != 999)
{
rent[i] = HouseInfo[key][hRent];
if(rent[i] > GetPlayerCash(i) && strcmp(PlayerInfo[i][pNormalName], HouseInfo[key][hOwner], false) == 0)
{
PlayerInfo[i][pPhousekey] = 999;
Update(i,pPhousekeyx);
}
HouseInfo[key][hTakings] += rent[i];
mysql_format(SQL,str,sizeof(str),"UPDATE `houses` SET `Takings`='%d' WHERE `ID`='%d'",HouseInfo[key][hTakings],key);
mysql_tquery(SQL,str,"","");
}
new tmpintrate;
if(PlayerInfo[i][pPremiumAccount] == 1)
{
tmpintrate = 2;
new bonus = PlayerInfo[i][pPayCheck] / 2;
PlayerInfo[i][pPayCheck] += bonus;
}
else
{
tmpintrate = 1;
}
account[i] = PlayerInfo[i][pAccount];
Tax += TaxValue;
PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck];
PlayerInfo[i][pAccount] += checks;
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
new finalinterest;
SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
SendClientMessage(i, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money.");
new stringsu[256];
if(PlayerInfo[i][pRob] < 20)
{
PlayerInfo[i][pRob]++;
}
else
{
SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.");
}
if(PlayerInfo[i][pPayDay] >= 1800)
{
PlayerInfo[i][pConnectTime] += 1;
//Update(i, pConnectTimex);
finalinterest = interest;
PlayerInfo[i][pPayDay] = 0;
//Update(i, pPayDayx);
PlayerInfo[i][pPaydayLuat] += 1;
//Update(i, pPaydayLuatx);
if(PlayerInfo[i][pGiftTime] > 0)
{
PlayerInfo[i][pGiftTime] -= 1;
Update(i, pGiftTimex);
}
if(PlayerInfo[i][pPremiu] > 0)
{
PlayerInfo[i][pPremiu] -= 1;
Update(i, pPremiux);
}
}
else
{
finalinterest = interest / 2;
format(stringsu,sizeof(stringsu),"Ai primit doar jumatate din dobanda de la banca pentru ca ai jucat doar %d minute din aceasta ora (31 necesare pentru dobanda intreaga).",PlayerInfo[i][pPayDay]/60+1);
SendSplitMessage(i, COLOR_LIGHTBLUE, stringsu);
}
PlayerInfo[i][pExp] += 1;
PlayerInfo[i][pAccount] += finalinterest;
format(string, sizeof(string), "Paycheck: $%s | Bank balance: $%s | Bank interest: $%s | Tax: $%s (10 percent)", FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue));
SendClientMessage(i, COLOR_GREY, string);
format(string3, sizeof(string3), "Rent: $%s | Total earnings: $%d", FormatNumber(rent[i]), checks-TaxValue);
SendClientMessage(i, COLOR_GREY, string3);
SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
format(string, sizeof(string), "~y~PAYDAY");
GameTextForPlayer(i, string, 5000, 1);
if(PlayerInfo[i][pPremiu] == 0)
{
SendClientMessage(i, COLOR_WHITE, "Tasteaza comanda /premiu deoarece ai primit acces.");
}
if(PlayerInfo[i][pMember] >= 0)
{
PlayerInfo[i][pPaydayuri] += 1;
Update(i, pPaydayurix);
}
if(PlayerInfo[i][pCarLicT] > 0)
{
PlayerInfo[i][pCarLicT] -= 1;
}
if(PlayerInfo[i][pFlyLicT] > 0)
{
PlayerInfo[i][pFlyLicT] -= 1;
}
if(PlayerInfo[i][pBoatLicT] > 0)
{
PlayerInfo[i][pBoatLicT] -= 1;
}
if(PlayerInfo[i][pGunLicT] > 0)
{
PlayerInfo[i][pGunLicT] -= 1;
}
if(PlayerInfo[i][pFpunish] > 0)
{
PlayerInfo[i][pFpunish]--;
}
if(PlayerInfo[i][pFpunish] < 0)
{
PlayerInfo[i][pFpunish] = 0;
}
if(PlayerInfo[i][pCarLicSuspend] > 0)
{
PlayerInfo[i][pCarLicSuspend]--;
Update(i, pCarLicSuspendx);
if(PlayerInfo[i][pCarLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent. Acum poti merge din nou la scoala de soferi pentru a lua licenta din nou.");
}
if(PlayerInfo[i][pGunLicSuspend] > 0)
{
PlayerInfo[i][pGunLicSuspend]--;
Update(i, pGunLicSuspendx);
if(PlayerInfo[i][pGunLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent. Acum poti da din nou testul cu un instructor pentru a lua licenta din nou.");
}
if(IsACop(i))
{
PlayerInfo[i][pLawyer] += 1;
}
PlayerInfo[i][pPayCheck] = 0;
if(PlayerInfo[i][pLevel] == 1 || PlayerInfo[i][pLevel] == 2 || PlayerInfo[i][pLevel] == 3 || PlayerInfo[i][pLevel] == 4)
{
expamount = PlayerInfo[i][pLevel]*2;
if(PlayerInfo[i][pExp] >= expamount)
{
SCM(i,COLOR_LIGHTBLUE,"Poti tasta comanda /buylevel.");
}
}
else if(PlayerInfo[i][pLevel] >= 5)
{
expamount = PlayerInfo[i][pLevel]*3;
if(PlayerInfo[i][pExp] >= expamount)
{
SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
}
}
}
}
}
for(new x = 0; x < MAX_GROUPS; x++)
{
DynamicFactions[x][fBank] += DynamicFactions[x][fPaydayMoney];
mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);
mysql_tquery(SQL,str,"","");
}
return 1;
}
Link to comment
Share on other sites

poftim:

public PayDay()
{
	new string[128],
		str[256],
		string3[128],
		interest,
		account[MAX_PLAYERS],
		hour,
		minn,
		sec,
		expamount,
		rent[MAX_PLAYERS];
	gettime(hour,minn,sec);
	foreach(Player,i)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerInfo[i][pLevel] >= 0)
		    {
            	new wakaname[25];
                GetPlayerName(i,wakaname,sizeof(wakaname));
			    if(MoneyMessage[i]==1)
				{
				    SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
                    new rand;
					rand = random(sizeof(gRandomJailSpawns));
					SetPlayerInterior(i, 6);
					SetPlayerPosEx(i,gRandomJailSpawns[rand][0],gRandomJailSpawns[rand][1],gRandomJailSpawns[rand][2]);
		            PlayerInfo[i][pJailed] = 1;
		            ResetPlayerWeaponsEx(i);
		            ResetPlayerWeapons(i);
					WantedPoints[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_LIGHTBLUE, string);
					Update(i,pJailedx);
					Update(i,pJailTimex);
					TogglePlayerControllable(i, 0);
					SetTimerEx("UnFreezeStation", 1000, false, "i", i);
				}
				new key = PlayerInfo[i][pPhousekey];
				if(key != 999)
				{
					rent[i] = HouseInfo[key][hRent];
					if(rent[i] > GetPlayerCash(i) && strcmp(PlayerInfo[i][pNormalName], HouseInfo[key][hOwner], false) == 0)
					{
						PlayerInfo[i][pPhousekey] = 999;
						Update(i,pPhousekeyx);
					}
					HouseInfo[key][hTakings] += rent[i];
				    mysql_format(SQL,str,sizeof(str),"UPDATE `houses` SET `Takings`='%d' WHERE `ID`='%d'",HouseInfo[key][hTakings],key);
				    mysql_tquery(SQL,str,"","");
				}
				new tmpintrate;
				if(PlayerInfo[i][pPremiumAccount] == 1)
				{
					tmpintrate = 2;
	    			new bonus = PlayerInfo[i][pPayCheck] / 2;
				    PlayerInfo[i][pPayCheck] += bonus;
				}
				else
				{
					tmpintrate = 1;
				}
				account[i] = PlayerInfo[i][pAccount];
				Tax += TaxValue;
    			PlayerInfo[i][pAccount] -= TaxValue;
				new checks = PlayerInfo[i][pPayCheck];
    			PlayerInfo[i][pAccount] += checks;
				interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
				new finalinterest;
				SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
				SendClientMessage(i, COLOR_WHITE, "Your paycheck has arrived; please visit the bank to withdraw your money.");
				new stringsu[256];
				if(PlayerInfo[i][pRob] < 20)
    			{
       				PlayerInfo[i][pRob]++;
           		}
           		else
           		{
           		    SendClientMessage(i, COLOR_WHITE, "Nu ai primit niciun rob/free point pentru ca ai deja 20 rob/free points.");
				}
                if(PlayerInfo[i][pPayDay] >= 1800)
				{
				    PlayerInfo[i][pConnectTime] += 1;
				    Update(i, pConnectTimex);
				    finalinterest = interest;
				    PlayerInfo[i][pPayDay] = 0;
				    //Update(i, pPayDayx);
				    PlayerInfo[i][pPaydayLuat] += 1;
				    //Update(i, pPaydayLuatx);
				    if(PlayerInfo[i][pGiftTime] > 0)
				    {
				        PlayerInfo[i][pGiftTime] -= 1;
				        Update(i, pGiftTimex);
					}
				    if(PlayerInfo[i][pPremiu] > 0)
				    {
						PlayerInfo[i][pPremiu] -= 1;
						Update(i, pPremiux);
					}
				}
				else
				{
				    finalinterest = interest / 2;
				    format(stringsu,sizeof(stringsu),"Ai primit doar jumatate din dobanda de la banca pentru ca ai jucat doar %d minute din aceasta ora (31 necesare pentru dobanda intreaga).",PlayerInfo[i][pPayDay]/60+1);
				    SendSplitMessage(i, COLOR_LIGHTBLUE, stringsu);
				}
				PlayerInfo[i][pExp] += 1;
				PlayerInfo[i][pAccount] += finalinterest;
				format(string, sizeof(string), "Paycheck: $%s | Bank balance: $%s | Bank interest: $%s | Tax: $%s (10 percent)", FormatNumber(checks), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(finalinterest), FormatNumber(TaxValue));
				SendClientMessage(i, COLOR_GREY, string);
				format(string3, sizeof(string3), "Rent: $%s | Total earnings: $%d", FormatNumber(rent[i]), checks-TaxValue);
				SendClientMessage(i, COLOR_GREY, string3);
				SendClientMessage(i, COLOR_TEAL, "----------------------------------------------------------------------------");
				format(string, sizeof(string), "~y~PAYDAY");
				GameTextForPlayer(i, string, 5000, 1);
				if(PlayerInfo[i][pPremiu] == 0)
				{
					SendClientMessage(i, COLOR_WHITE, "Tasteaza comanda /premiu deoarece ai primit acces.");
				}
				if(PlayerInfo[i][pMember] >= 0)
				{
					PlayerInfo[i][pPaydayuri] += 1;
					Update(i, pPaydayurix);
				}
				if(PlayerInfo[i][pCarLicT] > 0)
				{
					PlayerInfo[i][pCarLicT] -= 1;
				}
				if(PlayerInfo[i][pFlyLicT] > 0)
				{
					PlayerInfo[i][pFlyLicT] -= 1;
				}
				if(PlayerInfo[i][pBoatLicT] > 0)
				{
					PlayerInfo[i][pBoatLicT] -= 1;
				}
				if(PlayerInfo[i][pGunLicT] > 0)
				{
					PlayerInfo[i][pGunLicT] -= 1;
				}
				if(PlayerInfo[i][pFpunish] > 0)
				{
					PlayerInfo[i][pFpunish]--;
		 		}
		 		if(PlayerInfo[i][pFpunish] < 0)
		 		{
	    			PlayerInfo[i][pFpunish] = 0;
				}
				if(PlayerInfo[i][pCarLicSuspend] > 0)
				{
					PlayerInfo[i][pCarLicSuspend]--;
					Update(i, pCarLicSuspendx);
					if(PlayerInfo[i][pCarLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de condus a fost confiscata recent. Acum poti merge din nou la scoala de soferi pentru a lua licenta din nou.");
				}
				if(PlayerInfo[i][pGunLicSuspend] > 0)
				{
					PlayerInfo[i][pGunLicSuspend]--;
					Update(i, pGunLicSuspendx);
					if(PlayerInfo[i][pGunLicSuspend] == 0) SendClientMessage(i, COLOR_YELLOW, "* Licenta ta de arme a fost confiscata recent. Acum poti da din nou testul cu un instructor pentru a lua licenta din nou.");
				}
   				if(IsACop(i))
				{
    				PlayerInfo[i][pLawyer] += 1;
				}
				PlayerInfo[i][pPayCheck] = 0;
				if(PlayerInfo[i][pLevel] == 1 || PlayerInfo[i][pLevel] == 2 || PlayerInfo[i][pLevel] == 3 || PlayerInfo[i][pLevel] == 4)
				{
    				expamount = PlayerInfo[i][pLevel]*2;
					if(PlayerInfo[i][pExp] >= expamount)
					{
	    				SCM(i,COLOR_LIGHTBLUE,"Poti tasta comanda /buylevel.");
					}
				}
				else if(PlayerInfo[i][pLevel] >= 5)
				{
    				expamount = PlayerInfo[i][pLevel]*3;
					if(PlayerInfo[i][pExp] >= expamount)
					{
	    				SCM(i,COLOR_LIGHTBLUE,"** You can use buylevel because you have necessary respect points.");
					}
				}
			}
		}
	}
	for(new x = 0; x < MAX_GROUPS; x++)
	{
	    DynamicFactions[x][fBank] += DynamicFactions[x][fPaydayMoney];
	    mysql_format(SQL,str,sizeof(str),"UPDATE `factions` SET `Bank`='%d' WHERE `ID`='%d'",DynamicFactions[x][fBank],x);
		mysql_tquery(SQL,str,"","");
	}
	return 1;
}
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...