Why get errors in this script ?
#1

I add this after OnPlayerSpawn
PHP код:
    {
    if(
PlayerInfo[playerid][pAdmin] <= 3)
    new 
Text3D:admin Create3DTextLabel("ADMIN"COLOR_RED100.0100.0100.0100.00);
    
Attach3DTextLabelToPlayer(adminplayerid0.00.00.25);
    }
    {
    if(
PlayerInfo[playerid][pVip] <= 2)
    new 
Text3D:vip Create3DTextLabel("V.I.P"COLOR_RED100.0100.0100.0100.00);
    
Attach3DTextLabelToPlayer(vipplayerid0.00.00.25);
    } 
And get errors :@
Reply
#2

bump
Reply
#3

Show the error lines and errors from compiling please.
Reply
#4

PHP код:
C:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(585) : error 003declaration of a local variable must appear in a compound block
C
:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(585) : warning 221label name "Text3D" shadows tag name
C
:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(585) : error 017undefined symbol "admin"
C:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(586) : error 017undefined symbol "admin"
C:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(590) : error 003declaration of a local variable must appear in a compound block
C
:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(590) : warning 221label name "Text3D" shadows tag name
C
:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(590) : error 017undefined symbol "vip"
C:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(591) : error 017undefined symbol "vip"
C:\Users\Niko\Desktop\DeathMatch server by bustern\gamemodes\DeathMatch.pwn(585) : warning 203symbol is never used"Text3D" 
Reply
#5

pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 3)
{
    new Text3D:admin = Create3DTextLabel("ADMIN", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(admin, playerid, 0.0, 0.0, 0.25);
}
if(PlayerInfo[playerid][pVip] <= 2)
{
    new Text3D:vip = Create3DTextLabel("V.I.P", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(vip, playerid, 0.0, 0.0, 0.25);
}
Reply
#6

Now everyone has tag
Reply
#7

Because you posted in the first post this
pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 3)
That means that only level 3 and below have tag... same as for vip.
If you want only level 3 and above + vip level 2 and above try this:
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 3)
{
    new Text3D:admin = Create3DTextLabel("ADMIN", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(admin, playerid, 0.0, 0.0, 0.25);
}
if(PlayerInfo[playerid][pVip] >= 2)
{
    new Text3D:vip = Create3DTextLabel("V.I.P", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(vip, playerid, 0.0, 0.0, 0.25);
}
Reply
#8

now noone have tag
Reply
#9

Jesus...

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0)
{
    new Text3D:admin = Create3DTextLabel("ADMIN", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(admin, playerid, 0.0, 0.0, 0.25);
}
if(PlayerInfo[playerid][pVip] > 0)
{
    new Text3D:vip = Create3DTextLabel("V.I.P", COLOR_RED, 100.0, 100.0, 100.0, 100.0, 0);
    Attach3DTextLabelToPlayer(vip, playerid, 0.0, 0.0, 0.25);
}
This is basic scripting bustern. At least ATTEMPT to learn scripting before asking for help.
Reply
#10

If you are assigning the tag to yourself, you won't be able to see it, only others can.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)