SA-MP Forums Archive
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=106853)



coords - Lajko1 - 06.11.2009

guys how i can get coords of all 6 jails cells in LV PD anyone can help please ?


Re: coords - Finn - 06.11.2009

When you're in-game, type /save [comment] and then check your savedpositions.txt file from your GTA folder. The coords are there.


Re: coords - Zeromanster - 06.11.2009

Quote:
Originally Posted by Finn
When you're in-game, type /save [comment] and then check your savedpositions.txt file from your GTA folder. The coords are there.
I think he's asking this because he can't go inside the cells to type in /save.

Well, if that's the case, make yourself a custom command for increasing players x/y so you can go throw the bars.

I think you can find similar commands in the godfather gamemode but im not sure.


Re: coords - Donny_k - 06.11.2009

pawn Код:
#include <zcmd>

cmd(forward, playerid, params[] )
{
  if ( isnull( params ) ) return SendClientMessage( playerid, 0xafafafff, "Usage: /forward [units]" );

  new
    Float:x,
    Float:y,
    Float:z,
    Float:angle;

  GetPlayerPos( playerid, x, y, z );
  GetPlayerFacingAngle( playerid, angle );
  x = x + strval( params ) * floatsin( -angle, anglemode:degrees );
  y = y + strval( params ) * floatcos( -angle, anglemode:degrees );
  SetPlayerPosFindZ( playerid, x, y, z );
  return 1;
}
You type like:

/forward 3

You will then go forward (not compass north,) 3 units so stand outside your cell facing inside and type '/forward 3' and you will now be inside it.

You could compile that as a filterscript I think, can't remember if zcmd has the 'a_samp' header already but the command currently has no numeric or any other protection so add that yourself (numeric, admin etc) and it's untested but it's a damn good start.


Re: coords - Daren_Jacobson - 06.11.2009

did you test that? cause my logic is screaming no at me.
this is what i would do to your code
pawn Код:
#include <zcmd>

cmd(forward, playerid, params[])
{
  if (isnull(params)) return SendClientMessage(playerid, 0xafafafff, "Usage: /forward [units]"); //okay, i am going to let this slide

  new
    Float:x,
    Float:y,
    Float:z,
    Float:angle;

  GetPlayerPos(playerid, x, y, z);
  GetPlayerFacingAngle(playerid, angle);
  x = x + strval(params) * floatsin( -angle, degrees ); //you don't pass floats by doing Float:angle, so no need to put it before the degrees
  y = y + strval(params) * floatcos(-angle, degrees); //y is sin x is cos, cause if angle is 90.0 then the cos of that is 0.0 wich means if angle is south, x does not need to changed
  SetPlayerPosFindZ(playerid, x, y, z); //kudo's for using findz to make sure they don't fall through the ground.
  return 1;
}



Re: coords - Lajko1 - 06.11.2009

uf i dont udnerstand what you mean with that code, ... anyoen can get those 6 coords from jail cells in LV PD for me please ?


Re: coords - Daren_Jacobson - 06.11.2009

put the code into your script, walk up to the jail cell, type /forward 2 can't make it much simpler.


Re: coords - Lajko1 - 06.11.2009

i need to get zcmd include , when i try to compile it say 1 eror cant read for zcmd... etc etc so where i can get include


Re: coords - member - 06.11.2009

Quote:
Originally Posted by Lajko1
i need to get zcmd include , when i try to compile it say 1 eror cant read for zcmd... etc etc so where i can get include
The zcmd command processor inlcude is available from: http://forum.sa-mp.com/index.php?topic=116240.0




Re: coords - Donny_k - 06.11.2009

Quote:
Originally Posted by Daren_Jacobson
did you test that? cause my logic is screaming no at me.
this is what i would do to your code
I wrote in my post that it's untested but it will work just fine dude and the 'anglemode' is my habit with just that one function (I'm not passing a Float btw, it's a type (1)).

Test the code if you like and report the result, I won't because I'm confident it will work just fine (not cocky just confident).