TMP Question
#1

Is this all i need to get a players text?

pawn Код:
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))

Reply
#2

No, that will change the tmp string into what is after the cmdtext represented by the idx variable.
Reply
#3

How would i get the players text?
Reply
#4

Код:
public OnPlayerText(playerid, text[])
{
  new string[128];
  format(string, sizeof(string), "%s", text);
  SendClientMessageToAll(color, string);
  return 0;//Disables chat and sends above in stead
}
format(string, sizeof(string), "%s", text);
Reply
#5

Using a command..
Reply
#6

pawn Код:
//onplayercommandtext
new string[128];
format(string, sizeof(string), "You typed: %s", cmdtext);
SendClientMessage(playerid, color, string);
format(string, sizeof(string), "You typed: %s", cmdtext);
Reply
#7

Quote:
Originally Posted by [NWA
Hannes ]
pawn Код:
//onplayercommandtext
new string[128];
format(string, sizeof(string), "You typed: %s", cmdtext);
SendClientMessage(playerid, color, string);
format(string, sizeof(string), "You typed: %s", cmdtext);
Damnit i keep forgetting to say this,
I need it for ZCMD
Reply
#8

Nvm i fixed that,
But if i type /test ( the command on my server wich activates it )

It says: You typed: on chat

If i type /test test

it says: You typed: test

How do i get it to do nothng if i dont put anything?
Reply
#9

Код:
if(strlen(string)==0) return 0;
?
Reply
#10

It returns UNKNOWN COMMAND, If i add that,
Where abouts do i add it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)