PDA

View Full Version : Using sps.getPlayerPos() to look if you are standing at the right point?



sipfer3
09-07-2014, 09:21 AM
Helly guys its me again :P,

so I was wondering if there is any way to use SPS.getPlayerPos() to look if you are standing at a point?
I was trying to make a failSafe, for a function which opens a door, so i want to use getPlayerPos to see, if my charakter is standing behind the door now.
Anyone can tell me if it is possibile with getPlayerPos or if there is another way out there? :P


thanks

sipfer

Spaceblow
09-07-2014, 12:11 PM
I'm not quite sure if this could help you but this is something from my script:
function doorPos(): boolean;
begin
result := (((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 138)));
end;
And then I use it in another procedure like this:
if not doorPos() then
doorRetry();
I hope this is what you're talking about and it somehow helped you. :)

sipfer3
09-07-2014, 12:59 PM
I'm not quite sure if this could help you but this is something from my script:
function doorPos(): boolean;
begin
result := (((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 202) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 134)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 130)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 122)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 206) and (SPS.getPlayerPos.y = 126)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 138)) or ((SPS.getPlayerPos.x = 214) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 142)) or ((SPS.getPlayerPos.x = 210) and (SPS.getPlayerPos.y = 138)));
end;
And then I use it in another procedure like this:
if not doorPos() then
doorRetry();
I hope this is what you're talking about and it somehow helped you. :)

wow. im so stupid, didnt thought of just checking x and y at its own.. tried to compare SPS.getPlayerPos with a point.. thank you so much :)

EDIT: im confused right now. For any reason SPS.getPlayerPos now gives (-1, -1) as coordinates as soon as i try to use it when i climed up a ladder.
tried to remake the map many times and still not working. i think it cant detect the map probably but i made them the same way i made the map outside the hoose.
I tried doing both in 1 map and i tried seperate them. :(

cosmasjdz
09-07-2014, 04:42 PM
one thing i dont like that sps.getplayerpos clicks to rotate minimap to north itself, so this may be the only repetetive thing in the script to make u banned. Personally i would avoid it

sipfer3
09-07-2014, 06:02 PM
yea probably not the best idea, but the only i got atm.
anyway still need to know why i cant get any coords from a map like this=23979. it worked the day before yesterday, stopped working yesterday and i cant fix it. even new map wont work :( also in other houses, maps wont work for me. allways gives me (-1, -1) as coord. =(

EDIT: so looks like just doesnt work in directx

NKN
09-07-2014, 07:39 PM
one thing i dont like that sps.getplayerpos clicks to rotate minimap to north itself, so this may be the only repetetive thing in the script to make u banned. Personally i would avoid it


yea probably not the best idea, but the only i got atm.
anyway still need to know why i cant get any coords from a map like this=23979. it worked the day before yesterday, stopped working yesterday and i cant fix it. even new map wont work :( also in other houses, maps wont work for me. allways gives me (-1, -1) as coord. =(

EDIT: so looks like just doesnt work in directx



You can set SPS Any Angle to true so it won't rotate the map.

sipfer3
09-07-2014, 09:38 PM
You can set SPS Any Angle to true so it won't rotate the map.


thank u for the tipp :)