SA-MP Forums Archive
Wanted Show above the Head - 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: Wanted Show above the Head (/showthread.php?tid=271460)



Wanted Show above the Head - gunitstyler - 24.07.2011

hey,

at the moment i want to have a system, which shows the cops how many wanteds the person has.

So I began to work with OnPlayerStreamIn..

I used CreatePlayer3DTextLabel for attaching the 3DText. But this function creates the Text on one position.
So I wanted to help out with Attach3DTextLabelToPlayer...

But this doesnt work. I always get the message : tag mismatch...

Can someone help out?

Here's the code:

Код:
	
new Text3D:playertextid[MAX_PLAYERS];

if(SpielerInfo[forplayerid][pFraktion] == 1)
{
    	new Float:X, Float:Y, Float:Z;
    	GetPlayerPos( playerid, X, Y, Z );
    	playertextid[playerid] = CreatePlayer3DTextLabel(forplayerid,"Hello\nI'm at your       position",0x008080FF,X,Y,Z,40.0);//Error Line!
    	Attach3DTextLabelToPlayer(Text3D:playertextid[playerid], playerid, 0.0, 0.0, 0.0);
}



Re: Wanted Show above the Head - MoroDan - 24.07.2011

You can't attach a Player3DText. You can attach only a 3DText, but the player won't see it.


AW: Wanted Show above the Head - gunitstyler - 24.07.2011

But how can I do this?
I'm sure that it must work in any way.


Re: Wanted Show above the Head - MoroDan - 24.07.2011

Please, show me your function where you add Wanted stars to the player. I will add in that. And btw, the wanted stars won't be seen by only the cops, will be seen by everybody, without you .


AW: Wanted Show above the Head - gunitstyler - 24.07.2011

Код:
ocmd:su(playerid,params[])
{
new pID, grund[50];
new string[128], DerPlayer[MAX_PLAYER_NAME], DerAdmin[MAX_PLAYER_NAME];
if(sscanf(params,"us",pID,grund)){
	return SendClientMessage(playerid, COLOR_YELLOW,"Hinweis: /su [playerid] [Grund]");
}
if(!IsPlayerConnected(pID)){
	return SendClientMessage(playerid,COLOR_GREY,"Fehler: Der angegebene Spieler ist nicht online!");
}
if(SpielerInfo[playerid][pFraktion] != 1)
{
	return SendClientMessage(playerid, COLOR_GREY,"Fehler: Du bist kein Polizist!");
}
SpielerInfo[pID][pWanted] += 1;
SetPlayerWantedLevel(pID, SpielerInfo[pID][pWanted]);
GetPlayerName(pID,DerPlayer,sizeof(DerPlayer));
GetPlayerName(playerid,DerAdmin,sizeof(DerAdmin));
format(string,sizeof(string),"Du hast ein Verbrechen begangen. Tat: %s | Melder: %s", grund, DerAdmin);
SendClientMessage(pID,COLOR_BLUE,string);
new string2[128];
format(string2,sizeof(string2),"[Funk]: Straftat gemeldet: Vergehen: %s | Meldung von: %s | Vermutlicher Tдter %s]",grund,DerAdmin,DerPlayer);
PolizeiChat(COLOR_ORANGE, string2);
return 1;
}



AW: Wanted Show above the Head - gunitstyler - 26.07.2011

/push


Re: Wanted Show above the Head - jameskmonger - 26.07.2011

MoroDan, you could always loop through the players and check if they're a cop :P