Find a position
#1

Hello,

First, excuse me for my bad English.

I'm new in the field of scripting, and I know a question that seems silly, it's "how to get the coordinates x, y, z" of a place?

Thank you in advance,
Reply
#2

Go there and type /save then go to:

MyDocuments > GTA San Andreas User Files > SAMP > savedpostions.txt
Reply
#3

Better way to find out the coords.

Код:
if(strcmp(cmdtext, "/coords", true)==0)
{
    new Float:mx,Float:my,Float:mz;
    GetPlayerPos(playerid,mx,my,mz);
    new stringa[MAX_STRING];
    format(stringa,sizeof(stringa),"X:%f Y:%f Z:%f | Int: %d | VW: %d",mx,my,mz,GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
    SendClientMessage(playerid,COLOR_WHITE,stringa);
    return 1;
 }
ZCMD:

Код:
COMMAND:coords(playerid, params[])
{
	new Float:_ps[3];
	GetPlayerPos(playerid, _ps[0], _ps[1], _ps[2]);
	SendClientMSG(playerid, COLOR_LIGHTGREY, "[DEBUG]: %f,%f,%f | Int: %d | VW: %d",_ps[0], _ps[1], _ps[2], GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
	return 1;
}
Reply
#4

thanks
Reply
#5

In
Код:
AddPlayerClass(12,1062.3319,2079.3210,10.8203,191.4850,0,0,0,0,0,0); //
What is the positions ?

Thanks.
Reply
#6

Sorry for strcmp! you can change it according to your needs if you want ZCMD and sscanf2 used!
pawn Код:
if(strcmp(cmd, "/addpos", true) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            new Float:X,Float:Y,Float:Z,Float:A,File:pos;
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerFacingAngle(playerid,A);
            pos = fopen("footpos's.txt", io_append);
            format(string, 256, "ON Foot Pos == %f, %f, %f, %f\n", X, Y, Z, A);
            fwrite(pos, string);
            fclose(pos);
            format(string, sizeof(string), "Location Saved in the file by : %f, %f, %f", X,Y,Z);
            SendClientMessage(playerid, COLOR_GREEN, string);
            return 1;
         }
    }
1. Use this to get the position of the coordinates and they get saved in a file called "footpos.txt"
2. XYZ in AddPlayerClass is the default spawn point for that skin which you choose! You dont need any other function after that but yes! For teams we do make other functions like i have SpawnPlayer(playerid) i use it over OnPlayerSpawn() callback.
Reply
#7

Quote:
Originally Posted by SrazZz
Посмотреть сообщение
In
Код:
AddPlayerClass(12,1062.3319,2079.3210,10.8203,191.4850,0,0,0,0,0,0); //
What is the positions ?

Thanks.
AddPlayerClass(12,1062.3319,2079.3210,10.8203,191.4850,0,0,0,0,0,0); //

I bolded the XYZ positions. Those are the ones you'll need to pay attention to.
The 191.4850 afterwards is the angle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)