textdraw help
#1

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
Reply
#2

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.
Reply
#3

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

https://sampwiki.blast.hk/wiki/TextDrawSetString
Reply
#5

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?
Reply
#6

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

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

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"
Reply
#8

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

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)