SA-MP Forums Archive
Saving player coords then using elsewhere - 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: Saving player coords then using elsewhere (/showthread.php?tid=193807)



Saving player coords then using elsewhere - WillyP - 27.11.2010

Hey, is there dini/variables thay would store a players pos?

And say if a player enters a car then drives around then as soon as the player exits the vehicle he goes back to his 'saved position'?

Thx


Re: Saving player coords then using elsewhere - Buzzbomb - 27.11.2010

Yes.

And for the exit vehicle that would be crazy hehe

But i like your ideal..


Re: Saving player coords then using elsewhere - WillyP - 27.11.2010

I hope someone can give me an idea..


Re: Saving player coords then using elsewhere - BMUK - 27.11.2010

Top of script
pawn Код:
new Float:Ex[MAX_PLAYERS];
new Float:Why[MAX_PLAYERS];
new Float:Zed[MAX_PLAYERS];
OnPlayerEnterVehicle Callback

pawn Код:
new Float:x, Float:y, Float:z;

GetPlayerPos(playerid,x,y,z);

Ex[playerid] = x;
Why[playerid] = y;
Zed[playerid] = z;
OnPlayerExitVehicle Callback

pawn Код:
SetPlayerPos(playerid,Ex[playerid],Why[playerid],Zed[playerid];
Untested but if it doesnt work I'll make a /cry command


Re: Saving player coords then using elsewhere - WillyP - 27.11.2010

Sweet, thanks for this.


Re: Saving player coords then using elsewhere - Jochemd - 27.11.2010

Errr, why did you have the 'x' 'y' 'z'?

pawn Код:
GetPlayerPos(playerid,Er[playerid],Why[playerid],Zed[playerid]);



Re: Saving player coords then using elsewhere - Cypog - 27.11.2010

OnPlayerEnterVehicle doesn't mean, that the player has already entered the vehicle, he just tried to do it.

Use OnPlayerChangeState instead.

Edit: Yeah, why do you use x, y, z?


Re: Saving player coords then using elsewhere - BMUK - 27.11.2010

lol good point about the x,y,z