[Help] 3DTextLabel just for cops..
#1

Heey.. . I have problem with 3dtext label.. I have script on create3dtextlabel on players with wanted level.. but i want to 3dtextlabel show only for cops.. here is script, but not does not work..

new Text3D:hehavewantedlevel;

SetTimer("ishepolice",500,1);


forward ishepolice(playerid);
public ishepolice(playerid)
{
if(iPlayerRole[playerid] == 4) // Police variable is this
{
texthehavewantedlevel(); //run public texthehavewantedlevel
}
return 1;
}


//======================================


forward texthehavewantedlevel();
public texthehavewantedlevel()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerWantedLevel(i) >=1) //if player have wanted level
{
hehavewantedlevel = Create3DTextLabel("THIS PLAYER IS WANTED",COLOR_MODRA,0.0,0.0,0.0,20,0,1); // create 3dtextlabel with global variable hehavewantedlevel..
Attach3DTextLabelToPlayer(hehavewantedlevel, i, 0.0, 0.0, 0.5); // attach to wanted player
}
}
}
return 1;
}


Thanks
Reply
#2

try the wiki - here is a head start for you...

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel
Reply
#3

Lol.. i dont know, that is this function.. sorry.. and thanks..
Reply
#4

Sorry, but here is problem.. i have cyklus and i can not use playerid.. because CreatePlayer3DTextLabel must be in cyklus.. Because attachedplayer must be "i"..
Reply
#5

Everyone will see it. What you're trying to achieve is (currently) impossible.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
Everyone will see it. What you're trying to achieve is (currently) impossible.
Really? But one server have this..
Reply
#7

pawn Код:
new PlayerText3D:PoliceLabel[MAX_PLAYERS];

for(new i; i <= MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i)) {
        if(gTeam[i] == TEAM_COP) { //Or whatever team system you use...
            PoliceLabel[i] = CreatePlayer3DTextLabel(i,"COPS CAN ONLY SEE THIS LABEL",COLOR_BLUE,X,Y,Z,40.0);
        }
    }
}
Reply
#8

Quote:
Originally Posted by Conroy
Посмотреть сообщение
pawn Код:
new PlayerText3D:PoliceLabel[MAX_PLAYERS];

for(new i; i <= MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i)) {
        if(gTeam[i] == TEAM_COP) { //Or whatever team system you use...
            PoliceLabel[i] = CreatePlayer3DTextLabel(i,"COPS CAN ONLY SEE THIS LABEL",COLOR_BLUE,X,Y,Z,40.0);
        }
    }
}
Yes, fine.. but i need with next i.. this label will been on player, if he have wanted level.. see 1. st post..
Reply
#9

pawn Код:
new PlayerText3D:PoliceWantedLabel[MAX_PLAYERS][MAX_PLAYERS];

for(new i; i <= MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i)) {
        if(GetPlayerWantedLevel(i) > 0) {
            for(new j; j <= MAX_PLAYERS; j++) {
                if(gTeam[j] == TEAM_COP) { //Or whatever team system you use...
                    PoliceLabel[j][i] = CreatePlayer3DTextLabel(j,"Wanted",COLOR_ORANGE,0.0,0.0,0.0,40.0,i);
                }
            }
        } else {
            DeletePlayer3DTextLabel(PoliceLabel[i][i]);
        }
    }
}
Reply
#10

Yeaaah.. it works.. I forget playerid/i.. thanks you very much )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)