SA-MP Forums Archive
TMP Question - 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: TMP Question (/showthread.php?tid=129686)



TMP Question - Torran - 23.02.2010

Is this all i need to get a players text?

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




Re: TMP Question - Jay_ - 23.02.2010

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


Re: TMP Question - Torran - 23.02.2010

How would i get the players text?


Re: TMP Question - bajskorv123 - 23.02.2010

Код:
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);


Re: TMP Question - Torran - 23.02.2010

Using a command..


Re: TMP Question - bajskorv123 - 23.02.2010

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);


Re: TMP Question - Torran - 23.02.2010

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


Re: TMP Question - Torran - 23.02.2010

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?


Re: TMP Question - bajskorv123 - 23.02.2010

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


Re: TMP Question - Torran - 23.02.2010

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