• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] GetPlayerPos and show in chat?
#2
You can't pass arguments to most of the native functions (naturally including SendClientMessage)

You need to use format before, like this:

Code:
if (strcmp("/getpos", cmdtext, true, 7) == 0)
{
// Do something here
// 64 is the size of the string
new buffer[64], Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
format(buffer, sizeof(buffer), "Position: %f, %f, %f.", x, y, z);
SendClientMessage(playerid, -1, buffer);

return 1;
}
return 0;
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply


Messages In This Thread
GetPlayerPos and show in chat? - by LagunaPreza - 2020-12-19, 05:48 PM
RE: GetPlayerPos and show in chat? - by Pinch - 2020-12-19, 06:16 PM
RE: GetPlayerPos and show in chat? - by Markski - 2020-12-19, 06:23 PM
RE: GetPlayerPos and show in chat? - by Pinch - 2020-12-19, 06:59 PM
RE: GetPlayerPos and show in chat? - by Markski - 2020-12-19, 07:27 PM

Forum Jump: