OnPlayerClickMap - 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)
+--- Thread: OnPlayerClickMap (
/showthread.php?tid=360382)
OnPlayerClickMap -
kbalor - 17.07.2012
It always teleports me back to red marker after clicking right click. How to disable it?
Here's the script:
Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPosFindZ(playerid, fX, fY, fZ);
}
else if(IsPlayerInAnyVehicle(playerid))
{
new Babatz = GetPlayerVehicleID(playerid);
new Batz = GetPlayerVehicleSeat(playerid);
SetVehiclePos(Babatz,fX,fY,fZ);
PutPlayerInVehicle(playerid,Babatz,Batz);
}
return 1;
}
Re: OnPlayerClickMap -
kbalor - 17.07.2012
If this is possible pm or make a reply thanks!
Re: OnPlayerClickMap -
MP2 - 17.07.2012
If you don't want it to teleport you when you place a marker, delete all that code you posted.
Re: OnPlayerClickMap -
kbalor - 17.07.2012
Quote:
Originally Posted by MP2
If you don't want it to teleport you when you place a marker, delete all that code you posted.
|
"All caps" I did not say i don't want to teleport when placing marker.
It says It Teleports me BACK to red marker. Oh my God!
Re: OnPlayerClickMap -
MP2 - 17.07.2012
Not going to help you with that attitude.
Re: OnPlayerClickMap -
kbalor - 17.07.2012
Quote:
Originally Posted by MP2
Not going to help you with that attitude.
|
You're being rude. It's like give and take. Hopefully you're doing good. Thanks!
Re: OnPlayerClickMap -
Andi_Evandy - 17.07.2012
pawn Код:
new Float:ClickedMap[MAX_PLAYERS][3];
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(ClickedMap[playerid][0] != fX && ClickedMap[playerid][1] != fY && ClickedMap[playerid][2] != fZ)
{
ClickedMap[playerid][0] = fX;
ClickedMap[playerid][1] = fY;
ClickedMap[playerid][2] = fZ;
if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ);
else if(IsPlayerInAnyVehicle(playerid))
{
new Babatz = GetPlayerVehicleID(playerid);
new Batz = GetPlayerVehicleSeat(playerid);
SetVehiclePos(Babatz,fX,fY,fZ);
PutPlayerInVehicle(playerid,Babatz,Batz);
}
}
return 1;
}
Untested btw XD
Re: OnPlayerClickMap -
kbalor - 17.07.2012
Quote:
Originally Posted by Andi_Evandy
pawn Код:
new Float:ClickedMap[MAX_PLAYERS][3];
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { if(ClickedMap[playerid][0] != fX && ClickedMap[playerid][1] != fY && ClickedMap[playerid][2] != fZ) { ClickedMap[playerid][0] = fX; ClickedMap[playerid][1] = fY; ClickedMap[playerid][2] = fZ; if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ); else if(IsPlayerInAnyVehicle(playerid)) { new Babatz = GetPlayerVehicleID(playerid); new Batz = GetPlayerVehicleSeat(playerid); SetVehiclePos(Babatz,fX,fY,fZ); PutPlayerInVehicle(playerid,Babatz,Batz); } } return 1; }
Untested btw XD
|
Thanks for the reply. But it still teleports me back to red marker after clicking right click.
Re: OnPlayerClickMap -
GSRP - 17.07.2012
Why don't you make it where if ClickedMap[playerid][#] = 0.0, then it does nothing. If you don't know how to do such, then I will do it for you.
Re: OnPlayerClickMap -
kbalor - 17.07.2012
Quote:
Originally Posted by GSRP
Why don't you make it where if ClickedMap[playerid][#] = 0.0, then it does nothing. If you don't know how to do such, then I will do it for you.
|
Yes please?