SA-MP Forums Archive
[Help] 3DTextLabel just for cops.. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] 3DTextLabel just for cops.. (/showthread.php?tid=178516)



[Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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


Re: [Help] 3DTextLabel just for cops.. - Rachael - 22.09.2010

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

https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel


Re: [Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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


Re: [Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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"..


Re: [Help] 3DTextLabel just for cops.. - Vince - 22.09.2010

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


Re: [Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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


Re: [Help] 3DTextLabel just for cops.. - Conroy - 22.09.2010

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);
        }
    }
}



Re: [Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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


Re: [Help] 3DTextLabel just for cops.. - Conroy - 22.09.2010

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]);
        }
    }
}



Re: [Help] 3DTextLabel just for cops.. - Kuba5 - 22.09.2010

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