symbol is assigned a value that is never used: "LS1T"
#1

Hi!
i have this warning: symbol is assigned a value that is never used: "LS1T"

pawn Код:
CMD:lockls(playerid, params[])
{
    new string[128];
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* All the exits from Los-Santos locked!");
        format(string, sizeof(string), "All the exits from Los-Santos locked by %s ))", GetPlayerNameEx(playerid));
        SetDynamicObjectRot(CheckPointGates[2], 0.00000000,89.69036865,80.17822266);
        CheckPointGateStatus[2] = 1;
        SetDynamicObjectRot(CheckPointGates[3], 0.00000000,269.94769287,82.48538208);
        CheckPointGateStatus[3] = 1;
    new Text3D:LS1T;
        LS1T = Create3DTextLabel("Arrest Point\n{FFFF00}/arrest to arrest a criminal", COLOR_BLUE, 662.7000100,-1225.0999800,15.7000000, 12);

    }
}
Reply
#2

What do you need 'LS14T' for?
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
That is a local variable. Are you saving the return from "Create3DTextLabel" so that you can manipulate it (change/hide it) in the future after having shown it to the player? If so, you will need a global variable - locals are lost when the function they are in ends.
I Want that Create34TextLabel will show a text label, that with that variable LS1T.
Thats working but thats says symbol is assigned a value that is never used: "LS1T"

And yes, I want to manipulate it.
Reply
#4

I don't get what you want to do...
Anyways that kind of warning is harmless, if the message annoys you you can put this on top of the script:
pawn Код:
#pragma unused LS1T
Reply
#5

Quote:
Originally Posted by knackworst
Посмотреть сообщение
I don't get what you want to do...
Anyways that kind of warning is harmless, if the message annoys you you can put this on top of the script:
pawn Код:
#pragma unused LS1T
^ Better to solve than to hide, even though it is indeed a harmless warning.

Try placing this: new Text3D:LS1T; outside of the command so you can acces it outside of the command, after that just manipulate how you want it, the warning will disappear when you use the variable.
Reply
#6

However, if he only wants a 3D label at those coordinates and nothing else, he must use only:
pawn Код:
Create3DTextLabel("Arrest Point\n{FFFF00}/arrest to arrest a criminal", COLOR_BLUE, 662.7000100,-1225.0999800,15.7000000, 12);
There's not a reason to store the ID if you do not want to use it somewhere else. The warning will disappear by either using LS1T somewhere or removing it.
Reply
#7

Quote:
Originally Posted by knackworst
Посмотреть сообщение
What do you need 'LS14T' for?
Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
However, if he only wants a 3D label at those coordinates and nothing else, he must use only:
pawn Код:
Create3DTextLabel("Arrest Point\n{FFFF00}/arrest to arrest a criminal", COLOR_BLUE, 662.7000100,-1225.0999800,15.7000000, 12);
There's not a reason to store the ID if you do not want to use it somewhere else. The warning will disappear by either using LS1T somewhere or removing it.
But i want to save that as a variable!
I Want that i will be able to destroy this text...
Reply
#8

Then add the destroy code, and the warning will disappear because you used the variable, and thus, solved the warning.
Reply
#9

Quote:
Originally Posted by morha12
Посмотреть сообщение
But i want to save that as a variable!
I Want that i will be able to destroy this text...
Okay then! Make it global variable, assign the ID of the 3D Label to it and add the code you want to destroy it. It'll be fine after that.
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Okay then! Make it global variable, assign the ID of the 3D Label to it and add the code you want to destroy it. It'll be fine after that.
Ok so i did it like that:
pawn Код:
new LS1T;

CMD:lockls(playerid, params[])
{
    new string[128];
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* All the exits from Los-Santos locked!");
        format(string, sizeof(string), "All the exits from Los-Santos locked by %s ))", GetPlayerNameEx(playerid));
        SetDynamicObjectRot(CheckPointGates[2], 0.00000000,89.69036865,80.17822266);
        CheckPointGateStatus[2] = 1;
        SetDynamicObjectRot(CheckPointGates[3], 0.00000000,269.94769287,82.48538208);
        CheckPointGateStatus[3] = 1;
        //Morha13 Advanced Gates Start - New Gate Text
        LS1T = CreateDynamic3DTextLabel("This is test text!", COLOR_BLUE, 0.00000000,269.94769287,82.48538208, 12);
        //Morha13 Advanced Gates End - New Gate Text
    }
}
and now i have 2 warnings:
Код:
C:\Users\Mor\Downloads\Vas-Rp\gamemodes\VasRpV0.15Alpha.pwn(32364) : warning 213: tag mismatch
C:\Users\Mor\Downloads\Vas-Rp\gamemodes\VasRpV0.15Alpha.pwn(32364) : warning 204: symbol is assigned a value that is never used: "LS1T"
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)