[Pomoc] PayDay

Započeo xXxPored, Februar 02, 2013, 17:41:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skirpta koju koristim: Moja
Detaljan opsi problema: Ne radi mi payday msm radi ali uvijek dobijem platu 0 :S
Dio skripte: public PayDay()
{
new string[128];
new account,interest;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLevel] > 0)
    {
    if(MoneyMessage[i]==1)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Nisi uspio otplatiti dug. Ides u zatvor.");
    GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
    SetPlayerInterior(i, 6);
    SetPlayerPos(i, 264.6288,77.5742,1001.0391);
            PlayerInfo[i][pJailed] = 1;
            ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "Pritvoren si na %d sekundi.   Kauicija: Nema", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
if(PlayerInfo[i][pPayDayPoeni] >= 30)
{
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
    if(PlayerInfo[i][pDonateRank] > 0)
{
    new bonus = PlayerInfo[i][pPayCheck] / 2;
    PlayerInfo[i][pPayCheck] += bonus;
}
new checks = PlayerInfo[i][pPayCheck]/20;
    new ebill = (PlayerInfo[i][pAccount]/15000)*(PlayerInfo[i][pLevel]);
    ConsumingMoney[i] = 1;
    GivePlayerMoney(i, checks);
    if(PlayerInfo[i][pAccount] > 0)
    {
    PlayerInfo[i][pAccount] -= ebill;
}
else
{
    ebill = 0;
}
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
format(string, sizeof(string), "~y~PayDay~n~~w~Isplata");
GameTextForPlayer(i, string, 5000, 1);
format(string, sizeof(string), "PayDay Isplata\nStaro Stanje: $%d Plata: $%d   Porez: $%d   Racun za struju: $%d\nKamata: $%d     Novo stanje:$%d", account, checks, TaxValue, ebill, interest, PlayerInfo[i][pAccount]);
ShowPlayerDialog(i, DIALOG_PAYDAY, DIALOG_STYLE_MSGBOX, "Izvjesce Banke", string, "Uredu", "");
if(PlayerInfo[i][pKreditOstalo] > 0)
{
    new ernad[128];
    format(ernad, sizeof(ernad), "{FFFF80}Kredit: -1000$\n{FFFF80}Preostalo rata: %d", PlayerInfo[i][pKreditOstalo]);
SendClientMessage(i, COLOR_LIGHTRED, ernad);
PlayerInfo[i][pKredit] += 1;
PlayerInfo[i][pKreditOstalo] -= 1;
GivePlayerMoney(i, -1000);
}
PlayerInfo[i][pPayDayPoeni] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
LevelUpgrade(i);
if(PlayerInfo[i][pDonateRank] > 0)
{
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
        PlayerInfo[i][pExp]++;
        PlayerInfo[i][pPayDayHad] = 0;
    }
}
}
else
{
    SendClientMessage(i, COLOR_LIGHTRED, "* Nisi igrao dovoljno dugo da bi dobio platu.");
}
}
}
}
return 1;
}


Neke slike ili video: /
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

Pa da li kroz mod povećavaš negdje pPayCheck varijablu da bi mogao dati igraču plaću?

Last nick: Paradox

Citat: Joey_ poslato Februar 02, 2013, 17:51:01 POSLE PODNE
Pa da li kroz mod povećavaš negdje pPayCheck varijablu da bi mogao dati igraču plaću?
poslusaj ovo sto ti je joey reko, medjutim, mozda i nije do toga, mozda ti uopste ni nemas kod koji ce povecavati platu, tacnije davati platu igracu

new level = PlayerInfo[i][pLevel];
if(level >= 0 && level <= 2) { PlayerInfo[i][pPayCheck] += 1; }
else if(level >= 3 && level <= 4) { PlayerInfo[i][pPayCheck] += 2; }
else if(level >= 5 && level <= 6) { PlayerInfo[i][pPayCheck] += 3; }
else if(level >= 7 && level <= 8) { PlayerInfo[i][pPayCheck] += 4; }
else if(level >= 9 && level <= 10) { PlayerInfo[i][pPayCheck] += 5; }
else if(level >= 11 && level <= 12) { PlayerInfo[i][pPayCheck] += 6; }
else if(level >= 13 && level <= 14) { PlayerInfo[i][pPayCheck] += 7; }
else if(level >= 15 && level <= 16) { PlayerInfo[i][pPayCheck] += 8; }
else if(level >= 17 && level <= 18) { PlayerInfo[i][pPayCheck] += 9; }
else if(level >= 19 && level <= 20) { PlayerInfo[i][pPayCheck] += 10; }
else if(level >= 21) { PlayerInfo[i][pPayCheck] += 11; }


Da nije ovo?
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

Da, to povećava pPayCheck varijablu. Daj cijeli kod gdje se to nalazi.

Last nick: Paradox

nalazi se pod setplayerunjail u gf


public SetPlayerUnjail()
{
new plname[MAX_PLAYER_NAME];
new string[256];
if(PaintballPlayers >= 2 && PaintballRound != 1 && StartingPaintballRound != 1)
{
StartingPaintballRound = 1;
    SetTimer("PreparePaintball", 15000, 0);
}
if(KartingPlayers >= 2 && KartingRound != 1 && StartingKartRound != 1)
{
    StartingKartRound = 1;
    SetTimer("PrepareKarting", 15000, 0);
}
if(KartingRound != 0 && KartingPlayers < 2)
{
    StartingKartRound = 0;
    KartingRound = 0;
    EndingKartRound = 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
    new newcar = GetPlayerVehicleID(i);
    new level = PlayerInfo[i][pLevel];
if(level >= 0 && level <= 2) { PlayerInfo[i][pPayCheck] += 1; }
else if(level >= 3 && level <= 4) { PlayerInfo[i][pPayCheck] += 2; }
else if(level >= 5 && level <= 6) { PlayerInfo[i][pPayCheck] += 3; }
else if(level >= 7 && level <= 8) { PlayerInfo[i][pPayCheck] += 4; }
else if(level >= 9 && level <= 10) { PlayerInfo[i][pPayCheck] += 5; }
else if(level >= 11 && level <= 12) { PlayerInfo[i][pPayCheck] += 6; }
else if(level >= 13 && level <= 14) { PlayerInfo[i][pPayCheck] += 7; }
else if(level >= 15 && level <= 16) { PlayerInfo[i][pPayCheck] += 8; }
else if(level >= 17 && level <= 18) { PlayerInfo[i][pPayCheck] += 9; }
else if(level >= 19 && level <= 20) { PlayerInfo[i][pPayCheck] += 10; }
else if(level >= 21) { PlayerInfo[i][pPayCheck] += 11; }
    if(PlayerInfo[i][pJailed] > 0)
    {
if(PlayerInfo[i][pJailTime] > 0 && WantLawyer[i] == 0)
{
PlayerInfo[i][pJailTime]--;
}
if(PlayerInfo[i][pJailTime] <= 0 && WantLawyer[i] == 0)
{
    PlayerInfo[i][pJailTime] = 0;
if(PlayerInfo[i][pJailed] == 1)
{
SetPlayerInterior(i, 6);
SetPlayerPos(i,268.0903,77.6489,1001.0391);
}
else if(PlayerInfo[i][pJailed] == 2)
{
    SetPlayerWorldBounds(i,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
    SetPlayerInterior(i, 0);
    SetPlayerPos(i, 90.2101,1920.4854,17.9422);
}
PlayerInfo[i][pJailed] = 0;
SendClientMessage(i, COLOR_GRAD1,"Platio si svoj drug drustvu!");
format(string, sizeof(string), "~g~Sloboda~n~~w~Pokusaj biti bolji gradanin");
GameTextForPlayer(i, string, 5000, 1);
if(gTeam[i] == 4) { gTeam[i] = 3; }
ClearCrime(i);
SetPlayerToTeamColor(i);
}
}
if(GetPlayerMoney(i) - CurrentMoney[i] >= 10000 && PlayerInfo[i][pAdmin] < 1)
    {
        if(ConsumingMoney[i])
        {
                    CurrentMoney[i] = GetPlayerMoney(i);
ConsumingMoney[i] = 0;
        }
        else
        {
        GetPlayerName(i, plname, sizeof(plname));
        format(string, 256, "Upozorenje: [%d]%s je urpavo stvorio preko $100000 u jednoj eskundi (moneycheat),koristi /check.",i,plname);
ABroadCast(COLOR_YELLOW,string,1);
PayLog(string);
        CurrentMoney[i] = GetPlayerMoney(i);
        }
    }
    else
    {
        CurrentMoney[i] = GetPlayerMoney(i);
    }
    if(IsABoat(newcar))
{
    if(PlayerInfo[i][pBoatLic] < 1 && GetPlayerState(i) == 2)
{
    RemovePlayerFromVehicle(i);
}
}
else if(IsAPlane(newcar))
{
    if(PlayerInfo[i][pFlyLic] < 1 && GetPlayerState(i) == 2)
{
    if(TakingLesson[i] == 1) { }
    else { RemovePlayerFromVehicle(i); }
}
}
else
{
if(PlayerInfo[i][pCarLic] < 1 && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == 2)
{
if(TakingLesson[i] == 1) { }
}
}//Done with car check
    if(UsedFind[i] >= 1)
    {
        UsedFind[i] += 1;
if(UsedFind[i] >= 120)
{
    UsedFind[i] = 0;
}
    }
if(MedicTime[i] > 0)
{
    if(MedicTime[i] == 3)
    {
        SetPlayerInterior(i, 5);
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(i, X,Y,Z);
        SetPlayerCameraPos(i, X + 3, Y, Z);
        SetPlayerCameraLookAt(i,X,Y,Z);
    }
    MedicTime[i] ++;
    if(MedicTime[i] >= NeedMedicTime[i])
    {
new cut = deathcost; //PlayerInfo[playerid][pLevel]*deathcost;
GivePlayerMoney(i, -100);
format(string, sizeof(string), "Doktor: Vas medicinski racun kosta $%d, ugodan ostatak dana", cut);
SendClientMessage(i, COLOR_RED, string);
TogglePlayerControllable(i, 1);
        MedicBill[i] = 0;
        MedicTime[i] = 0;
        NeedMedicTime[i] = 0;
        PlayerInfo[i][pDeaths] += 1;
        PlayerFixRadio(i);
        SpawnPlayer(i);
    }
}
if(WantLawyer[i] >= 1)
{
    CallLawyer[i] = 111;
    if(WantLawyer[i] == 1)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Zelis li advokata? (Pisi yes ili no)");
}
WantLawyer[i] ++;
if(WantLawyer[i] == 8)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Zelis li advokata? (Pisi yes ili no)");
}
            if(WantLawyer[i] == 15)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Zelis li advokata? (Pisi yes ili no)");
}
if(WantLawyer[i] == 20)
{
    SendClientMessage(i, COLOR_LIGHTRED, "Nema slobodnih advokata, ostao si u zatvoru!");
    WantLawyer[i] = 0;
    CallLawyer[i] = 0;
}
}


poslije calllawyer ide tut :)
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

Ovu liniju u PayDay timeru:
new checks = PlayerInfo[i][pPayCheck]/20;

Zamijeni ovom:

new checks = PlayerInfo[i][pPayCheck];

Last nick: Paradox

stavio sam a de mi reci sta ustvari radi ovo /20 dijeli ili sta vec?

big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

Dijeli sa 20, da.

Last nick: Paradox

Aham hvala ti rijesio sam to...

Sad jos nesot da ne otvaram temu novu!

Gledaj znaci napravio sam /kredit i sad kad mi rate dolaze npr napravio da treba 10 rata!

Ali ono nastavi da ide ispod 10 ide mi -1 -2 -3... i td :S na paydayu :S

if(PlayerInfo[i][pKredit] > 0)
{
                        new string1[128];
format(string1, sizeof(string1), "{FFFF80}Kredit: -1000$ | {FFFF80}Preostalo rata: %d", PlayerInfo[i][pKreditOstalo]);
SendClientMessage(i, COLOR_WHITE, string1);
PlayerInfo[i][pKredit] += 1;
PlayerInfo[i][pKreditOstalo] -= 1;
GivePlayerMoney(i, -1000);
}
if(PlayerInfo[i][pKreditOstalo] == 0)
{
new kredito[128];
format(kredito, sizeof(kredito), "Kredit otplacen. Mozes ici da podignes novi!", PlayerInfo[i][pKreditOstalo]);
SendClientMessage(i, COLOR_WHITE, kredito);
PlayerInfo[i][pKredit] = 0;
PlayerInfo[i][pKreditOstalo] = -1;
}


Taj dio
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

pa stavis proveru varijable ako je kredit isplacen na 10, da mu se brise varijabla pKreditOstalo, znaci da mu se ne skida novac

a kako to de mi reci xD da napravim imam pKredit i pKreditOstalo eh sad ako dignes 10k imas 10 puta da platis po 1000 ali ono nastavi da ide u minus? Shvatas :S
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa