SA-MP Forums Archive
Help on AllowAdminTeleport - 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: Help on AllowAdminTeleport (/showthread.php?tid=518220)



Help on AllowAdminTeleport - cleanboy - 08.06.2014

if i put this at the end of my OnGameModeInIt

Код:
AllowAdminTeleport(1);
    return 1;
it gives me warning of this:

Код:
G:\SFCNR\gamemodes\SFCRRPG.pwn(2064) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
line 2064
Код:
	AllowAdminTeleport(1);
i got it from here: https://sampwiki.blast.hk/wiki/AllowAdminTeleport


Re: Help on AllowAdminTeleport - Konstantinos - 08.06.2014

Did you see the box from the wiki's link?

-> This function is deprecated. Please see OnPlayerClickMap.

pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    if (IsPlayerAdmin(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ);
    return 1;
}
or you can use MapAndreas to get accurate height (Z).


Re: Help on AllowAdminTeleport - cleanboy - 08.06.2014

So you mean it doesnt work in all servers in SAMP?


Re: Help on AllowAdminTeleport - Koala818 - 08.06.2014

Nope, the function "AllowAdminTeleport()" should not be used at all since, as the wiki says, it is deprecated. Instead, use what wiki and Konstantinos said:
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
    if (IsPlayerAdmin(playerid)) SetPlayerPosFindZ(playerid, fX, fY, fZ);
    return 1;
}
Like this, when a player that is logged as rcon admin put's a blip on MAP (Big map from esc), he will teleport there though he might fall under ground since it's hard to get the right z.


Re: Help on AllowAdminTeleport - cleanboy - 08.06.2014

Oh okay, thank you.