Jump to content

Question

Posted

Salut, am incercat sa fac un sistem de roll, dar cand compilez, imi apare exact asa: https://imgur.com/a/Bqh0MgI . Nu este vreo eroare, sau ceva, nu am dat scroll, am incercat sa compilez si cu pawno, nu cu Sublime, si exact aceeasi problema(doar ca la pawno, nici macar aia cu "Finished" nu apare). Am lasat sa se incarce, m-am gandit ca poate nu au aparut inca erorile, dar degeaba. Chestia asta se intampla dupa ce scriu ceva, daca sterg treaba cu roll, compileaza absolut normal. Ma puteti ajuta? Multumesc.

12 answers to this question

Recommended Posts

  • 0
Posted (edited)
3 minutes ago, andy47 said:

Ti-am zis sa imi dai toata comanda, mie mi se pare ca ai omis o paranteza.

Poftim
 

CMD:roll(playerid, params[]) {
    if(PlayerInfo[playerid][pRollPoints] < 100 return SCM(playerid), -1, "Nu ai 100 Roll Points!");    
    
    PlayerInfo[playerid][pRollPints] = 0;
    Update(playerid, pRollPointsx);
    
    new rand = random(30), string[64];

    switch(rand) {
        case 0..15: {
            new amount = 100000 + random(400000);
            format(string, sizeof(string), "Ai castigat $%s.", FormatNumber(amount));
            SCM(playerid, COLOR_YELLOW, string);
            GivePlayerCash(playerid, amount);
        }
        case 16..20: {
            PlayerInfo[playerid][pLevel] ++;
            Update(playerid, pLevelx);
            format(string, sizeof(string), "Ai castigat 1x Level Up, acum ai level %d.", PlayerInfo[playerid][pLevel]);
            SCM(playerid, COLOR_YELLOW, string);
        }
        case 21..30: {
            new amount = 1 + random(5);
            PlayerInfo[playerid][pExp] += amount;
            Update(playerid, pRP);
            format(string, sizeof(string), "Ai castigat %d RP-uri.", amount);
            SCM(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}

 

EDIT: Pe langa comanda creeata, am mai facut asta la public PayDay

if(PlayerInfo[pRollPoints] < 100) PlayerInfo[pRollPoints] += 20, Update(i, pRollPointsx);

                format(string, sizeof(string), "Roll Points %d/100", PlayerInfo[pRollPoints]);
                SCM(i, COLOR_YELLOW, string);

Edited by Albert Constantin
  • 0
Posted
CMD:roll(playerid, params[])
{
    if(PlayerInfo[playerid][pRollPoints] < 100) return SCM(playerid, -1, "Nu ai 100 Roll Points!");

    PlayerInfo[playerid][pRollPints] = 0;
    Update(playerid, pRollPointsx);

    new rand = random(30), string[64];

    switch(rand) {
        case 0..15: {
            new amount = 100000 + random(400000);
            format(string, sizeof(string), "Ai castigat $%s.", FormatNumber(amount));
            SCM(playerid, COLOR_YELLOW, string);
            GivePlayerCash(playerid, amount);
        }
        case 16..20: {
            PlayerInfo[playerid][pLevel] ++;
            Update(playerid, pLevelx);
            format(string, sizeof(string), "Ai castigat 1x Level Up, acum ai level %d.", PlayerInfo[playerid][pLevel]);
            SCM(playerid, COLOR_YELLOW, string);
        }
        case 21..30: {
            new amount = 1 + random(5);
            PlayerInfo[playerid][pExp] += amount;
            Update(playerid, pRP);
            format(string, sizeof(string), "Ai castigat %d RP-uri.", amount);
            SCM(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}

 

  • 0
Posted
5 minutes ago, andy47 said:

CMD:roll(playerid, params[])
{
    if(PlayerInfo[playerid][pRollPoints] < 100) return SCM(playerid, -1, "Nu ai 100 Roll Points!");

    PlayerInfo[playerid][pRollPints] = 0;
    Update(playerid, pRollPointsx);

    new rand = random(30), string[64];

    switch(rand) {
        case 0..15: {
            new amount = 100000 + random(400000);
            format(string, sizeof(string), "Ai castigat $%s.", FormatNumber(amount));
            SCM(playerid, COLOR_YELLOW, string);
            GivePlayerCash(playerid, amount);
        }
        case 16..20: {
            PlayerInfo[playerid][pLevel] ++;
            Update(playerid, pLevelx);
            format(string, sizeof(string), "Ai castigat 1x Level Up, acum ai level %d.", PlayerInfo[playerid][pLevel]);
            SCM(playerid, COLOR_YELLOW, string);
        }
        case 21..30: {
            new amount = 1 + random(5);
            PlayerInfo[playerid][pExp] += amount;
            Update(playerid, pRP);
            format(string, sizeof(string), "Ai castigat %d RP-uri.", amount);
            SCM(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}

 

Gata fram, merge absolut perfect. Multumesc! Care era problema, te rog, in caz ca mi se mai intampla, sa stiu s-o rezolv singur. Multumesc mult de ajutor!

  • 0
Posted

Acum dadeam edit. Ai omis unele paranteze si vezi codul care l-ai mai adaugat e gresit.

if(PlayerInfo[pRollPoints] < 100) PlayerInfo[pRollPoints] += 20, Update(i, pRollPointsx);

format(string, sizeof(string), "Roll Points %d/100", PlayerInfo[pRollPoints]);
SCM(i, COLOR_YELLOW, string);
                                 
                                 
if(PlayerInfo[playerid][pRollPoints] < 100) 
{
	PlayerInfo[playerid][pRollPoints] += 20;
	Update(i, pRollPointsx);
    format(string, sizeof(string), "Roll Points %d/100", PlayerInfo[playerid][pRollPoints]);
    SCM(i, COLOR_YELLOW, string);
}         

 

  • 0
Posted

Mie mi-a compilat bine, doar ca gresisem eu anumite lucruri, pusesem "pRollPints", sau ceva de genu', in loc de Points, din graba, cand scriam la tastatura, si nu m-am uitat ce am scris, imi dadea "simbol nedefinit, dar am reparat, si la un moment dat, pusesem 2 paranteze una sub alta, ce nu-si aveau rosul, si aia era una dintre erorile ce mi le dadea dupa ce am bagat comanda de la tine, dar am sters una, si mi-a compilat perfect. Nedumerirea mea e ca de ce la comanda de la tine mi-a dat erori (pe care ulterior le-am rezolvat), si la mine nici erori, nici compilare reusita :D

  • 0
Posted (edited)
if(PlayerInfo[playerid][pRollPoints] < 100 return SCM(playerid), -1, "Nu ai 100 Roll Points!");  

Tu asa aveai scrisa linia asta, uitate cum am scris-o eu si trage singur concluzile. 😂 Fi mai atent! T/C!

Edited by andy47
  • 0
Posted
21 minutes ago, andy47 said:

if(PlayerInfo[playerid][pRollPoints] < 100 return SCM(playerid), -1, "Nu ai 100 Roll Points!");  

Tu asa aveai scrisa linia asta, uitate cum am scris-o eu si trage singur concluzile. 😂 Fi mai atent! T/C!

Aa, eu prost, aveam paranteza aia dupa "playerid" inutila acolo, da :)))) Multumesc mult de ajutor fram! Sanatate!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.