SA-MP Forums Archive
Problems with TextDrawSetString - Need 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problems with TextDrawSetString - Need Help (/showthread.php?tid=166635)



Problems with TextDrawSetString - Need Help - CTCCoco - 09.08.2010

Hello, I only want to change the text of a TextDraw every 5 seconds, I don't know why if I use this on the SetTimer:

Код:
nombre1 = dini_Get("Ranking1", "Nombre");
format(string,sizeof(string),"Primero: %s",strlen(nombre1));
TextDrawSetString(Textdraw0, string);
If I put this on the Timer , all command are bugged and say Unknow command. If I delete that, all commands works.

I don't have warnings and nothing :S


Thanks for all.


Re: Problems with TextDrawSetString - Need Help - MadeMan - 09.08.2010

%s to %d

pawn Код:
format(string,sizeof(string),"Primero: %d",strlen(nombre1));



Re: Problems with TextDrawSetString - Need Help - CTCCoco - 09.08.2010

Thanks for the help but nombre1 it's a name.

What I can do?

Thanks.


Re: Problems with TextDrawSetString - Need Help - MadeMan - 09.08.2010

pawn Код:
format(string,sizeof(string),"Primero: %s",nombre1);



Respuesta: Problems with TextDrawSetString - Need Help - Cesar_Biker - 09.08.2010

strlen() = the length of string = integer


Re: Problems with TextDrawSetString - Need Help - CTCCoco - 09.08.2010

Thanks, and what I can do to convert it to a string? Because if I use nombre1 alone says that array must be indexed.

Please help me and thanks.

EDIT: Erh... Thanks, problem fixed...


Re: Problems with TextDrawSetString - Need Help - Claude - 09.08.2010

Wrong usage
pawn Код:
GetPlayerName(targetid, name, sizeof(name));
format(string,sizeof(string),"Primero: %s",name);