[POMOC]KREDITI

Započeo limpo, April 10, 2013, 16:10:47 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:E.xplosion
Detaljan opis problema:u skripti je zbugan kredit ne mogu da skontam u cemu je rijec,npr kad neko uzme 1000 kredita ,sve je ok ali rata nije u rredu,svaku platu mora da placa puni iznos kredita (u ovom slucaju uzeo je 1000 i svaki sat vraca po 1000) :/
Dio skripte: ]Ne znam Å¡ta treba da dadnem?
evo ovo

if (PlayerInfo[playerid][pKredit] > 1){
        KreditUK = PlayerInfo[playerid][pKredit];
        KreditR  = PlayerInfo[playerid][pKredit]/10;
        KreditK  = KreditR/10;}
        else {
        KreditUK = 0;
        KreditR  = 0;
        KreditK  = 0;}
// ------------------------------- proracun
if(PlayerInfo[playerid][pDonateRank] > 0)
{Zaduzenje = VodaKuca+GrejanjeKuca+PPK+VodaStan+GrejanjeStan+Rent+PP+KreditUK+KreditR;}
else
{Zaduzenje = StrujaKuca+VodaKuca+GrejanjeKuca+PPK+StrujaStan+VodaStan+GrejanjeStan+PPS+Rent+PP+KreditUK+KreditR+KreditK;}

NS = PlayerInfo[playerid][pAccount]-Zaduzenje;
// ------------------------------- sredjivanje datoteka
new SS = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount] = NS;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
PlayerInfo[playerid][pExp] +=1; // raspecti
if(FarmerVar[playerid] == 0)
{FarmerPickup[playerid][0] = 0;}
Rent = 0;
PlayerInfo[playerid][pPlata] = 0;
if(GetPlayerMoney(playerid) < 0)
{
    if(MoneyMessage[playerid]==0)
    {
    format(string, sizeof(string), "U dugovima ste, imate vremena do sledece provjere da skupite: %d$ ili idete u zatvor.", GetPlayerMoney(playerid));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
MoneyMessage[playerid] = 1;
}
}


// ispis PLATE
new clickstring[800];
new msgbox[800];

msgbox="{CC0000}Struja kuca{FFFF00}\t\t%d\n{CC0000}Voda kuca{FFFF00}\t\t%d\n{CC0000}Grejanje kuca{FFFF00}\t\t%d\n{CC0000}Struja stan{FFFF00}\t\t%d\n{CC0000}Voda stan{FFFF00}\t\t%d\n{CC0000}Grejanje stan{FFFF00}\t\t%d\n{CC0000}Rent{FFFF00}\t\t\t%d\n{CC0000}Porez{FFFF00}\t\t\t%d\n{CC0000}Kredit ukupan{FFFF00}\t\t%d\n{CC0000}Kredit rata{FFFF00}\t\t%d\n{CC0000}Kredit kamata{FFFF00}\t\t%d\n\n{CC0000}Banka{FFFF00}\t\t\t%d\n{CC0000}Zaduzenje{FFFF00}\t\t%d\n\n{CC0000}Novo stanje{FFFF00}\t\t%d";

format(clickstring,sizeof clickstring,msgbox, StrujaKuca, VodaKuca, GrejanjeKuca, StrujaStan, VodaStan, GrejanjeStan, Rent, PP, KreditUK, KreditR, KreditK, SS, Zaduzenje, NS);

        ShowPlayerDialog(playerid,PLATAI,DIALOG_STYLE_MSGBOX,"Izrada racuna :",clickstring,"Uredu","Uredu");



OnPropUpdate();
OnPlayerUpdateCustom(playerid);
}
return 1;

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

Daj dio payday sistem jer je sigurno stavljeno da kad ube plata  da cjeli kredit vraca

Citat: |...KuNNa...| poslato April 10, 2013, 16:14:30 POSLE PODNE
Daj dio payday sistem jer je sigurno stavljeno da kad ube plata  da cjeli kredit vraca
public PayDay()   // PLATA
{
new string[150];
foreach (Player, i)
{
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
    if(PlayerInfo[i][pPayDay] == 2) // ako nije na vreme podigao platu
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "Niste platili racune, platite ih ili idete u zatvor.");
}
}
    if(PlayerInfo[i][pPayDay] == 3) // ako nije na vreme podigao platu
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;
SendClientMessage(i, COLOR_LIGHTRED, "Niste platili racune, platite ih ili idete u zatvor.");
}
}
    if(PlayerInfo[i][pPayDay] == 4) // ako nije na vreme podigao platu
{
if (PlayerInfo[i][pPlata] == 1)
{
PlayerInfo[i][pPlata] = 0;

SendClientMessage(i, COLOR_LIGHTRED, "Niste platili racune, idete u zatvor.");
GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
PlayerInfo[i][pJailed] = 1;
SafeJBC_ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 100;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
}

if(PlayerInfo[i][pPayDay] >= 5) // ako ispunjava uslove za platu
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "Niste uspjeli da vratite dug, idete u zatvor.");
GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
new rand = random(sizeof(gRandomJailSpawns));
SetPlayerPos(i, gRandomJailSpawns[rand][0], gRandomJailSpawns[rand][1], gRandomJailSpawns[rand][2]);
PlayerInfo[i][pJailed] = 1;
SafeJBC_ResetPlayerWeapons(i);
SafeJBC_ResetPlayerMoney(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "Uhapseni ste na %d sekundi.   Kaucija: Nedostupna", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
// *****************************************************************************
    new stringd[256];
    PlayerInfo[i][pPlata] = 1;
format(stringd, sizeof(stringd), "{FF0000}Stigli su vam racuni !\n{FFFF00}Idite u opstinu,\n{FFFF00}da platite\n{0000CC}ROK ZA UPLATU 20min.");
ShowPlayerDialog( i, PLATA, DIALOG_STYLE_MSGBOX, "{FFFFFF}Izvestaj banke :", stringd, "Uredu", "" );
}
else
{
PlayerInfo[i][pPlata] = 0;
    SendClientMessage(i, COLOR_WHITE, "* Niste igrali dovoljno dugo da biste dobili racune.");
}

}
SaveAccounts();
return 1;
}


Citat: --Lood-- poslato April 10, 2013, 17:05:30 POSLE PODNE
de mi cmd.. kojom placas racune :)
Kao sto je rekao kolega posalji cmd sa kojom placas racune da bi mogli pomoci

Evo sve
if(strcmp(cmd, "/racuni", true) == 0 ) // plata
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerToPoint(1.5, playerid, 358.6049,187.5338,1008.3828)){SendClientMessage(playerid, COLOR_GREY, " Niste na mestu za placanje racuna !");return 1;}
            if(PlayerInfo[playerid][pPlata] == 0){SendClientMessage(playerid, COLOR_GREY, " Nemate racune za platiti !");return 1;}
new StrujaKuca;
new StrujaStan;
new VodaKuca;
new VodaStan;
new GrejanjeKuca;
new GrejanjeStan;
new Rent;
new PP;
new PPK;
new PPS;
new PPV;
new KreditUK;
new KreditR;
new KreditK;
new Zaduzenje;
new NS;
// ------------------------------- proracun struja,voda,grejanje [kuca]
if (PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[playerid][hOwner], true) == 0)
{StrujaKuca = HouseInfo[PlayerInfo[playerid][pPhousekey]][hValue] / 143;
                 VodaKuca = HouseInfo[PlayerInfo[playerid][pPhousekey]][hValue] / 203;
                 GrejanjeKuca = HouseInfo[PlayerInfo[playerid][pPhousekey]][hValue] / 183;
PPK = HouseInfo[PlayerInfo[playerid][pPhousekey]][hValue] / 250;}
else{
StrujaKuca = 0;
VodaKuca = 0;
GrejanjeKuca = 0;
PPK = 0;}
// ------------------------------- proracun struja,voda,grejanje [stan]
if(PlayerInfo[playerid][pPstankey] != 255 && strcmp(playername, StanInfo[PlayerInfo[playerid][pPstankey]][sOwner], true) == 0){
StrujaStan = StanInfo[PlayerInfo[playerid][pPstankey]][sValue] / 143;
VodaStan = StanInfo[PlayerInfo[playerid][pPstankey]][sValue] / 203;
GrejanjeStan= StanInfo[PlayerInfo[playerid][pPstankey]][sValue] / 183;
PPS = StanInfo[PlayerInfo[playerid][pPstankey]][sValue] / 250;}
else{
StrujaStan = 0;
VodaStan = 0;
GrejanjeStan = 0;
PPS = 0;}
// ------------------------------- proracun Rent
if(PlayerInfo[playerid][pPhousekey] != 255)
{
Rent = HouseInfo[PlayerInfo[playerid][pPhousekey]][hRent];
if(strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
Rent = 0;
}
else if(Rent > GetPlayerMoney(playerid))
{
PlayerInfo[playerid][pPhousekey] = 255;
SendClientMessage(playerid, COLOR_WHITE, "{FF0033}Iseljeni ste !!!");
Rent = 0;
}
HouseInfo[PlayerInfo[playerid][pPhousekey]][hTakings] = HouseInfo[PlayerInfo[playerid][pPhousekey]][hTakings]+Rent;
}
// ------------------------------- proracun Porez na imovinu i skidanje / obavestavanje o registraciji vozila
new carkey  = PlayerInfo[playerid][pPcarkey];  if (PlayerInfo[playerid][pPcarkey]  != 999)
{
if(CarInfo[carkey][cRegistracija] > 0)
{CarInfo[carkey][cRegistracija] -= 1;}
if(CarInfo[carkey][cRegistracija] == 0)
{SendClientMessage(playerid, COLOR_WHITE, "{FF0033}Istekla vam je registracija vozila 1 !!!");}
PPV = 150;}

new carkey2 = PlayerInfo[playerid][pPcarkey2]; if (PlayerInfo[playerid][pPcarkey2] != 999){
if(CarInfo[carkey2][cRegistracija] > 0)
{CarInfo[carkey2][cRegistracija] -= 1;}
if(CarInfo[carkey2][cRegistracija] == 0)
{SendClientMessage(playerid, COLOR_WHITE, "{FF0033}Istekla vam je registracija vozila 2 !!!");}
PPV += 110;}
new carkey3 = PlayerInfo[playerid][pPcarkey3]; if (PlayerInfo[playerid][pPcarkey3] != 999){
if(CarInfo[carkey3][cRegistracija] > 0)
{CarInfo[carkey3][cRegistracija] -= 1;}
if(CarInfo[carkey3][cRegistracija] == 0)
{SendClientMessage(playerid, COLOR_WHITE, "{FF0033}Istekla vam je registracija vozila 3 !!!");}
PPV += 80;}

PP = PPK + PPS + PPV;
// ------------------------------- proracun kredit ukupno ,rata i kamata
if (PlayerInfo[playerid][pKredit] > 1){
        KreditUK = PlayerInfo[playerid][pKredit];
        KreditR  = PlayerInfo[playerid][pKredit]/10;
        KreditK  = KreditR/10;}
        else {
        KreditUK = 0;
        KreditR  = 0;
        KreditK  = 0;}
// ------------------------------- proracun
if(PlayerInfo[playerid][pDonateRank] > 0)
{Zaduzenje = VodaKuca+GrejanjeKuca+PPK+VodaStan+GrejanjeStan+Rent+PP+KreditUK+KreditR;}
else
{Zaduzenje = StrujaKuca+VodaKuca+GrejanjeKuca+PPK+StrujaStan+VodaStan+GrejanjeStan+PPS+Rent+PP+KreditUK+KreditR+KreditK;}

NS = PlayerInfo[playerid][pAccount]-Zaduzenje;
// ------------------------------- sredjivanje datoteka
new SS = PlayerInfo[playerid][pAccount];
PlayerInfo[playerid][pAccount] = NS;
PlayerInfo[playerid][pPayDay] = 0;
PlayerInfo[playerid][pPayCheck] = 0;
PlayerInfo[playerid][pConnectTime] += 1;
PlayerInfo[playerid][pExp] +=1; // raspecti
if(FarmerVar[playerid] == 0)
{FarmerPickup[playerid][0] = 0;}
Rent = 0;
PlayerInfo[playerid][pPlata] = 0;
if(GetPlayerMoney(playerid) < 0)
{
    if(MoneyMessage[playerid]==0)
    {
    format(string, sizeof(string), "U dugovima ste, imate vremena do sledece provjere da skupite: %d$ ili idete u zatvor.", GetPlayerMoney(playerid));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
MoneyMessage[playerid] = 1;
}
}


// ispis PLATE
new clickstring[800];
new msgbox[800];

msgbox="{CC0000}Struja kuca{FFFF00}\t\t%d\n{CC0000}Voda kuca{FFFF00}\t\t%d\n{CC0000}Grejanje kuca{FFFF00}\t\t%d\n{CC0000}Struja stan{FFFF00}\t\t%d\n{CC0000}Voda stan{FFFF00}\t\t%d\n{CC0000}Grejanje stan{FFFF00}\t\t%d\n{CC0000}Rent{FFFF00}\t\t\t%d\n{CC0000}Porez{FFFF00}\t\t\t%d\n{CC0000}Kredit ukupan{FFFF00}\t\t%d\n{CC0000}Kredit rata{FFFF00}\t\t%d\n{CC0000}Kredit kamata{FFFF00}\t\t%d\n\n{CC0000}Banka{FFFF00}\t\t\t%d\n{CC0000}Zaduzenje{FFFF00}\t\t%d\n\n{CC0000}Novo stanje{FFFF00}\t\t%d";

format(clickstring,sizeof clickstring,msgbox, StrujaKuca, VodaKuca, GrejanjeKuca, StrujaStan, VodaStan, GrejanjeStan, Rent, PP, KreditUK, KreditR, KreditK, SS, Zaduzenje, NS);

        ShowPlayerDialog(playerid,PLATAI,DIALOG_STYLE_MSGBOX,"Izrada racuna :",clickstring,"Uredu","Uredu");



OnPropUpdate();
OnPlayerUpdateCustom(playerid);
}
return 1;
}