SA-MP Forums Archive
problema con 3d label - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: problema con 3d label (/showthread.php?tid=629436)



problema con 3d label - Godin - 26.02.2017

Hola,

Tengo un problema con mi 3d label de admin y vip

Cada vez que un jugador normal se une osea que no es admin ni vip, un 3d label aparece sobre su cabeza de piel y no es admin o vip.


// este jugador no es vip ni admin

acб el code

Код:
new STREAMER_TAG_3D_TEXT_LABEL label1[MAX_PLAYERS];
new STREAMER_TAG_3D_TEXT_LABEL label2[MAX_PLAYERS];


public OnPlayerDisconnect(playerid, reason)

if(PlayerInfo[playerid][Level] > 0) DestroyDynamic3DTextLabel(label1[playerid]);
	if(PlayerInfo[playerid][pVip] > 0) DestroyDynamic3DTextLabel(label2[playerid]);





public OnPlayerSpawn(playerid)

switch(PlayerInfo[playerid][Level])
{
	case 1:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Tester){576AFF}", lightblue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
	case 2:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Co-Moderator){576AFF}", blue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
	case 3:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Moderator){576AFF}", blue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
	case 4:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Admin){576AFF}", blue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
	case 5:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Leader){576AFF}", blue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
	case 6:
	{
	    label1[playerid] = CreateDynamic3DTextLabel("{576AFF}(Manager/CEO){576AFF}", blue, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
	}
}
switch(PlayerInfo[playerid][pVip])
{
case 1:
{
 label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Bronze 1 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
case 2:
{
label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Bronze 2 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
case 3:
{
label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Silver 3 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
case 4:
{
label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Silver 4 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
case 5:
{
label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Gold 5 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
case 6:
{
label2[playerid] = CreateDynamic3DTextLabel("{FFFF00}(Premium 6 VIP){FFFF00}", yellow, 0.0, 0.0, 0.4, 50.0, playerid, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100.0);
}
}


Gracias


Respuesta: problema con 3d label - RioYX - 26.02.2017

Quote:

if(PlayerInfo[playerid][Level] > 0) DestroyDynamic3DTextLabel(label1[playerid]);
if(PlayerInfo[playerid][pVip] > 0) DestroyDynamic3DTextLabel(label2[playerid]);

Quita eso y pon la variables del admin.


Re: Respuesta: problema con 3d label - Godin - 26.02.2017

Quote:
Originally Posted by RioYX
Посмотреть сообщение
Quita eso y pon la variables del admin.
Cуmo seria eso?

pd: soy aprendiz en scripting


Re: problema con 3d label - Unrea1 - 26.02.2017

Cambia йsto:

PHP код:
if(PlayerInfo[playerid][Level] > 0DestroyDynamic3DTextLabel(label1[playerid]);
if(
PlayerInfo[playerid][pVip] > 0DestroyDynamic3DTextLabel(label2[playerid]); 
Por йsto:

PHP код:
if(IsValidDynamic3DTextLabel(label1[playerid])) DestroyDynamic3DTextLabel(label1[playerid]);
if(
IsValidDynamic3DTextLabel(label2[playerid])) DestroyDynamic3DTextLabel(label2[playerid]); 
El otro problema lуgico es que posiblemente no estйs reiniciando PlayerInfo[playerid][Level] y PlayerInfo[playerid][pVip], entonces al spawnear crea los labels.

Lo otro es que cada vez que spawnee el jugador crearб los label's de forma infinita, para evitar йsto aсade la condiciуn que verifique si tiene creado o no el label:

PHP код:
if(!IsValidDynamic3DTextLabel(label1[playerid]))
if(!
IsValidDynamic3DTextLabel(label2[playerid])) 



Re: problema con 3d label - Godin - 26.02.2017

Ok gracias man, probarй eso.


Re: problema con 3d label - Godin - 26.02.2017

Se ve que funciona, muchas gracias!
Cualquier cosa les informo.


Re: problema con 3d label - Godin - 27.02.2017

Sigue lo mismo... aсadн lo que dijiste, Fynn, pero nada


Re: problema con 3d label - HeisenGiromB - 27.02.2017

PHP код:
Update3DTextLabelText(Nombre_del_label0xFFFFFFFF"New text.");