Textdraw
#1

Im trying to use a textdraw to do this

new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
hud[playerid] = CreatePlayerTextDraw(playerid, 5, 241.0, "Name:%s", pname);

and no its not set up like this in the real script im just showing you these lines.
But when i compile i get 1 warning
warning 202: number of arguments does not match definition
and i know it is because ,pname at the end but i have to do that to be able to add the players name into the textdraw.Can you do this or not?
Reply
#2

we can NOT create a textdraw like this.

Quote:
Originally Posted by nickstar
Посмотреть сообщение
Im trying to use a textdraw to do this

hud[playerid] = CreatePlayerTextDraw(playerid, 5, 241.0, "Name:%s", pname);
You should add a format first..
pawn Код:
new string[64];
format(string,sizeof(string)," Name:%s",pname);
hud[playerid] = CreatePlayerTextDraw(playerid, 5, 241.0, string);
Please read this links
https://sampwiki.blast.hk/wiki/Format
https://sampwiki.blast.hk/wiki/TextDrawSetString
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)