[Pawn] GetPlayerPos and show in chat? - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] GetPlayerPos and show in chat? (/showthread.php?tid=1433) |
GetPlayerPos and show in chat? - LagunaPreza - 2020-12-19 Hey all, I'm new to the whole pawn scripting and I try to make a command that gives me my position. But, when I use the command it doesn't send anything in the chat. Code: if (strcmp("/getpos", cmdtext, true, 7) == 0) I've also tried to remove the %f, %f, %f part but then it only sends me "Position:" without the actual player position. Also when I compile/run my script, it gives me 3 warnings(warning 202: number of arguments does not match definition) Any help would be appreciated. RE: GetPlayerPos and show in chat? - Pinch - 2020-12-19 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) RE: GetPlayerPos and show in chat? - Markski - 2020-12-19 There is also an extended version of SendClientMessage which does receive parameters. Code: stock SendClientMessageEx(playerid, color, const str[], {Float,_}:...) RE: GetPlayerPos and show in chat? - Pinch - 2020-12-19 (2020-12-19, 06:23 PM)Markski Wrote: There is also an extended version of SendClientMessage which does receive parameters. That's a terrible one at that, they should use va_SendClientMessage RE: GetPlayerPos and show in chat? - Markski - 2020-12-19 (2020-12-19, 06:59 PM)Pinch Wrote: That's a terrible one at that, they should use va_SendClientMessage Why is that? |