05.12.2013, 19:40
How can i hook up spliffys 3dlabel nametag filterscript with my command here, i used his filterscript but i have a mask command how can i update the 3dtextlabel so it becomes another text when i take my mask on and then when i take it off it shall go back to the usual name label.
My mask script
Repping for the one who helps me ! here is spliffys fs https://sampforum.blast.hk/showthread.php?tid=468638
My mask script
pawn Код:
CMD:mask(playerid, params[])
{
new string[150], rand = 2 + random(20);
MaskID[playerid] = rand;
if(strcmp(params, "on", false) == 0) {
if(PlayerInfo[playerid][pMaskO] == 0) return SendClientMessage(playerid,red, "error: no mask !");
if(PlayerInfo[playerid][pMask] == 1) return SendClientMessage(playerid,red, "ur mask is on !");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
GameTextForPlayer(playerid,"~g~MASK ON",1000,1);
format(string, sizeof(string), "%d", MaskID[playerid]);
NameText[playerid] = CreateDynamic3DTextLabel(string, 0x77777777, 0, 0, -20, 25, playerid);
Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, NameText[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.25);
PlayerInfo[playerid][pMask] = 1;
}
else if(strcmp(params, "off", false) == 0) {
if(PlayerInfo[playerid][pMaskO] == 0) return SendClientMessage(playerid,red, "error: no mask !");
else if(PlayerInfo[playerid][pMask] == 1) return SendClientMessage(playerid,red, "ur mask is off !");
DestroyDynamic3DTextLabel(NameText[playerid]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
GameTextForPlayer(playerid,"~r~MASK OFF",1000,1);
MaskID[playerid] = 0;
PlayerInfo[playerid][pMask] = 0;
}
else return SendClientMessage(playerid, COLOR_GREY, "USAGE: /mask (off, on)");
return 1;
}