[POMOC]PayDay

Započeo |Xeptic| Führer, April 26, 2011, 08:29:38 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:ravens
Detaljan opis problema:Kad dode placa nedobije se respekt
Dio skripte:
public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && !IsPlayerNPC(i))
		{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    new bank = PlayerInfo[i][pAccount];
				    SendClientMessage(i, COLOR_LIGHTRED, "Niste odplatili dug, vrijeme zatvora.");
				    GameTextForPlayer(i, "~r~Uhicen!", 2000, 1);
				    SafeSetPlayerInterior(i, 6);
			   		SafeSetPlayerPos(i, 264.6288,77.5742,1001.0391);
		            PlayerInfo[i][pJailed] = 1;
		            SafeResetPlayerWeapons(i);
		            SafeResetPlayerMoney(i);
					SafeGivePlayerMoney(i, 1);
					WantedPoints[i] = 0;
					PlayerInfo[i][pAccount] = (bank + DebtMoney[i]);
					DebtMoney[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					TextDrawShowForPlayer(i, Textdraw1[i]);
					format(string, sizeof(string), "Zatvoreni ste na %d sekundi.   Jamstvo: Nemoguce", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new key = PlayerInfo[i][pPhousekey];
				if(key != 999)
				{
					rent = HouseInfo[key][hRent];
					if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
					{
						rent = 0;
					}
					else if(rent > GetPlayerMoney(i))
					{
						PlayerInfo[i][pPhousekey] = 999;
						SendClientMessage(i, COLOR_WHITE, "Iseljeni ste.");
						rent = 0;
					}
					HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
				}
				new tmpintrate;
				if (key != 999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
				}
				else
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = 3; }
					else { tmpintrate = 1; }
				}
				if(PlayerInfo[i][pPayDay] >= 1337)
				{
				    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
					new checks = PlayerInfo[i][pPayCheck] / 5;
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 10;
					    checks += bonus;
					}
				    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
				    account += 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_GREEN, "|___ Izvijesce banke ___|");
					format(string, sizeof(string), "  Iznos place: $%d   Porez: -$%d", checks, TaxValue);
					SendClientMessage(i, COLOR_WHITE, string);
					if(PlayerInfo[i][pPhousekey] != 999 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(string, sizeof(string), "  Struja: -$%d", ebill);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
					format(string, sizeof(string), "  Stanje: $%d", account - checks);
					SendClientMessage(i, COLOR_WHITE, string);
					format(string, sizeof(string), "  Kamatna stopa: 0.%d posto",tmpintrate);
					SendClientMessage(i, COLOR_GRAD2, string);
					format(string, sizeof(string), "  Kamate: $%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
					format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  Rent: -$%d", rent);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "~y~Stigla je placa~n~~w~Novac je sjeo na vas racun");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					if(FarmerVar[i] == 0)
					{
						FarmerPickup[i][0] = 0;
					}
					if(DrugFarmerVar[i] == 0)
					{
						DrugFarmerPickup[i][0] = 0;
					}
					if(SmugglerWork[i] == 0)
					{
						PayDaySecure[i] = 0;
					}
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 1337)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* Nisi igrao dovoljno dugo da dobijes placu.");
				}
			}
		}
	}


Neke slike/video za lakse dobivanje pomoci(neobavezno):/

Fali ti jedan ceo deo koji sacuvava Acc:
Kod: c
SaveAccounts();
new rand = random(2500); rand += 1245;
Jackpot += rand;
SaveStuff();
SaveAnticheat();
format(string, sizeof(string), "Lottery News: Our New Jackpot has been increased to $%d.", Jackpot);
OOCOff(COLOR_WHITE, string);
return 1;

Uzmi opet iz originala i samo prevedi i obrisi ovo Lottery news i jackpot i new rand (ako neces Loto) ostalo ostavi i opet prevedi  :-X


PS. Mozda si obrisao timer za PayDay  ???
Poslednja Izmena: April 26, 2011, 10:28:41 PRE PODNE od eXtreme

Evo i jos nece da radi + igram 30 min i dode payday i pise mi da nisam dovoljno igro ....

public PayDay()
{
	new string[128];
	new account,interest;
	new rent = 0;
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) && !IsPlayerNPC(i))
		{
		    if(PlayerInfo[i][pLevel] > 0)
		    {
			    if(MoneyMessage[i]==1)
				{
				    new bank = PlayerInfo[i][pAccount];
				    SendClientMessage(i, COLOR_LIGHTRED, "Niste odplatili dug, vrijeme zatvora.");
				    GameTextForPlayer(i, "~r~Uhicen!", 2000, 1);
				    SafeSetPlayerInterior(i, 6);
			   		SafeSetPlayerPos(i, 264.6288,77.5742,1001.0391);
		            PlayerInfo[i][pJailed] = 1;
		            SafeResetPlayerWeapons(i);
		            SafeResetPlayerMoney(i);
					SafeGivePlayerMoney(i, 1);
					WantedPoints[i] = 0;
					PlayerInfo[i][pAccount] = (bank + DebtMoney[i]);
					DebtMoney[i] = 0;
					PlayerInfo[i][pJailTime] = 240;
					TextDrawShowForPlayer(i, Textdraw1[i]);
					format(string, sizeof(string), "Zatvoreni ste na %d sekundi.   Jamstvo: Nemoguce", PlayerInfo[i][pJailTime]);
					SendClientMessage(i, COLOR_WHITE, string);
				}
				new playername2[MAX_PLAYER_NAME];
				GetPlayerName(i, playername2, sizeof(playername2));
				account = PlayerInfo[i][pAccount];
				new key = PlayerInfo[i][pPhousekey];
				if(key != 999)
				{
					rent = HouseInfo[key][hRent];
					if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
					{
						rent = 0;
					}
					else if(rent > GetPlayerMoney(i))
					{
						PlayerInfo[i][pPhousekey] = 999;
						SendClientMessage(i, COLOR_WHITE, "Iseljeni ste.");
						rent = 0;
					}
					HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
				}
				new tmpintrate;
				if (key != 999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = intrate+4; }
					else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
				}
				else
				{
				    if(PlayerInfo[i][pRegularRank] > 0) { tmpintrate = 3; }
					else { tmpintrate = 1; }
				}
				if(PlayerInfo[i][pPayDay] >= 1337)
				{
				    Tax += TaxValue;//Should work for every player online
				    PlayerInfo[i][pAccount] -= TaxValue;
					new checks = PlayerInfo[i][pPayCheck] / 5;
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    new bonus = PlayerInfo[i][pPayCheck] / 10;
					    checks += bonus;
					}
				    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
				    account += 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_GREEN, "|___ Izvijesce banke ___|");
					format(string, sizeof(string), "  Iznos place: $%d   Porez: -$%d", checks, TaxValue);
					SendClientMessage(i, COLOR_WHITE, string);
					if(PlayerInfo[i][pPhousekey] != 999 || PlayerInfo[i][pPbiskey] != 255)
					{
					    format(string, sizeof(string), "  Struja: -$%d", ebill);
						SendClientMessage(i, COLOR_GRAD1, string);
					}
					format(string, sizeof(string), "  Stanje: $%d", account - checks);
					SendClientMessage(i, COLOR_WHITE, string);
					format(string, sizeof(string), "  Kamatna stopa: 0.%d posto",tmpintrate);
					SendClientMessage(i, COLOR_GRAD2, string);
					format(string, sizeof(string), "  Kamate: $%d", interest);
					SendClientMessage(i, COLOR_GRAD3, string);
					SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
					format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[i][pAccount]);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "  Rent: -$%d", rent);
					SendClientMessage(i, COLOR_GRAD5, string);
					format(string, sizeof(string), "~y~Stigla je placa~n~~w~Novac je sjeo na vas racun");
					GameTextForPlayer(i, string, 5000, 1);
					rent = 0;
					PlayerInfo[i][pPayDay] = 0;
					PlayerInfo[i][pPayCheck] = 0;
					if(FarmerVar[i] == 0)
					{
						FarmerPickup[i][0] = 0;
					}
					if(DrugFarmerVar[i] == 0)
					{
						DrugFarmerPickup[i][0] = 0;
					}
					if(SmugglerWork[i] == 0)
					{
						PayDaySecure[i] = 0;
					}
					if(PlayerInfo[i][pRegularRank] > 0)
					{
					    PlayerInfo[i][pPayDayHad] += 1;
					    if(PlayerInfo[i][pPayDayHad] >= 1337)
					    {
					        PlayerInfo[i][pExp]++;
					        PlayerInfo[i][pPayDayHad] = 0;
					    }
					}
				}
				else
				{
				    SendClientMessage(i, COLOR_WHITE, "* Nisi igrao dovoljno dugo da dobijes placu.");
				}
			}
		}
	}
	SaveAccounts();
	Checkprop();
	new rand = random(2500); rand += 1245;
   	Jackpot += rand;
    SaveStuff();
    SaveAnticheat();
    format(string, sizeof(string), "Lotto Vijesti: Novi jackpot je narastao na $%d.", Jackpot);
	OOCOff(COLOR_WHITE, string);
	return 1;
}

Moras igrati sat vremena!
Msm tako je na GF i GF editima  :o
Poslednja Izmena: April 26, 2011, 15:12:58 POSLE PODNE od eXtreme

Sve je to ok al ja sam ostavio bio lika u server najmanje 2 h i ja sam MTA radio mapu i pogledaj ja proÄ'oÅ¡e negdje oko 1:30 min i opet isto pise .

Citat: Apokalipsa poslato April 26, 2011, 15:14:34 POSLE PODNE
Sve je to ok al ja sam ostavio bio lika u server najmanje 2 h i ja sam MTA radio mapu i pogledaj ja proÄ'oÅ¡e negdje oko 1:30 min i opet isto pise .

Neznam onda nebavim se ja toliko tim GF to pre dok nisam puno znao sam skriptao ali sad nemogu da se snadjem u njemu...
Sigurno ce ti neko pomoci... Ja cu malo da procackam po Larp modu pa cu ti reci..

Ok Hvala


E imali ovo veze s time ovo sam naso pod OnPlayerConnect ima 2x to

PlayerInfo[playerid][pPayDay] = 0;
Poslednja Izmena: April 26, 2011, 15:21:41 POSLE PODNE od Apokalipsa