22.09.2010, 16:39
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
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