Jump to content
  • 0

Problema job goal!


Radutz

Question

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
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

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 !!!

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.