Jump to content
  • 0

Problema job goal!


Question

Posted (edited)

Salut! imi da aceste erori cum le pot rezolva?

C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : warning 217: loose indentation
C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : error 014: invalid statement; not in switch
C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : warning 215: expression has no effect
C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : error 001: expected token: ";", but found ":"
C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : error 029: invalid expression, assumed zero
C:\Users\Radutz\Desktop\gm pe localhost\gamemodes\gmm.pwn(11210) : fatal error 107: too many error messages on one line

 

code:

                case 10: {    
                    switch(showserverjobgoal[playerid]) {
                        case 0: {
                            showserverjobgoal[playerid] = 1;
                              new manevra[64];
                              format(manevra, 64, "~g~$%s~n~~w~out_of~n~$70.000.000", FormatNumber(server_jobgoal));
                              TextDrawSetString(jobgoaltextdraw[1], manevra);
                            TextDrawShowForPlayer(playerid, jobgoaltextdraw[0]);
                            TextDrawShowForPlayer(playerid, jobgoaltextdraw[1]);  
                        }
                        case 1: {
                            showserverjobgoal[playerid] = 0;
                            TextDrawHideForPlayer(playerid, jobgoaltextdraw[0]);
                            TextDrawHideForPlayer(playerid, jobgoaltextdraw[1]);
                        }
                    }                                    
            }

 

Si mai am o problema la comanda /hud

    //12
    if(showserverjobgoal[playerid] == 0) format(string, sizeof(string), "JobGoal\t{FF0000}Dezactivat{FFFFFF}\n");
    else format(string, sizeof(string), "JobGoal\t{0AC917}Activat{FFFFFF}\n");        
    strcat(szDialog, string);

nu pot sa activez si sa dezactivez din /hud

 

Edited by Radutz

1 answer to this question

Recommended Posts

  • 0
Posted

Erorile "vin" de la o singura linie si in eventualele cereri de ajutor de aici iti recomand sa ne lasi si linia indicata de compilator, respectiv linia "11210" in acest caz.

Primul este un warning si iti este afisat din cauza ca nu lucrezi ordonat. (Documenteaza-te te rog aici, foloseste TAB-ul pentru spatiul de 4 caractere lipsa) Dar in orice caz, poate sa para destul de obositor si se poate remedia aceasta problema cu: "#pragma tabsize 0", adauga functia asta la inceput de GM.

Cum ar trebui sa arate linia pentru a anula toate avertizarile date de compilator:

case 10:
{    
    switch(showserverjobgoal[playerid])
    {
        case 0:
        {
            showserverjobgoal[playerid] = 1;
            new manevra[64];
            format(manevra, 64, "~g~$%s~n~~w~out_of~n~$70.000.000", FormatNumber(server_jobgoal));
            TextDrawSetString(jobgoaltextdraw[1], manevra);
            TextDrawShowForPlayer(playerid, jobgoaltextdraw[0]);
            TextDrawShowForPlayer(playerid, jobgoaltextdraw[1]);  
        }
        case 1:
        {
            showserverjobgoal[playerid] = 0;
            TextDrawHideForPlayer(playerid, jobgoaltextdraw[0]);
            TextDrawHideForPlayer(playerid, jobgoaltextdraw[1]);
        }
    }
}

Codul acesta nu prezinta erori de ordin tehnic, cu siguranta problema este in alta parte, retine ce ti-am spus mai sus.

Cat pentru a2-a problema cu HUD-ul, n-am inteles problema in sine si din acel cod expus aici chiar nu putem gasi o cauza responsabila pentru bug.

The best of the best!

Awesome !!!

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.