/coords - 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: /coords (
/showthread.php?tid=78467)
/coords -
Chrham_2 - 20.05.2009
Hello. I just started to code a server from scratch. But... I need a /coords code.
Anyone know how to make it?
Re: /coords -
MenaceX^ - 20.05.2009
/save?
Re: /coords -
Chrham_2 - 20.05.2009
Quote:
Originally Posted by MenaceX^
/save?
|
No.. i want if i type /coords it says:
Your coords is: ...............
Re: /coords -
Correlli - 20.05.2009
Quote:
Originally Posted by Chrham_2
Quote:
Originally Posted by MenaceX^
/save?
|
No.. i want if i type /coords it says:
Your coords is: ...............
|
Get players position with
GetPlayerPos and then format the message and send it with
SendClientMessage.
Re: /coords -
Chrham_2 - 20.05.2009
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Chrham_2
Quote:
Originally Posted by MenaceX^
/save?
|
No.. i want if i type /coords it says:
Your coords is: ...............
|
Get players position with GetPlayerPos and then format the message and send it with SendClientMessage.
|
I just dont know how to format it.. Couldn't you just give me the code. I will learn of that to.
Re: /coords -
Weirdosport - 20.05.2009
I can't see why you want the co-ords when you can get them using save, but try this:
Place this inside a command..
pawn Код:
new string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z);
SendClientMessage(playerid, 0xFF00FFFF, string);
Re: /coords -
MenaceX^ - 20.05.2009
Quote:
Originally Posted by Weirdosport
I can't see why you want the co-ords when you can get them using save, but try this:
Place this inside a command..
pawn Код:
new string[128], Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); format(string, sizeof(string), "Co-ordinates: %f, %f, %f", X, Y, Z); SendClientMessage(playerid, 0xFF00FFFF, string);
|
It's a wasted array.
Re: /coords -
Weirdosport - 20.05.2009
I used 128 as this is the maximum output, if you can get players to use 128 they won't get problems and they wont be using 256...
If I was to use 40 in a few days time there'd be someone here with an error saying that their size 40 array is too small.
Besides, I don't know how many sf/dp Sa-mp gives floats too..
Re: /coords -
MenaceX^ - 20.05.2009
I personaly make a few variables in main of script, and not in a public/stock or anything else. Just one with a big array.
Re: /coords -
Weirdosport - 20.05.2009
Quote:
Originally Posted by MenaceX^
I personaly make a few variables in main of script, and not in a public/stock or anything else. Just one with a big array.
|
TO do that I'd have had to give alot more of the layout away in this script, the coder has to learn something for themselves :P