SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/12/2013, 07:01 PM   #1
MaxTheMapper
Banned
 
Join Date: Oct 2013
Location: Canada brahz!
Posts: 53
Reputation: 27
Default Help nobody can help me :s !

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
pawn Code:
pawn Code:
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;
}
Repping for the one who helps me ! here is spliffys fs http://forum.sa-mp.com/showthread.php?t=468638
MaxTheMapper is offline   Reply With Quote
Old 06/12/2013, 07:06 PM   #2
Patrick
Guest
 
Posts: n/a
Default Re: Help nobody can help me :s !

I didn't really get what you mean but I believe you want to change the 3DTextLabel string instead of number

Edit this line.
pawn Code:
format(string, sizeof(string), "%d", MaskID[playerid]);
  Reply With Quote
Old 06/12/2013, 07:10 PM   #3
Danialdano
Banned
 
Join Date: May 2011
Location: < >
Posts: 110
Reputation: 24
Default Re: Help nobody can help me :s !

Cant really see whats bothering you tho i mean the mask script is fine
Danialdano is offline   Reply With Quote
Old 06/12/2013, 07:10 PM   #4
MaxTheMapper
Banned
 
Join Date: Oct 2013
Location: Canada brahz!
Posts: 53
Reputation: 27
Default Re: Help nobody can help me :s !

I want to update the 3dtextlabel so it becomes the 'MaskID' above his head when he puts on the mask but i cannot update it because i dont know how. In spliffys script he has removed the usual sa-mp nametag above players head and put his own 3dtextlabel above their head like create3dtextlabel and then attach it to them. I want to update it so when he puts the mask on it changes to 'MaskID' and when he puts it off it changes back to spliffys attached 3dtextlabel (Their name)
MaxTheMapper is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 04:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.