Create3DTextLabel help - 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)
+--- Thread: Create3DTextLabel help (
/showthread.php?tid=436207)
Create3DTextLabel help -
[DX]Aru12345 - 10.05.2013
Hello.
I created a command /createlable which created a 3DTextLable at the players position. The command works but it only shows the first letter. For example I type /createlable Hi All, it would just show "h". Here is the code:
pawn Code:
CMD:createlable(playerid,params[])
{
new Float:x,Float:y,Float:z,texttoput,str[128];
if(sscanf(params,"s",texttoput)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /createlable <Lable Text>");
GetPlayerPos(playerid,x,y,z);
format(str,sizeof(str),"%s",texttoput);
Create3DTextLabel(str,COLOR_WHITE,x,y,z,40,0,0);
return 1;
}
Re: Create3DTextLabel help -
[DOG]irinel1996 - 10.05.2013
pawn Code:
CMD:createlabel(playerid, params[])
{
new
str[128],
Float:Pos[3]
;
if (sscanf(params, "s[128]", str))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createlabel <Label Text>");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
Create3DTextLabel(str, COLOR_WHITE, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
return 1;
}
Should work, regards.
Re: Create3DTextLabel help -
ryanhawk31 - 10.05.2013
For only admins to use it:
pawn Code:
CMD:createlabel(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 1338) //change "1338" to the selected admin level
{
new
str[128],
Float:Pos[3]
;
if (sscanf(params, "s[128]", str))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /createlabel <Label Text>");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
Create3DTextLabel(str, COLOR_WHITE, Pos[0], Pos[1], Pos[2], 40.0, 0, 0);
return 1;
}
else return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
Re: Create3DTextLabel help -
[DX]Aru12345 - 10.05.2013
It workds thanks