Attach label to player
#1

pawn Код:
CMD:vlabel(playerid,params[])
{
    new str[148];
    if(!IsPlayerVipMember(playerid)) return SendClientMessage(playerid, red, "You are not VIP. Donate at sngfun.tk");
    if(sscanf(params, "s[32]",str)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /vlabel (words)");
    format(str,sizeof(str),"%s",str);
    SendClientMessage(playerid,COL_ADMIN,str);
    vip = Create3DTextLabel(str,0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(vip, playerid, 0.0, 0.0, 0.7);

    return 1;
}
Whats wrong with this it wont show the label
Reply
#2

Makes no sense whatsoever. Format an already empty string with the same empty string?
Reply
#3

idk it was a fail attempt to make a label that the player can attach to himself. can you help with it lol
Reply
#4

That is most likely caused by what Vince said, you need to make a new string and format it, then you can use that string in the label.
If it doesn't show make sure you haven't overpassed the 3d labels limit(1024).
Reply
#5

What's wrong with this code actually, if I may ask?

pawn Код:
CMD:vlabel(playerid,params[])
{
    new str[128];
    if(!IsPlayerVipMember(playerid)) return SendClientMessage(playerid, red, "You are not VIP. Donate at sngfun.tk");
    if(sscanf(params, "s",str)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /vlabel (words)");
    SendClientMessage(playerid,COL_ADMIN,str);
    vip = Create3DTextLabel(str,0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
    Attach3DTextLabelToPlayer(vip, playerid, 0.0, 0.0, 0.7);
    return 1;
}
Reply
#6

Quote:
Originally Posted by admantis
Посмотреть сообщение
That is most likely caused by what Vince said, you need to make a new string and format it, then you can use that string in the label.
If it doesn't show make sure you haven't overpassed the 3d labels limit(1024).
I havent passed the limit. And can you help me with formating it :/ im confused
Reply
#7

Any help
Reply
#8

pawn Код:
CMD:vlabel(playerid,params[])
{
    new str[128];
    if(!IsPlayerVipMember(playerid)) return SendClientMessage(playerid, red, "You are not VIP. Donate at sngfun.tk");
    if(sscanf(params, "s",str)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /vlabel (words)");
    SendClientMessage(playerid,COL_ADMIN,str);
    new PlayerText3D:vip = CreatePlayer3DTextLabel(playerid,str,0x008080FF, 30.0, 40.0, 50.0, 40.0, playerid, INVALID_VEHICLE_ID, 0);
    return 1;
}
Reply
#9

It wont attach it to them with that code?

And what is this
pawn Код:
, playerid, INVALID_VEHICLE_ID, 0);
Reply
#10

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
It wont attach it to them with that code?

And what is this
pawn Код:
, playerid, INVALID_VEHICLE_ID, 0);
its CreatePlayer3DTextLabel not Create3DTextLabel so it has extra params that are
attachplayer, attachtovehiche, TestLOS

attachplayer - the player it should attach to (what you want)
attachto veh - the veh it needs to attach to
TestLOS - Line of sight
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)