Jump to content

Question

Posted

primesc o eroare cand deschid un tip de crate, acesta fiind vehicle crate.

[Error] SetTimer(Ex): There was a problem in calling crate_openning: Array index out of bounds ( in consola ) 

cand deschid alt tip de crate merge perfect

 

ptask crate_openning[1000](playerid)
{
    new randomVehicles_td1,
        randomVehicles_td2,
        randomVehicles_td3,
        randomVehicles_td4,
        randomVehicles_td5,

        randomSkins_td1,
        randomSkins_td2,
        randomSkins_td3,
        randomSkins_td4,
        randomSkins_td5,

        vehicle_reward,
        skins_reward;

    if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td1 = random(10);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td1 = random(12);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td1 = random(15);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td1 = random(18);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td1 = random(20);
    if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td2 = random(10);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td2 = random(12);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td2 = random(15);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td2 = random(18);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td2 = random(20);
    if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td3 = random(10);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td3 = random(12);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td3 = random(15);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td3 = random(18);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td3 = random(20);
    if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td4 = random(10);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td4 = random(12);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td4 = random(15);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td4 = random(18);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td4 = random(20);
    if(playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td5 = random(10);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td5 = random(12);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td5 = random(15);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td5 = random(18);
    else if(playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td5 = random(20);

    if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td1 = random(10);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td1 = random(12);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td1 = random(15);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td1 = random(18);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td1 = random(20);
    if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td2 = random(10);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td2 = random(12);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td2 = random(15);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td2 = random(18);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td2 = random(20);
    if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td3 = random(10);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td3 = random(12);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td3 = random(15);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td3 = random(18);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td3 = random(20);
    if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td4 = random(10);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td4 = random(12);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td4 = random(15);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td4 = random(18);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td4 = random(20);
    if(playerVariables[playerid][pCrate10xSkinsSkill] == 1) randomSkins_td5 = random(10);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 2) randomSkins_td5 = random(12);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 3) randomSkins_td5 = random(15);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 4) randomSkins_td5 = random(18);
    else if(playerVariables[playerid][pCrate10xSkinsSkill] == 5) randomSkins_td5 = random(20);

    switch(player_selected_crate[playerid])
    {
        case 1: {
            if(crate_timer[playerid] > 0)
            {
                crate_timer[playerid] --;

                gString[0] = EOS;
                format(gString, sizeof gString, "Crate openning time: ~y~%d~w~ seconds", crate_timer[playerid]);
                PlayerTextDrawSetString(playerid, ptd_crates[11], gString);

                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[3], getCrateVehiclesModel(playerid, randomVehicles_td1)), vehicle_reward = getCrateVehiclesModel(playerid, randomVehicles_td1);
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[6], getCrateVehiclesModel(playerid, randomVehicles_td2));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[7], getCrateVehiclesModel(playerid, randomVehicles_td3));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[8], getCrateVehiclesModel(playerid, randomVehicles_td4));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[9], getCrateVehiclesModel(playerid, randomVehicles_td5));
                PlayerTextDrawShow(playerid, ptd_crates[3]);
                PlayerTextDrawShow(playerid, ptd_crates[6]); PlayerTextDrawShow(playerid, ptd_crates[7]);
                PlayerTextDrawShow(playerid, ptd_crates[8]); PlayerTextDrawShow(playerid, ptd_crates[9]);

                gString[0] = EOS;
                format(gString, sizeof gString, "%s", vehNames[vehicle_reward-400]);
                PlayerTextDrawSetString(playerid, ptd_crates[4], gString);

                if(crate_timer[playerid] <= 0)
                {
                    if(GetPlayerVehicles(playerid) >= playerVariables[playerid][pMaxVehicles]) {
                        SCM(playerid, COLOR_GREY, "Nu ai primit vehiculul deoarece nu ai un slot liber.");
                        return true;
                    }    

                    gString[0] = (EOS);
                    format(gString, sizeof gString, "* You openned 'Crate 10x Vehicles' and won vehicle %s. Congrulations!", vehNames[vehicle_reward-400]);
                    SendClientMessage(playerid, COLOR_YELLOW, gString);

                    gString[0] = (EOS);
                    format(gString, sizeof gString, "(( %s openned Crate 10x Vehicles and won vehicle %s. Congrulations! ))", GetName(playerid), vehNames[vehicle_reward-400]);
                    SendClientMessageToAll(COLOR_ANNOUNCE, gString);

                    new ds = random(sizeof(ds_pos));
                    GivePlayerVehicle(playerid, vehicle_reward, ds_pos[ds][0], ds_pos[ds][1], ds_pos[ds][2], 90.0, 1);

                    playerVariables[playerid][pCrate10xVehicles] --;
                    playerVariables[playerid][pCrate10xVehiclesOpen] ++;
                    if(playerVariables[playerid][pCrate10xVehiclesOpen] >= playerVariables[playerid][pCrate10xVehiclesSkill] * 10) {
                        playerVariables[playerid][pCrate10xVehiclesSkill] ++;
                        SCM(playerid, COLOR_YELLOW, "Ai avansat la Skill %d pentru acest crate. Ti-au fost adaugate vehicule noi!", playerVariables[playerid][pCrate10xVehiclesSkill]);
                    }

                    gQuery[0] = EOS;
                    mysql_format(SQL, gQuery, sizeof(gQuery), "update `server_accounts` set `Crate10xVehicles` = %d, `Crate10xVehiclesOpen` = %d, `Crate10xVehiclesSkill` = %d where `playerID` = '%d'", playerVariables[playerid][pCrate10xVehicles], playerVariables[playerid][pCrate10xVehiclesOpen], playerVariables[playerid][pCrate10xVehiclesSkill], playerVariables[playerid][pSQLID]);
                    mysql_tquery(SQL, gQuery, "", "");
                    return true;
                }
            }
        }
        case 2: {
            if(crate_timer[playerid] > 0)
            {
                crate_timer[playerid] --;

                gString[0] = EOS;
                format(gString, sizeof gString, "Crate openning time: ~y~%d~w~ seconds", crate_timer[playerid]);
                PlayerTextDrawSetString(playerid, ptd_crates[11], gString);

                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[3], getCrateSkinsModel(playerid, randomSkins_td1)), skins_reward = getCrateSkinsModel(playerid, randomSkins_td1);
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[6], getCrateSkinsModel(playerid, randomSkins_td2));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[7], getCrateSkinsModel(playerid, randomSkins_td3));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[8], getCrateSkinsModel(playerid, randomSkins_td4));
                PlayerTextDrawSetPreviewModel(playerid, ptd_crates[9], getCrateSkinsModel(playerid, randomSkins_td5));
                PlayerTextDrawShow(playerid, ptd_crates[3]);
                PlayerTextDrawShow(playerid, ptd_crates[6]); PlayerTextDrawShow(playerid, ptd_crates[7]);
                PlayerTextDrawShow(playerid, ptd_crates[8]); PlayerTextDrawShow(playerid, ptd_crates[9]);

                gString[0] = EOS;
                format(gString, sizeof gString, "Skin %d (%s%s~w~)", skins_reward, skin_td_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
                PlayerTextDrawSetString(playerid, ptd_crates[4], gString);

                if(crate_timer[playerid] <= 0)
                {
                    if(GetPlayerSkins(playerid) >= MAX_SKINS_OWNED) 
                        return SCM(playerid, COLOR_GREY, "Error: "EMBED_WHITE"Ai deja maxim-ul de skin-uri.");

                    if(have_this_skin(playerid, skins_reward))
                    {
                        SCM(playerid, COLOR_LGREEN, "* Nu ai primit skin-ul #%d deoarece il ai deja!", skins_reward);
                        return true;
                    }

                    gString[0] = (EOS);
                    format(gString, sizeof gString, "* You openned 'Crate 10x Skins' and won Skin %d ({%s}%s{FFFF00}). Congrulations!", skins_reward, skin_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
                    SendClientMessage(playerid, COLOR_YELLOW, gString);

                    gString[0] = (EOS);
                    format(gString, sizeof gString, "(( %s openned Crate 10x Skins and won Skin %d ({%s}%s"EMBED_ANNOUNCE"). Congrulations! ))", GetName(playerid), skins_reward, skin_colors[GetSkinRarity(skins_reward)], skin_rarity[GetSkinRarity(skins_reward)]);
                    SendClientMessageToAll(COLOR_ANNOUNCE, gString);

                    GivePlayerSkin(playerid, skins_reward);

                    playerVariables[playerid][pCrate10xSkins] --;
                    playerVariables[playerid][pCrate10xSkinsOpen] ++;
                    if(playerVariables[playerid][pCrate10xSkinsOpen] >= playerVariables[playerid][pCrate10xSkinsSkill] * 10) {
                        playerVariables[playerid][pCrate10xSkinsSkill] ++;
                        SCM(playerid, COLOR_YELLOW, "Ai avansat la Skill %d pentru acest crate. Ti-au fost adaugate skin-uri noi!", playerVariables[playerid][pCrate10xSkinsSkill]);
                    }

                    gQuery[0] = EOS;
                    mysql_format(SQL, gQuery, sizeof(gQuery), "update `server_accounts` set `Crate10xSkins` = %d, `Crate10xSkinsOpen` = %d, `Crate10xSkinsSkill` = %d where `playerID` = '%d'", playerVariables[playerid][pCrate10xSkins], playerVariables[playerid][pCrate10xSkinsOpen], playerVariables[playerid][pCrate10xSkinsSkill], playerVariables[playerid][pSQLID]);
                    mysql_tquery(SQL, gQuery, "", "");
                    return true;
                }
            }
        }
    }
    return true;
}

 

daca ma poate ajuta cnv ms

14 answers to this question

Recommended Posts

  • 0
Posted (edited)

Pentru inceput optimizeaza codul...

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td1 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td1 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td1 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td1 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td1 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td2 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td2 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td2 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td2 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td2 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td3 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td3 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td3 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td3 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td3 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td4 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td4 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td4 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td4 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td4 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td5 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td5 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td5 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td5 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td5 = random(20);

cu urmatorul:

// Versiune modificata
new values[5] = { 10, 12, 15, 18, 20 };
for(new i = 0; i < 5; i++)
{
   if(playerVariables[playerid][pCrate10xVehiclesSkill] == i+1)
   {
      randomVehicles_td1 = random(values[i]);
      randomVehicles_td2 = random(values[i]);
      randomVehicles_td3 = random(values[i]);
      randomVehicles_td4 = random(values[i]);
      randomVehicles_td5 = random(values[i]);
   }
}

 

-- Array out of bounds se da atunci cand valoarea setata este mai mare decat matricea/array-ul

Ex:

new val = 5; // valorea setata
new matrice[4];

printf("valoare: %d", matrice[val]); // -> eroare array index out of bounds 

Motivul pentru care apare aceasta eroare este datorat de valoarea "val" pentru ca este 5 iar in variabila "matrice" maximul este de 4, matricea/array-ul pleaca intodeauna de la 0 daca nu sunt conditii in functia "for/while", dar nu poate fi depasit de valoarea matricei

 

Nu ne-ai dat linia in care apare problema, nu o sa stau sa verific fiecare linie, pe langa ca nu sunt toate datele postate.

Edited by iSkull
  • 0
Posted
32 minutes ago, iSkull said:

Pentru inceput optimizeaza codul...

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td1 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td1 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td1 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td1 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td1 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td2 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td2 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td2 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td2 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td2 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td3 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td3 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td3 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td3 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td3 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td4 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td4 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td4 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td4 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td4 = random(20);

if (playerVariables[playerid][pCrate10xVehiclesSkill] == 1) randomVehicles_td5 = random(10);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 2) randomVehicles_td5 = random(12);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 3) randomVehicles_td5 = random(15);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 4) randomVehicles_td5 = random(18);
else if (playerVariables[playerid][pCrate10xVehiclesSkill] == 5) randomVehicles_td5 = random(20);

cu urmatorul:

for(new i = 1; i <= 5; i++)
{
   if(playerVariables[playerid][pCrate10xVehiclesSkill] == i)
   {
      
		randomVehicles_td1 = random(10);
      randomVehicles_td2 = random(12);
      randomVehicles_td3 = random(15);
      randomVehicles_td4 = random(18);
      randomVehicles_td5 = random(20);
   }
}

 

-- Array out of bounds se da atunci cand valoarea setata este mai mare decat matricea/array-ul

Ex:

new val = 5; // valorea setata
new matrice[4];

printf("valoare: %d", matrice[val]); // -> eroare array index out of bounds 

Motivul pentru care apare aceasta eroare este datorat de valoarea "val" pentru ca este 5 iar in variabila "matrice" maximul este de 4, matricea/array-ul pleaca intodeauna de la 0 daca nu sunt conditii in functia "for/while", dar nu poate fi depasit de valoarea matricei

 

Nu ne-ai dat linia in care apare problema, nu o sa stau sa verific fiecare linie, pe langa ca nu sunt toate datele postate.

ai optimizat ce-i drept... te-a ajutat AI-ul?

  • 0
Posted
8 minutes ago, Sancky said:

ai optimizat ce-i drept... te-a ajutat AI-ul?

Pentru inculti ca tine, care apar peste noapte pe comunitate, tine o pentru tine ;) 

  • 0
Posted
7 minutes ago, iSkull said:

Pentru inculti ca tine, care apar peste noapte pe comunitate, tine o pentru tine ;) 

pai ce ai 'optimizat' tu difera de codul pe care l-a postat omu', ai schimbat complet logica lui, daca nu stii nimic nu te mai baga la creatie dle.

  • 0
Posted (edited)

Nu are rost sa fac off topic, invata sa faci analiza la codul postat de el dupa sa comentezi prietene, daca tot esti asa de smecher, posteaza ca sa-l ajuti, nu ca sa-ti arati prostia din tine ;) 

El efectueaza 3 verificari pe acelasi lucru

Ex: daca skill ul este egal cu 1 => pune "randomVehicles_td1, randomVehicles_td2 etc" cu random 10, nu are rost sa-mi bat capul cu "destepti" ca tine

 

-- Edit: Am uitat doar de conditii ;) care se pot remedia usor

Edited by iSkull
  • 0
Posted
1 minute ago, iSkull said:

Nu are rost sa fac off topic, invata sa faci analiza la codul postat de el dupa sa comentezi prietene, daca tot esti asa de smecher, posteaza ca sa-l ajuti, nu ca sa-ti arati prostia din tine ;) 

El efectueaza 3 verificari pe acelasi lucru

Ex: daca skill ul este egal cu 1 => pune "randomVehicles_td1, randomVehicles_td2 etc" cu random 10, nu are rost sa-mi bat capul cu "destepti" ca tine

mai citeste codu ala de 10 ori, am impresia ca n ai codat nimic la viata ta, saracu de tine inveti acu si iti arati prostiile la lume

  • 0
Posted

incearca sa faci cu task + foreach adica in loc de ptask pune task crate_timer[1000]() {

sub variabile alea pe cara le-ai definit pune foreach(new playerid : Players) {

//codu tau

}

return true;

}

daca eroarea persista cred ca e ceva de la o variabila, crate_timer / player_selected_crate

ar trebui sa fie definite new crate_timer[MAX_PLAYERS] si new player_selected_crate[MAX_PLAYERS]

daca nu se rezolva asgood pe discord

maxresdefault.jpg

 

 

 

  • 0
Posted
5 minutes ago, ASGOOD said:

incearca sa faci cu task + foreach adica in loc de ptask pune task crate_timer[1000]() {

sub variabile alea pe cara le-ai definit pune foreach(new playerid : Players) {

//codu tau

}

return true;

}

daca eroarea persista cred ca e ceva de la o variabila, crate_timer / player_selected_crate

ar trebui sa fie definite new crate_timer[MAX_PLAYERS] si new player_selected_crate[MAX_PLAYERS]

daca nu se rezolva asgood pe discord

de ce ai rula cv in background tot timpul cand nu este necesar? 

  • 0
Posted (edited)
1 minute ago, Sancky said:

de ce ai rula cv in background tot timpul cand nu este necesar? 

de ce i-as reface eu codul ca sa nu mai ruleze ceva in gamemode cand nu e necesar

il ajut sa-si rez problema, nu codu

Edited by ASGOOD

maxresdefault.jpg

 

 

 

  • 0
Posted
1 minute ago, ASGOOD said:

de ce i-as reface eu codul ca sa nu mai ruleze ceva in gamemode cand nu e necesar

il ajut sa-si rez problema, nu codu

ce ai zis tu nu prea relateaza cu problema lui, problema lui e ca acceseaza un index invalid la vreun array din timer-ul ala, poa' sa foloseasca crashdetect sa vada exact linia fara sa mai faca debugging la tot ce i acolo

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.