Jump to content
  • 0

Intrebare td


iPanter

Question

7 answers to this question

Recommended Posts

  • 0

Nu vad ce e greu de inteles..

Deci ala e sistem-ul din pastebin cu un alt textdraw.. Si eu vreau sa modific sistem-ul sa apara textdraw-ul ala de mai jos, atata tot. Nu stiu cum sa il pun in string si etc.

Acum 14 minute, Dani3l.FTW a spus:

Frumos Model.. frumoase pozele.. -_-

fi drq mai explicit sa te putem ajuta si noi..

 

Link to comment
Share on other sites

  • 0
Acum 52 minute, iPanter a spus:

Nu vad ce e greu de inteles..

Deci ala e sistem-ul din pastebin cu un alt textdraw.. Si eu vreau sa modific sistem-ul sa apara textdraw-ul ala de mai jos, atata tot. Nu stiu cum sa il pun in string si etc.

 

Exact ca tdul din sistem doar ca ii pui numele variabilei noului td aferent

Edited by valivaly96
Link to comment
Share on other sites

  • 0

Am facut asa:

            if(CrateTime[i] > 0) {
                CrateTime[i] --;
                new amount, rand;
                if(CrateType[i] == 1) rand = random(30);
                else rand = random(50);
                switch(rand) {
                    case 0..15: {
                        amount = random(5) + 5;
                        if(CrateType[i] == 1) amount += 5;
                        format(string, sizeof(string), "Steep: %d/30~n~~y~%sx RP", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                        if(CrateTime[i] == 0) PlayerInfo[i][pExp] += amount, Update(i, pRP), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat RP-uri!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }
                    case 16..25: {
                        amount = random(50) + 100;
                        if(CrateType[i] == 1) amount += 100;
                        format(string, sizeof(string), "Steep: %d/30~n~~p~%s PremiumPoints", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawShow(i, CrateTD[i]);
                        if(CrateTime[i] == 0) PlayerInfo[i][pPremiumPoints] += amount, Update(i, pPremiumPoints), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat PremiumPoints!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }    
                    default: {
                        amount = random(1000000) + 500000;
                        if(CrateType[i] == 1) amount += 500000;                    
                        format(string, sizeof(string), "Steep: %d/30~n~~g~$%s", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                        if(CrateTime[i] == 0) GivePlayerCash(i, amount), Update(i, pCashx), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat bani!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }
                }
            }

si primesc eroarea asta:

 

[debug] AMX backtrace:
[debug] #0 0035e4fc in public Timers () at C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn:31352
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 1995 past array upper bound 1000

 

Asta e linia: if(CrateTime > 0) {

Link to comment
Share on other sites

  • 0
La 21.05.2018 la 19:05, iPanter a spus:

Am facut asa:

 


            if(CrateTime[i] > 0) {
                CrateTime[i] --;
                new amount, rand;
                if(CrateType[i] == 1) rand = random(30);
                else rand = random(50);
                switch(rand) {
                    case 0..15: {
                        amount = random(5) + 5;
                        if(CrateType[i] == 1) amount += 5;
                        format(string, sizeof(string), "Steep: %d/30~n~~y~%sx RP", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                        if(CrateTime[i] == 0) PlayerInfo[i][pExp] += amount, Update(i, pRP), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat RP-uri!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }
                    case 16..25: {
                        amount = random(50) + 100;
                        if(CrateType[i] == 1) amount += 100;
                        format(string, sizeof(string), "Steep: %d/30~n~~p~%s PremiumPoints", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawShow(i, CrateTD[i]);
                        if(CrateTime[i] == 0) PlayerInfo[i][pPremiumPoints] += amount, Update(i, pPremiumPoints), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat PremiumPoints!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }    
                    default: {
                        amount = random(1000000) + 500000;
                        if(CrateType[i] == 1) amount += 500000;                    
                        format(string, sizeof(string), "Steep: %d/30~n~~g~$%s", 30-CrateTime[i], FormatNumber(amount));
                        PlayerTextDrawSetString(i, CrateTD[4], string);
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                        if(CrateTime[i] == 0) GivePlayerCash(i, amount), Update(i, pCashx), SCM(i, COLOR_LGREEN, "Felicitari! Ai castigat bani!");
                        for(i = 0; i < 5; i++) PlayerTextDrawHide(i, CrateTD[i]);
                    }
                }
            }

 

si primesc eroarea asta:

 

 


[debug] AMX backtrace:
[debug] #0 0035e4fc in public Timers () at C:\Users\Andrei\Desktop\burned.ro\gamemodes\wa-rpg.pwn:31352
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 1995 past array upper bound 1000

 

 

Asta e linia: if(CrateTime > 0) {

Problema e mai sus. Arata de unde vine "i"

Link to comment
Share on other sites

  • 0

function Timers() {
    new 
        string[180], szTD[600], anim,
        Float: ppHealth, Float: ppArmour,
        Float: x, Float: y, Float: z, Float: animpos[3], swinner[180];
        
    foreach(Player, i) {
        if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.