Skripta koju koristim:FB
Detaljan opis problema: Pokusao sam na mng nacina i ne znam kako da napravim da vikendom dobijaju igraci duple respekte kad bude plata,bez komande da ja palim i gasim to mi ne treba znaci svakog videnda da dobijaju duple respekte i da pise Vikend je dobili ste dupli respekt.
Dio skripte:public PayDay()
{
new string[128];
new Nalog,interest;
new rent = 0;
foreach(Player, i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i] == 1)
{
new bank = PlayerInfo[i][pBankMoney];
SCM(i, COLOR_LIGHTRED, "Niste isplatili vase dugove, idete u zatvor.");
GameTextForPlayer(i, "~r~Uhapseni ste!", 2000, 1);
SafeSetPlayerInterior(i, 6);
new rand = random(sizeof(gPrisonSpawn));
SafeSetPlayerPos(i, gPrisonSpawn[rand][0], gPrisonSpawn[rand][1], gPrisonSpawn[rand][2]);
SetPlayerWorldBounds(i, 266.9, 262.1, 89.2, 74.7);
PlayerInfo[i][pJailed] = 1;
SafeResetPlayerWeapons(i);
SafeResetPlayerMoney(i);
SafeGivePlayerMoney(i, 1);
WantedPoints[i] = 0;
PlayerInfo[i][pBankMoney] = (bank + DebtMoney[i]);
DebtMoney[i] = 0;
PlayerInfo[i][pJailTime] += 240;
TextDrawShowForPlayer(i, Textdraw1[i]);
format(string, sizeof(string), "Zatvoreni ste na %d sekundi. Kaucija: Onemogucena", PlayerInfo[i][pJailTime]);
SCM(i, COLOR_WHITE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
Nalog = PlayerInfo[i][pBankMoney];
new key = PlayerInfo[i][pHouseKey];
if(key != 9999)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoney(i))
{
PlayerInfo[i][pHouseKey] = 9999;
SCM(i, COLOR_WHITE, "Vi ste iseljeni, pronadjite novu kucu.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if(key != 9999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
tmpintrate = intrate+2;//HouseInfo[key][hLevel]
}
else
{
tmpintrate = 1;
}
if(PlayerInfo[i][pPayDay] >= 5)
{
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pBankMoney] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck]/10;
if(PlayerInfo[i][pDonateRank] == 1)
{
new bonus = (PlayerInfo[i][pPayCheck]/10)/4;
checks += bonus;
}
else if(PlayerInfo[i][pDonateRank] == 2)
{
new bonus = (PlayerInfo[i][pPayCheck]/10)/10*4;
checks += bonus;
}
else if(PlayerInfo[i][pDonateRank] == 3)
{
new bonus = (PlayerInfo[i][pPayCheck]/10)/10*7;
checks += bonus;
}
else if(PlayerInfo[i][pDonateRank] == 4)
{
new bonus = PlayerInfo[i][pPayCheck]/10;
checks += bonus;
}
new ebill = (PlayerInfo[i][pBankMoney]/9000)*(PlayerInfo[i][pLevel]);
new porez = (PlayerInfo[i][pBankMoney]/20000)*(PlayerInfo[i][pLevel]);
Nalog += checks;
DrzavniBudzet -= checks;
if(PlayerInfo[i][pBankMoney] > 0)
{
Nalog -= ebill;
sBizzInfo[4][sbTill] += ebill/2;
DrzavniBudzet += ebill/2;
}
else
{
ebill = 0;
}
if(PlayerInfo[i][pDonateRank] < 4)
{
if(PlayerInfo[i][pBankMoney] > 1000000 && key != 9999 || GetPlayerMoney(i) > 1000000 && key != 9999)
{
Nalog -= porez;
DrzavniBudzet += porez;
}
else
{
porez = 0;
}
}
interest = (PlayerInfo[i][pBankMoney]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pBankMoney] = Nalog+interest;
SCM(i, COLOR_GREEN, "|___ Izvestaj Banke ___|");
format(string, sizeof(string), " Plata: $%d Takse: -$%d", checks, TaxValue);
SCM(i, COLOR_WHITE, string);
if(PlayerInfo[i][pHouseKey] != 9999 || PlayerInfo[i][pBizKey] != 9999)
{
format(string, sizeof(string), " Racun za struju: -$%d", ebill);
SCM(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), " Staro stanje: $%d", (Nalog - interest - checks + ebill + porez));
SCM(i, COLOR_WHITE, string);
format(string, sizeof(string), " Kamatna stopa: 0.%d procenata",tmpintrate);
SCM(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Stecen interes $%d", interest);
SCM(i, COLOR_GRAD3, string);
if(PlayerInfo[i][pDonateRank] < 4)
{
if(PlayerInfo[i][pBankMoney] > 1000000 && key != 9999 || GetPlayerMoney(i) > 1000000 && key != 9999)
{
format(string, sizeof(string), " Porez na bogatstvo: -$%d", porez);
SCM(i, COLOR_GRAD1, string);
}
}
if(PlayerInfo[i][pDonateRank] < 3)
{
if(PlayerInfo[i][pCarKey] != 9999 && PlayerInfo[i][pCarKey2] != 9999)
{
PlayerInfo[i][pBankMoney] -= 2000;
DrzavniBudzet += 2000;
SCM(i, COLOR_GREY," Porez na drugo vozilo 2000$");
}
}
SCM(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), " Novo stanje: $%d", PlayerInfo[i][pBankMoney]);
SCM(i, COLOR_GRAD5, string);
format(string, sizeof(string), " Rent: -$%d", rent);
SCM(i, COLOR_GRAD5, string);
if(PlayerInfo[i][pKredit] != 0)
{
SCM(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), " Ukupan Kredit: $%d", PlayerInfo[i][pKredit]);
SCM(i, COLOR_GRAD5, string);
}
if(PlayerInfo[i][pKredit] >= 475)
{
SCM(i, COLOR_GRAD5," Rata za Kredit: $500");
PlayerInfo[i][pKredit] -= 475;
Nalog -= 500;
SCM(i, COLOR_GREEN, "|--------------------------------------|");
}
else if(PlayerInfo[i][pKredit] < 475 && PlayerInfo[i][pKredit] != 0)
{
PlayerInfo[i][pKredit] = 0;
SCM(i, COLOR_GRAD5,"Otplatili ste vas kredit.");
SCM(i, COLOR_GREEN, "|--------------------------------------|");
}
format(string, sizeof(string), "~y~Plata~n~~w~Proverite vas nalog");
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;
}
}
else
{
SCM(i, COLOR_WHITE, "* Niste igrali dovoljno dugo da bi dobili platu.");
}
}
}
}
MonkeyBussines();
new rand = random(1000); rand += 500;
Jackpot += rand;
SaveStuff();
SaveAnticheat();
format(string, sizeof(string), "Lotto vesti: JackPot je povecan i on sada iznosi $%d.", Jackpot);
OOCOff(COLOR_WHITE, string);
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno): http://www.dodaj.rs/f/10/13c/WujUtZZ/sa-mp-685.png
http://wiki.sa-mp.com/wiki/Getdate
+ logika :)
Neko drugi jasnije malo ?
evo ti:
stock GetWeek(d,m,y) //by drakins,thanks vine
{
m=(m-=2);
if(m<=0) --y,m+=12;
return ( ((
(d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4)-2*(y%100))%7) == 0)?
(((d+((13*m-1)/5)+(y%100)+((y%100)/4)+(((y%100)%100)/4
)-2*(y%100))%7) + 1) : (((d+((13*m-1)/5)+(y%100)+((y%100)/4)+
(((y%100)%100)/4)-2*(y%100))%7)
) );
}
#define GetWeek() ((getdate() % 0x7) + 0x6)
A jel trebam da dodam u payday nesto za respekte i da pise nako Vikend je dobili ste dupli respekt ?
Neko ?
Zasto ne cekas odgovor ? zasto refreshujes temu, sledeci put ti ide lock
Razmisli malo, ako se radi o plati, da li treba u platu da se doda nesto ?
Kreni ovu funkciju da koristis ovako:
new d,m s;
GetWeek(d,m,s);
//i ovde samo proveri i uradi reakciju
Sredim super ovo GetWeek, ali u payday nmg nikako da stavim da daje 2 respekta neko ko bi pomogo ?
PI[playerid][pExp] += 2;