/coords
#1

Hello. I just started to code a server from scratch. But... I need a /coords code.
Anyone know how to make it?
Reply
#2

/save?
Reply
#3

Quote:
Originally Posted by MenaceX^
/save?
No.. i want if i type /coords it says:

Your coords is: ...............
Reply
#4

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.
Reply
#5

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.
Reply
#6

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

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.
Reply
#8

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..
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)