How to ignore this msg if the player is admin
#1

Can any help me with this everytime a admins uses /gotols or /gotosf it sends this message because he moved a very fast distance.
like
Код:
if (PlayerInfo[playerid][pAdmin] >= 1)
pawn Код:
public AntiTeleport()
{
    new plname[MAX_PLAYER_NAME];
    new string[256];
    new Float:maxspeed = 215.0;
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1 && (GetPlayerState(i) == 2))
        {
            GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
            if(TelePos[i][5] > 550.0)
            {
                TelePos[i][0] = 0.0;
                TelePos[i][1] = 0.0;
            }
            //printf("player %d\n x = %f\n y = %f\n z = %f\n x2 = %f\n y2 = %f\n z2 = %f\n",i, PlayerPos[i][0],PlayerPos[i][1],PlayerPos[i][2],PlayerPos[i][3],PlayerPos[i][4],PlayerPos[i][5]);
            if(TelePos[i][0] != 0.0)
            {
                new Float:xdist = TelePos[i][3]-TelePos[i][0];
                new Float:ydist = TelePos[i][4]-TelePos[i][1];
                new Float:sqxdist = xdist*xdist;
                new Float:sqydist = ydist*ydist;
                new Float:distance = (sqxdist+sqydist)/31;
                if(distance > maxspeed)
                {
                    new tmpcar = GetPlayerVehicleID(i);
                    if(!IsAPlane(tmpcar))
                    {
                        GetPlayerName(i, plname, sizeof(plname));
                        format(string, 256, "[%d]%s %.0f mph ",i,plname,distance);
                        AdministratorMessage(COLOR_RED,string,1);
                    }
                }
            }
            if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
            {
                TelePos[i][0] = TelePos[i][3];
                TelePos[i][1] = TelePos[i][4];
            }
        }
    }
}
Thank you Worked.
Reply
#2

use

Код:
public AntiTeleport()
{
	new plname[MAX_PLAYER_NAME];
	new string[256];
	new Float:maxspeed = 215.0;
	for(new i = 0; i <= MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i) == 1 && (GetPlayerState(i) == 2))
		{
			GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
			if(TelePos[i][5] > 550.0)
			{
				TelePos[i][0] = 0.0;
				TelePos[i][1] = 0.0;
			}
			//printf("player %d\n x = %f\n y = %f\n z = %f\n x2 = %f\n y2 = %f\n z2 = %f\n",i, PlayerPos[i][0],PlayerPos[i][1],PlayerPos[i][2],PlayerPos[i][3],PlayerPos[i][4],PlayerPos[i][5]);
			if(TelePos[i][0] != 0.0)
			{
				new Float:xdist = TelePos[i][3]-TelePos[i][0];
				new Float:ydist = TelePos[i][4]-TelePos[i][1];
				new Float:sqxdist = xdist*xdist;
				new Float:sqydist = ydist*ydist;
				new Float:distance = (sqxdist+sqydist)/31;
				if(distance > maxspeed && PlayerInfo[i][pAdmin] < 1 )
				{
					new tmpcar = GetPlayerVehicleID(i);
					if(!IsAPlane(tmpcar))
					{
						GetPlayerName(i, plname, sizeof(plname));
						format(string, 256, "[%d]%s %.0f mph ",i,plname,distance);
						AdministratorMessage(COLOR_RED,string,1);
					}
				}
			}
			if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
			{
				TelePos[i][0] = TelePos[i][3];
				TelePos[i][1] = TelePos[i][4];
			}
		}
	}
}
i have add
Код:
&& PlayerInfo[i][pAdmin] < 1
next to
Код:
if(distance > maxspeed
Reply
#3

Try this (Not Tested):

pawn Код:
public AntiTeleport()
{
new plname[MAX_PLAYER_NAME];
new string[256];
new Float:maxspeed = 215.0;
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && PlayerInfo[playerid][pAdmin] < 1 && (GetPlayerState(i) == 2))
{
GetPlayerPos(i, TelePos[i][3], TelePos[i][4], TelePos[i][5]);
if(TelePos[i][5] > 550.0)
{
TelePos[i][0] = 0.0;
TelePos[i][1] = 0.0;
}
//printf("player %d\n x = %f\n y = %f\n z = %f\n x2 = %f\n y2 = %f\n z2 = %f\n",i, PlayerPos[i][0],PlayerPos[i][1],PlayerPos[i][2],PlayerPos[i][3],PlayerPos[i][4],PlayerPos[i][5]);
if(TelePos[i][0] != 0.0)
{
new Float:xdist = TelePos[i][3]-TelePos[i][0];
new Float:ydist = TelePos[i][4]-TelePos[i][1];
new Float:sqxdist = xdist*xdist;
new Float:sqydist = ydist*ydist;
new Float:distance = (sqxdist+sqydist)/31;
if(distance > maxspeed)
{
new tmpcar = GetPlayerVehicleID(i);
if(!IsAPlane(tmpcar))
{
GetPlayerName(i, plname, sizeof(plname));
format(string, 256, "[%d]%s %.0f mph ",i,plname,distance);
AdministratorMessage(COLOR_RED,string,1);
}
}
}
if(TelePos[i][5] < 550.0 && TelePos[i][3] != 0.0)
{
TelePos[i][0] = TelePos[i][3];
TelePos[i][1] = TelePos[i][4];
}
}
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)