SA-MP Forums Archive
Label problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Label problem (/showthread.php?tid=345367)



Label problem - Face9000 - 24.05.2012

Hello,i've added a textlabel to the players with wanted level.From 1 to 3 it shows the label "Ticketable",from 4 to 10 it's "Arrestable",but seems not work:

1989 : error 002: only a single statement (or expression) can follow each "case"
1989 : warning 215: expression has no effect
1991 : error 014: invalid statement; not in switch
1991 : warning 215: expression has no effect
1991 : error 001: expected token: ";", but found ".."
1991 : error 029: invalid expression, assumed zero
1991 : fatal error 107: too many error messages on one line

This is the new for labels:

pawn Код:
new Text3D:Ticketable[MAX_PLAYERS];
new Text3D:Arrestable[MAX_PLAYERS];
And this is where they are applied:

pawn Код:
public WantedColor()
{
    for (new i; i < MAX_PLAYERS; i++)
    {
        switch(GetPlayerWantedLevel(i))
        {
            case 1..3:
            Ticketable[i] = Create3DTextLabel("Suspect - Ticketable",yellow,30.0,40.0,50.0,40.0,0);
            Attach3DTextLabelToPlayer(Ticketable[i], i, 0.0, 0.0, 0.7);
            SetPlayerColor(i,yellow);

            case 4..10:
            Arrestable[i] = Create3DTextLabel("Suspect - Arrestable",red,30.0,40.0,50.0,40.0,0);
            Attach3DTextLabelToPlayer(Arrestable[i], i, 0.0, 0.0, 0.7);
            SetPlayerColor(i,red);
        }
    }
}
Thanks for help


Re: Label problem - ViniBorn - 24.05.2012

pawn Код:
public WantedColor()
{
    for (new i; i < MAX_PLAYERS; i++)
    {
        switch(GetPlayerWantedLevel(i))
        {
            case 1..3:
            {
                Ticketable[i] = Create3DTextLabel("Suspect - Ticketable",yellow,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer(Ticketable[i], i, 0.0, 0.0, 0.7);
                SetPlayerColor(i,yellow);
            }
            case 4..10:
            {
                Arrestable[i] = Create3DTextLabel("Suspect - Arrestable",red,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer(Arrestable[i], i, 0.0, 0.0, 0.7);
                SetPlayerColor(i,red);
            }
        }
    }
}



Re: Label problem - Face9000 - 24.05.2012

Now i got lots of general errors.


Re: Label problem - ViniBorn - 24.05.2012

I put this in my GM. No errros.

pawn Код:
new Text3D:Ticketable[MAX_PLAYERS],Text3D:Arrestable[MAX_PLAYERS];
forward WantedColor();
public WantedColor()
{
    for (new i; i < MAX_PLAYERS; i++)
    {
        switch(GetPlayerWantedLevel(i))
        {
            case 1..3:
            {
                Ticketable[i] = Create3DTextLabel("Suspect - Ticketable",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer(Ticketable[i], i, 0.0, 0.0, 0.7);
                SetPlayerColor(i,-1);
            }
            case 4..10:
            {
                Arrestable[i] = Create3DTextLabel("Suspect - Arrestable",-2,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer(Arrestable[i], i, 0.0, 0.0, 0.7);
                SetPlayerColor(i,-2);
            }
        }
    }
}



Re: Label problem - Face9000 - 24.05.2012

Nope,still lot of general errors.


Re: Label problem - SnG.Scot_MisCuDI - 24.05.2012

EDIT: oops. sorry


Re: Label problem - Face9000 - 24.05.2012

Bump.


Re: Label problem - Jonny5 - 24.05.2012

well post the new errors
clearly you did not use brackets in the first code's switch statement

that was fixed, post the other errors.
and STOP BUMPING
read the forum rules,

if your not gonna provide anymore useful then no one can help you.


Re: Label problem - Face9000 - 24.05.2012

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
well post the new errors
clearly you did not use brackets in the first code's switch statement

that was fixed, post the other errors.
and STOP BUMPING
read the forum rules,

if your not gonna provide anymore useful then no one can help you.
ikr,sorry for bumping,the errors i get after using Viniborn's code,are not releated to the code it self,but are the other defines/functions.

If i remove that code,i dont get any errors,so that code is the problem.If i use my original code,i get only that 7 errors i posted in the first post.


Re: Label problem - ricardo178 - 24.05.2012

Post these and the code... You know, if you remove code everytime it shows an error on it, you will find out there are things which wont work in-game. Hehehe.