Saving player coords then using elsewhere
#1

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
Reply
#2

Yes.

And for the exit vehicle that would be crazy hehe

But i like your ideal..
Reply
#3

I hope someone can give me an idea..
Reply
#4

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

Sweet, thanks for this.
Reply
#6

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

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

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

lol good point about the x,y,z
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)