[POMOC] Crash igraća pri plati

Započeo Norscio_, Jun 22, 2012, 21:27:30 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Detaljan opis problema: Kada igrač dobije platu crasha mu, tako svakome igraću.
Skripta koju koristim: GeForce.
Neke slike/video/kod za lakse dobivanje pomoci (npr.slika server.cfg, server log ili slično): Ništa :(
Poslednja Izmena: Jun 27, 2012, 08:41:00 PRE PODNE od [BD]...Р৸illipS...

Ziher nije original GF mod jer se to nije dogadalo na GFu!!!

Da je sve radilo na ovoj skripti oni bi otvorili server.  ;)

Citat: Norscio_ poslato Jun 22, 2012, 21:27:30 POSLE PODNE
Detaljan opis problema: Kada igrač dobije platu crasha mu, tako svakome igraću.
Skripta koju koristim: GeForce.
Neke slike/video/kod za lakse dobivanje pomoci (npr.slika server.cfg, server log ili slično): Ništa :(
Daj mi kod za payday..
ODSUTAN

public PayDay(playerid)
{
new string[300],
    account,
interest,
total,
lost,
earn,
key,
aptkey,
tmpintrate,
Hour,
Minute,
Second,
Year,
Month,
Day,
rata,
ukupno,
rent = 0;

if(IsPlayerConnected(playerid))
{
         if(PlayerInfo[playerid][pLevel] > 0)
         {
         
new playername[MAX_PLAYER_NAME];
         
GetPlayerName(playerid, playername, sizeof(playername));
account = PlayerInfo[playerid][pAccount];
key = PlayerInfo[playerid][pPhousekey];
            aptkey = PlayerInfo[playerid][pApartment];
           
          if(PlayerInfo[playerid][pHeroinIndicator] > 0)
          {
        PlayerInfo[playerid][pHeroinIndicator] -= 10;//Heroin indikator se smanjuje za 10.Tako da ako igrac uzima heroin,ali ne precesto, ne mora nuzno znacit da ce bit ovisnik
}
        if(PlayerInfo[playerid][pCigareteIndicator] > 0)
        {
        PlayerInfo[playerid][pCigareteIndicator] -= 10;//Isto vrijedi za cigarete
}
        if(PlayerInfo[playerid][pCrackIndicator] > 0)
        {
        PlayerInfo[playerid][pCrackIndicator] -= 10;//Isto vrijedi za crack
}
if(PlayerInfo[playerid][pHeroinUsed] > 0)
{
PlayerInfo[playerid][pHeroinUsed] -= 1;
}
if(PlayerInfo[playerid][pCrackUsed] > 0)
{
PlayerInfo[playerid][pCrackUsed] -= 1;
}
if(PlayerInfo[playerid][pCigareteUsed] > 0)
{
PlayerInfo[playerid][pCigareteUsed] -= 1;
}
if(key != 255)
{
rent = HouseInfo[key][hRent];

if(strcmp(playername, HouseInfo[key][hOwner], true) == 0)
rent = 0;
else if(rent > SafeGetPlayerMoney(playerid))
{
PlayerInfo[playerid][pPhousekey] = 255;
SendClientMessage(playerid, COLOR_RED, "Izbaceni ste jer niste mogli platit cijenu najma kuce.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings] + rent;
}
if(aptkey != 255)
{
rent = ApartmentInfo[aptkey][aRent];

if(strcmp(playername, ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acOwner], true) == 0)
rent = 0;
else if(rent > SafeGetPlayerMoney(playerid))
{
PlayerInfo[playerid][pApartment] = 255;
ApartmentInfo[aptkey][aUsed] = 0;
strmid(ApartmentInfo[aptkey][aUser], "No-one", 0, strlen("No-one"), 255);
SendClientMessage(playerid, COLOR_RED, "Izbaceni ste jer niste mogli platiti cijenu najma sobe.");
SaveApartments();
rent = 0;
}
ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acTill] = ApartmentComplexInfo[ApartmentInfo[aptkey][aComplexID]][acTill] + rent;
}
if (key != 255 && strcmp(playername, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[playerid][pAccount] > 1000000)
{
        if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = intrate + 3;
else
    tmpintrate = intrate;
}
else
{
        if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = intrate + 4;
else
    tmpintrate = intrate + 1;
}
}
else
{
if(PlayerInfo[playerid][pDonateRank] == 3)
    tmpintrate = 3;
else
    tmpintrate = 1;
}
if(PlayerInfo[playerid][pDonateRank] >= 2)
{
new bonus = PlayerInfo[playerid][pPayCheck] / 2;

PlayerInfo[playerid][pPayCheck] += bonus;
}
if(PlayerInfo[playerid][pDignutKredit] > 0)
{
                if(PlayerInfo[playerid][pDignutKredit] == 1)
                {
                    if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 50;
else
rata = 0;
}
else if(PlayerInfo[playerid][pDignutKredit] == 2)
{
if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 100;
else
rata = 0;
}
else if(PlayerInfo[playerid][pDignutKredit] == 3)
{
    if(PlayerInfo[playerid][pRate] >= 1 && PlayerInfo[playerid][pRate] <= 250)
rata = 250;
else
rata = 0;
}
else
rata = 0;
}
ServerInfo[sPayDays]++;
gettime(Hour, Minute, Second);
getdate(Year, Month, Day);

Tax += TaxValue;
ukupno = TaxValue+rata;
PlayerInfo[playerid][pAccount] -= ukupno;

new checks = PlayerInfo[playerid][pPayCheck] + random(50),
    ebill = 0;
   
if(PlayerInfo[playerid][pPhousekey] != 255 || PlayerInfo[playerid][pPbiskey] != 255)
{
    ebill = (PlayerInfo[playerid][pAccount] / 10000) * (PlayerInfo[playerid][pLevel]);
    if(PlayerInfo[playerid][pAccount] > 0)
    {
     PlayerInfo[playerid][pAccount] -= ebill;
     Proracunsys[ProracunAmmount] += ebill-50;
     //SBizzInfo[4][sbTill] += ebill;
    }
}
            PlayerInfo[playerid][pTookDrugs] = 0;
            SetPVarInt(playerid, "FreeWorks", 6);
            SetPVarInt(playerid, "DutySystem", 1);
PlayerInfo[playerid][pPayDayMoney] += checks;
BizzInfo[3][bTill] += rata;
SaveProperty();
SaveGangs();
SaveProracun();

new money = SafeGetPlayerMoney(playerid);

interest = (PlayerInfo[playerid][pAccount] / 1000) * (tmpintrate);
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pRate]++;
PlayerPlayMusic(playerid);
PlayerInfo[playerid][pAccount] = account+interest;
earn = checks + interest;
lost = TaxValue + ebill + rent + rata;
total = earn - lost;
if(PlayerInfo[playerid][pRate] >= 251)
{
                PlayerInfo[playerid][pRate] = 0;
                PlayerInfo[playerid][pDignutKredit] = 0;
                SendClientMessage(playerid, COLOR_NICERED, "Upravo ste otplatili zadnju ratu kredita! Mozete dignuti novi kredit!");
}

// PayDay Text Draw
format(string, sizeof(string), "~w~~n~%02d/%02d/%d, %02d:%02d:%02d~n~~n~IZNOS PLACE~n~ ~y~Radna Knjizica: ~w~%d~g~$~n~~n~~w~BANKOVNI RACUN~n~ ~y~Iznos: ~w~%d~g~$~n~ ~y~Kamatna stopa: ~w~0.%d~n~ ~y~Iznos kamate: ~w~%d~g~$",
Day,
Month,
Year,
Hour,
Minute,
Second,
checks,
account,
tmpintrate,
interest);

TextDrawSetString(PayCheckTextDraw[playerid], string);

// PayDay Total Text Draw
            format(string, sizeof(string), "~w~~n~TROSKOVI~n~ ~y~Racun struje: ~r~-%d~g~$~n~ ~y~Rent: ~r~-%d~g~$~n~ ~y~Porez: ~r~-%d~g~$~n~ ~y~Kredit: ~r~-%d~g~$~n~~n~~w~NOVI IZNOS~n~ ~y~Banka: ~w~%d~g~$~n~ ~y~Gotovina: ~w~%d~g~$~n~ ~y~Ukupan profit: ~w~%d~g~$~n~~n~~w~Pritisnite ~y~ENTER ~w~za ~n~zatvaranje prozora.",
            ebill,
rent,
TaxValue,
rata,
PlayerInfo[playerid][pAccount],
money,
total);

TextDrawSetString(PayCheckTextDrawTotal[playerid], string);

TextDrawShowForPlayer(playerid, PayDayTextDraw);
TextDrawShowForPlayer(playerid, PayCheckTextDraw[playerid]);
TextDrawShowForPlayer(playerid, PayCheckTextDrawTotal[playerid]);
SetPVarInt(playerid, "PayDayTextDrawShown", 1);

rent = 0;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PovecajPVarInt(playerid, "ConnectTime", 1);
if(PlayerInfo[playerid][pJob] == 53)
{
                if(GetPVarInt(playerid, "ConnectTime") > 35)
{
    PlayerInfo[playerid][pJob] = 0;
    SendClientMessage(playerid, COLOR_LIGHTRED, "Dobio si otkaz jer vise nisi novi gradjanin, uzmi novi posao!");
}
}
            PlayerInfo[playerid][pKosa] += 1;
            if(PlayerInfo[playerid][pKosa] >= 30)
            {
SendClientMessage(playerid, COLOR_NICEYELLOW, "Narasla vam je kosa poprilicno, a o bradi da ne govorimo");
SendClientMessage(playerid, COLOR_NICEYELLOW, "Mozda je vrijeme za sisanje konacno?");
}
if(PlayerInfo[playerid][pJob] > 0)
     PlayerInfo[playerid][pContractTime] ++;

if(PlayerInfo[playerid][pDonateRank] == 2)
{
PlayerInfo[playerid][pPayDayHad] += 1;
         if(PlayerInfo[playerid][pPayDayHad] >= 10)
     {
     PlayerInfo[playerid][pExp]++;
     PlayerInfo[playerid][pPayDayHad] = 0;
     }
}
else if(PlayerInfo[playerid][pDonateRank] == 3)
{
PlayerInfo[playerid][pPayDayHad] += 1;
         if(PlayerInfo[playerid][pPayDayHad] >= 5)
     {
     PlayerInfo[playerid][pExp]++;
     PlayerInfo[playerid][pPayDayHad] = 0;
     }
}
}
}
return 1;
}