SA-MP Forums Archive
textdraw 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: textdraw help (/showthread.php?tid=124139)



textdraw help - Sampiscool123 - 29.01.2010

how do i make it so when i type a command, say i type /help a textdraw would come up and say "hi" just under the sa-mp chat. how do i make it when i type another command like rules it would replace the "hi" with "hello"

Thanks


Re: textdraw help - will_92 - 29.01.2010

First... you'lll need the coords for the textdraw to go under the sa-mp chat, and then for the textdraw replacing the "hi" you'll need a timer for that.
go on :

https://sampwiki.blast.hk/wiki/TextDrawCreate

and :

https://sampwiki.blast.hk/wiki/SetTimer

It would really help you.. because im guessing you're a beginner.


Re: textdraw help - Sampiscool123 - 29.01.2010

I have the coords i have the textdraw made but what do i add to make it replace "hi" with "hello"?


Re: textdraw help - mansonh - 29.01.2010

https://sampwiki.blast.hk/wiki/TextDrawSetString


Re: textdraw help - Sampiscool123 - 29.01.2010

Then say i type /help and it comes up with a textdraw that says "Hi Sampiscool123, how are you?" how would i make it say "I am fine thank you" when i type /rules?


Re: textdraw help - mansonh - 29.01.2010

https://sampwiki.blast.hk/wiki/TextDrawSetString
The example has it

TextDrawSetString(himessage, "I am fine thank you");
TextDrawShowForPlayer(playerid, himessage);



Re: textdraw help - Sampiscool123 - 29.01.2010

error 017: undefined symbol "himessage"
warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
error 017: undefined symbol "himessage"
error 017: undefined symbol "himessage"


Re: textdraw help - mansonh - 29.01.2010

Again, READ:
https://sampwiki.blast.hk/wiki/TextDrawSetString


Re: textdraw help - Sampiscool123 - 29.01.2010

i did that but it gave me them errors. could ypu send me the code please i am retarded


Re: textdraw help - mansonh - 29.01.2010

Didn't read it carefully enough, or you would have used the definition.

new Text:himessage;

public OnGameModeInit()
{
himessage = TextDrawCreate(1.0, 5.6, "Hi, how are you?");
return 1;
}

public OnPlayerConnect(playerid)
{
new newtext[41];
format(newtext, sizeof(newtext), "Hi %s, how are you?", GetPlayerName(playerid));
TextDrawSetString(himessage, newtext);
TextDrawShowForPlayer(playerid, himessage);
return 1;
}