[Pomoc] /racuni

Započeo Farkias, Avgust 23, 2012, 12:50:15 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Explosion Rp
Opis Problema: Pa ovako jedno vrijeme igraci mogu platiti racune u vijecnici,a jedno vrijeme ne ne kontam kako to da napravim?
Dio Skripte: 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;
}

Mozes mi pomoci kako to treba da bude?