Help on AllowAdminTeleport
#1

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

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).
Reply
#3

So you mean it doesnt work in all servers in SAMP?
Reply
#4

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

Oh okay, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)