Click map teleport. - 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: Click map teleport. (
/showthread.php?tid=583999)
Click map teleport. -
GabiXx - 01.08.2015
I want to teleport if i'm admin with click on map.
I try this.
PHP код:
public OnGameModeInit()
{
AllowAdminTeleport(1);
return 1;
}
And this.
PHP код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
new Float:x, Float:y, Float:z;
if(!IsPlayerAdmin(playerid))
return 1;
if(IsPlayerAdmin(playerid))
SetPlayerPosFindZ(playerid, x, y, z);
return 1;
}
But when i click map, i don't get the position where i clicked, and i go under the map.
Re: Click map teleport. -
Inn0cent - 01.08.2015
SetPlayerPosFindZ change this to SetPlayerPos(playerid, fX, fY, fZ);
And remove,
new Float, Float:y, Float:z;, if(!IsPlayerAdmin(playerid)), return 1; Its not needed.
Respuesta: Click map teleport. -
RIDE2DAY - 01.08.2015
AllowAdminTeleport is deprecated so remove it, you should do this:
PHP код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPosFindZ(playerid, fX, fY, fZ);
}
return 1;
}
Quote:
Originally Posted by SA-MP Wiki
The Z value returned will be 0 (invalid) if it is far away from the player; use the MapAndreas plugin to get a more accurate Z coordinate.
|
Re: Click map teleport. -
GabiXx - 01.08.2015
Ty a lot.