Jump to content
  • 0

[GF/RP] Problema payday


hopingsteam

Question

De ce unele payday-uri se rateaza ... nu stiu  :cry:

[pawn]forward PayDay();[/pawn]

[pawn]public SyncTime()

{

new tmphour;

new tmpminute;

new tmpsecond;

gettime(tmphour, tmpminute, tmpsecond);

FixHour(tmphour);

tmphour = shifthour;

if ((tmphour > ghour) || (tmphour == 0 && ghour == 24))

{

ghour = tmphour;

PayDay();

if (realtime)

{

SetWorldTime(tmphour);

}

}

}[/pawn]

[pawn]public PayDay()

{

new string[128];

new account,interest;

new rent = 0;

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

    if(PlayerInfo[pLevel] > 0)

    {

    if(MoneyMessage==1)

{

    SendClientMessage(i, COLOR_1RED, "Nu ti-ai putut plati datoria !");

    GameTextForPlayer(i, "~r~Busted!", 2000, 1);

    SetPlayerInterior(i, 10);

    PlayerInfo[pInt] = 10;

  SetPlayerPos(i, -1113.7158,-973.2684,129.3254);

            PlayerInfo[pJailed] = 1;

SetPlayerSkin(i, 62);

            ResetPlayerWeapons(i);

            ResetPlayerMoney(i);

WantedPoints = 0;

PlayerInfo[pJailTime] = 300;

format(string, sizeof(string), "Esti la inchisoare pentru %d secunde.", PlayerInfo[pJailTime]);

SendClientMessage(i, COLOR_WHITE, string);

}

new playername2[MAX_PLAYER_NAME];

GetPlayerName(i, playername2, sizeof(playername2));

account = PlayerInfo[pAccount];

new key = PlayerInfo[pPhousekey];

if(key != 255)

{

rent = HouseInfo[key][hRent];

if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)

{

rent = 0;

}

else if(rent > GetPlayerCash(i))

{

PlayerInfo[pPhousekey] = 255;

SendClientMessage(i, COLOR_WHITE, "Ai fost evacuat.");

rent = 0;

}

HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;

}

new tmpintrate;

if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)

{

if(PlayerInfo[pDonateRank] > 0) { tmpintrate = intrate+4; }

else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]

}

else

{

if(PlayerInfo[pDonateRank] > 0) { tmpintrate = 3; }

else { tmpintrate = 1; }

}

Tax += TaxValue;//Should work for every player online

PlayerInfo[pAccount] -= TaxValue;

new checks = PlayerInfo[pPayCheck] / 5;

if(PlayerInfo[pDonateRank] > 0)

{

new bonus = PlayerInfo[pPayCheck] / 10;

checks += bonus;

}

new ebill = (PlayerInfo[pAccount]/10000)*(PlayerInfo[pLevel]);

ConsumingMoney = 1;

GivePlayerCash(i, checks);

if(PlayerInfo[pAccount] > 0)

{

PlayerInfo[pAccount] -= ebill;

SBizzInfo[4][sbTill] += ebill;

}

else

{

ebill = 0;

}

interest = (PlayerInfo[pAccount]/1000)*(tmpintrate);

PlayerInfo[pExp]++;

PlayerPlayMusic(i);

PlayerInfo[pAccount] = account+interest;

SendClientMessage(i, COLOR_GREEN, "|________BANK STATMENT________|");

format(string, sizeof(string), "  Paycheck: $%d  Tax Money: -$%d", checks, TaxValue);

SendClientMessage(i, COLOR_WHITE, string);

if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPbiskey] != 255)

{

format(string, sizeof(string), "  Electricitatea: -$%d", ebill);

SendClientMessage(i, COLOR_GRAD1, string);

}

format(string, sizeof(string), "  Cont: $%d", account - checks);

SendClientMessage(i, COLOR_WHITE, string);

format(string, sizeof(string), "  Rata: 0.%d percent",tmpintrate);

SendClientMessage(i, COLOR_GRAD2, string);

format(string, sizeof(string), "  Banii primiti: $%d", interest);

SendClientMessage(i, COLOR_GRAD3, string);

SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");

format(string, sizeof(string), "  Noul cont: $%d", PlayerInfo[pAccount]);

SendClientMessage(i, COLOR_GRAD5, string);

format(string, sizeof(string), "  Chiria: -$%d", rent);

SendClientMessage(i, COLOR_GRAD5, string);

format(string, sizeof(string), "~y~PayDay~n~~w~Verifica-ti contul !");

GameTextForPlayer(i, string, 5000, 1);

rent = 0;

PlayerInfo[pPayDay] = 0;

PlayerInfo[pRob] += 1;

PlayerInfo[pPayCheck] = 0;

PlayerInfo[pConnectTime] += 1;

if(PlayerInfo[pDonateRank] > 0)

{

PlayerInfo[pPayDayHad] += 1;

if(PlayerInfo[pPayDayHad] >= 5)

{

PlayerInfo[pExp]++;

PlayerInfo[pPayDayHad] = 0;

}

}

if(PlayerInfo[pFpunish] > 0)

{

    PlayerInfo[pFpunish] -= 1;

}

if(PlayerInfo[pMember] == 17 || PlayerInfo[pLeader] == 17)

  {

    PlayerInfo[pTow] += 5;

      }

}

}

}

SaveAccounts();

Checkprop();

return 1;

}[/pawn]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

[pawn]

forward PayDayFixed();

//cauta "pGunLic," dedesub adauga

pPayDayError,

//Cauta "PlayerInfo[playerid][pGunLic] = 0;" si adauga dedesupt:

PlayerInfo[playerid][pPayDayError] = 1;

//Cauta in gm "format(var, 32, "GunLic=%Z" si adauga dedesupt

format(var, 32, "PayDayError=%d\n",PlayerInfo[playerid][pPayDayError]);fwrite(hFile, var); //vei gasi de doua ori

//Cauta if( strcmp( key , "GunLic" , true ) ==  adauga:

if( strcmp( key , "PayDayError" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPayDayError] = strval( val ); }

//pe la sfarsit adaugi

public PayDayFixed()

{

    for(new i = 0; i < MAX_PLAYERS; i++)

    {

        PlayerInfo[pPayDayError] = 1;

}

}

[/pawn]

SyncTime ar trebui sa arate cam asa:

[pawn]

public SyncTime()

{

    for(new i = 0; i < MAX_PLAYERS; i++)

{

    if(PlayerInfo[pPayDayError] == 1)

    {

new string[64];

new hour;

new minute;

new seconds;

gettime(hour, minute, seconds);

if(hour>=0&&hour<=23&&minute==0&&seconds==0)

{

format(string, sizeof(string), "SERVER: The time is now %d:%d:%d hours",hour,minute,seconds);

SendClientMessage(i,COLOR_WHITE,string);

PayDay();

PlayerInfo[pPayDayError] = 0;

SetTimer("PayDayFixed", 10000,0);

SetTimer("MetheoUpdate",1000,0);

if (realtime)

{

SetWorldTime(hour);

}

}

}

}

}[/pawn]

Stiu si eu ... branza e pe bani, dar eu tot ma joc pe gratis!

Link to comment
Share on other sites

Ia vezi daca merge asa:

public SyncTime()
{
	new string[64];
	new tmphour;
	new tmpminute;
	new tmpsecond;
	gettime(tmphour, tmpminute, tmpsecond);
	FixHour(tmphour);
	tmphour = shifthour;
	if ((tmphour > ghour) || (tmphour == 0 && ghour == 23))
	{
		format(string, sizeof(string), "{FFA500}*GameSpeed:{ffffff} acum este ora %d:00 ",tmphour);
		BroadCast(COLOR_WHITE,string);
		ghour = tmphour;
		PayDay();
		if (realtime)
		{
			SetWorldTime(tmphour);
		}
	}
}
Si:
public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    GameTextForPlayer(i, "~r~Busted!", 2000, 1);
				    SetPlayerInterior(i, 6);
			   		SetPlayerPos(i, 264.6288,77.5742,1001.0391);
		            PlayerInfo[i][pJailed] = 1;
		            ResetPlayerWeapons(i);
					WantedPoints[i] = 0;
					format(string, sizeof(string), "Ai fost pus in inchisoare pentru 4 minute Motiv: Boschetar");
					SendClientMessage(i, COLOR_LIGHTBLUE, string);
					PlayerInfo[i][pJailTime] = 240;
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new key = PlayerInfo[i][pPhousekey];
				if(key != 255)
				{
					rent = HouseInfo[key][hRent];
					if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
					{
						rent = 0;
					}
					else if(rent > GetPlayerMoney(i))
					{
						PlayerInfo[i][pPhousekey] = 255;
						SendClientMessage(i, COLOR_WHITE, "Ai fost dat afara din casa.");
						rent = 0;
					}
					HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
				}
				new tmpintrate;
				if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
				{
				    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
				}
				else
				{
				    if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
					else { tmpintrate = 1; }
				}
				if(PlayerInfo[i][pPayDay] >= 5)
				{
                    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
				    if(PlayerInfo[i][pDonateRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 8;
					    PlayerInfo[i][pPayCheck] += bonus;
					}
					new checks = PlayerInfo[i][pPayCheck];
				    new ebill = (SBizzInfo[4][sbEntranceCost]);
				    ConsumingMoney[i] = 1;
				    GivePlayerMoney(i, checks);
				    if(PlayerInfo[i][pAccount] > 0)
				    {
				    	PlayerInfo[i][pAccount] -= ebill;
				    	SBizzInfo[4][sbTill] += ebill;
					}
					else
					{
					    ebill = 0;
					}
					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
					PlayerInfo[i][pExp]++;
					PlayerPlayMusic(i);
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessage(i, COLOR_WHITE, "{0077ff}|_____________ {509814}Salariul{0077ff} _____________|");
					format(string, sizeof(string), "  {509814}Ai primit cec in valoare de: {ffe600}$%d   {509814}Impozite: {ffe600}$%d", checks, TaxValue);
					SendClientMessage(i, COLOR_GRAD1, string);
					if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(string, sizeof(string), " {509814}Plata electricitate: {ffe600}$%d", ebill);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
					format(string, sizeof(string), "  {509814}Ai in cont: {ffe600}$%d", account);
					SendClientMessage(i, COLOR_GRAD1, string);
					format(string, sizeof(string), "  {509814}Procente: {ffe600}0.%d",tmpintrate);
					SendClientMessage(i, COLOR_GRAD2, string);
					format(string, sizeof(string), "  {509814}Procent primit {ffe600}$%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					format(string, sizeof(string), "  {509814}Ajutor pentru copii din Africa: {ffe600}-$100");
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GRAD4, "{0077ff}|--------------------------------------|");
					format(string, sizeof(string), "  {509814}Suma noua:{ffe600} $%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  {509814}Plata chirie: {ffe600}$%d", rent);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime]++;
					if(PlayerInfo[i][pVipRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
				    if(PlayerInfo[i][pDonateRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 8;
					    PlayerInfo[i][pPayCheck] += bonus;
					}
					new checks = PlayerInfo[i][pPayCheck];
				    new ebill = (SBizzInfo[4][sbEntranceCost]);
				    ConsumingMoney[i] = 1;
				    GivePlayerMoney(i, checks);
				    if(PlayerInfo[i][pAccount] > 0)
				    {
				    	PlayerInfo[i][pAccount] -= ebill;
				    	SBizzInfo[4][sbTill] += ebill;
					}
					else
					{
					    ebill = 0;
					}
					interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
					PlayerInfo[i][pExp]++;
					PlayerPlayMusic(i);
					PlayerInfo[i][pAccount] = account+interest;
					SendClientMessage(i, COLOR_WHITE, "{0077ff}|_______________ {509814}Salariul{0077ff}______________|");
					format(string, sizeof(string), "  {509814}Ai primit cec in valoare de: {ffe600}$%d   {509814}Impozite:{ffe600} -$%d", checks, TaxValue);
					SendClientMessage(i, COLOR_GRAD1, string);
					if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(string, sizeof(string), " {509814}Plata electricitate: {ffe600}-$%d", ebill);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
					format(string, sizeof(string), "  {509814}Ai in cont:{ffe600} $%d", account);
					SendClientMessage(i, COLOR_GRAD1, string);
					format(string, sizeof(string), "  {509814}Procente: {ffe600}0.%d",tmpintrate);
					SendClientMessage(i, COLOR_GRAD2, string);
					format(string, sizeof(string), "  {509814}Procent primit{ffe600} $%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GRAD4, "{0077ff}|--------------------------------------|");
					format(string, sizeof(string), "  {509814}Suma noua: {ffe600}$%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  {509814}Plata chirie: {ffe600}-$%d", rent);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					PlayerInfo[i][pConnectTime]++;
					if(PlayerInfo[i][pVipRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 5)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
			}
		}
	}
	Checkprop();
	return 1;
}

Din a doua scoate ce vrei tu ca eu am pus mai mult sa se dea la pay day.

LISTA - GAMEMODE-URI SA-MP - Le gasiti pe toate aici: http://twiriock.com/3MGP

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.