Jump to content
  • 0

Problema


Alex244

Question

22:17:49] [debug] #0 00072cf0 in public SetPlayerUnjail () from ro-rpg.amx
[22:17:50] [debug] Run time error 4: "Array index out of bounds"
[22:17:50] [debug]  Accessing element at index 16 past array upper bound 15
[22:17:50] [debug] AMX backtrace:
[22:17:50] [debug] #0 000cff90 in public cmd_attack (0, 161953272) from ro-rpg.amx
[22:17:50] [debug] #1 native CallLocalFunction () from samp-server.exe
[22:17:50] [debug] #2 00008be8 in public OnPlayerCommandText (0, 161953240) from ro-rpg.amx
[22:17:50] [debug] Run time error 4: "Array index out of bounds"
[22:17:50] [debug]  Accessing element at index 16 past array upper bound 15
[22:17:50] [debug] AMX backtrace:

 

public SetPlayerUnjail()
{
    /*new
    Float: animpos[3],
    anim;*/
    
    // War deelay    
    for(new i = 0; i < 16; i++) {
        if(FactionDeelay[i] >= 1) {
            FactionDeelay[i] --;
            if(FactionDeelay[i] == 0) {
                SendFactionMessage(i, COLOR_MONEY, "[WAR] Acum mafia ta poate ataca un teritoriu!");
            }
        }
    }        
    
    if(painttime > 0)
    {
        painttime--;
    }
        
    new string[256];
    if(PaintText[0] != 0) {
        PaintText[0] --;
        if(PaintText[0] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
        else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[0]);
        GameTextForPaint(string, 0);
    }
    if(PaintText[1] != 0) {
        PaintText[1] --;
        if(PaintText[1] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
        else  format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[1]);
        GameTextForPaint(string, 1);
    }    
    if(PaintText[2] != 0) {
        PaintText[2] --;
        if(PaintText[2] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
        else  format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[2]);
        GameTextForPaint(string, 2);
    }                        
    if(PlayersOnPaint(0) >= 2 && PaintTime[0] > 0) {
        PaintTime[0] --;
        if(PaintTime[0] == 0) {
            SendPaintMessage(1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
            PaintVote[0] = 1;    
            if(PaintTimer[0] != 0) KillTimer(PaintTimer[0]), PaintTimer[0] = 0;
            PaintTimer[0] = SetTimerEx("CalculateVote", 60000, 0, "i", 0);        
        }
    }
    if(PlayersOnPaint(1) >= 2 && PaintTime[1] > 0) {
        PaintTime[1] --;
        if(PaintTime[1] == 0) {
            SendPaintMessage(1+1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
            PaintVote[1] = 1;    
            if(PaintTimer[1] != 0) KillTimer(PaintTimer[1]), PaintTimer[1] = 0;
            PaintTimer[1] = SetTimerEx("CalculateVote", 60000, 0, "i", 1);        
        }        
    }
    if(PlayersOnPaint(2) >= 2 && PaintTime[2] > 0) {
        PaintTime[2] --;
        if(PaintTime[2] == 0) {
            SendPaintMessage(2+1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, folositi comanda /votemap.");
            PaintVote[2] = 1;    
            if(PaintTimer[2] != 0) KillTimer(PaintTimer[2]), PaintTimer[2] = 0;
            PaintTimer[2] = SetTimerEx("CalculateVote", 60000, 0, "i", 2);        
        }        
    }    

@KnowN

@WopsS

@Daedric-Fox

@Maurice si cine mai are experienta

@Donboo

@Scriptery

@TheRow

Sau chiar alt cineva care stie.

E mai mare public, eu v-am dat doar atat,pentru ca am creeat doar o mafie.

Edited by Alex244
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Acum 12 ore, WopsS a spus:

Cum ai definit FactionDeelay? Compilează gamemode-ul cu d3 să îți zică și linia.

new FactionDeelay[16]; , am pus si 17 , tot nu merge.

Sincer, nu stiu cum sa compilez cu d3  , dar cu n++ n-am erori la compilare.

 

Link to comment
Share on other sites

  • 0
    // War deelay    
    for(new i = 0; i < sizeof(FactionDeelay); i++) {
        if(FactionDeelay[i] >= 1) {
            FactionDeelay[i] --;
            if(FactionDeelay[i] == 0) {
                SendFactionMessage(i, COLOR_MONEY, "[WAR] Acum mafia ta poate ataca un teritoriu!");
            }
        }
    }  

 

Link to comment
Share on other sites

  • 0
3 hours ago, BuNiCu-RP said:

    // War deelay    
    for(new i = 0; i < sizeof(FactionDeelay); i++) {
        if(FactionDeelay[i] >= 1) {
            FactionDeelay[i] --;
            if(FactionDeelay[i] == 0) {
                SendFactionMessage(i, COLOR_MONEY, "[WAR] Acum mafia ta poate ataca un teritoriu!");
            }
        }
    }  

 

tot asa

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.