How to ignore this msg if the player is admin - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to ignore this msg if the player is admin (
/showthread.php?tid=125023)
How to ignore this msg if the player is admin -
Perker12345 - 01.02.2010
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.
Re: How to ignore this msg if the player is admin -
scott1 - 01.02.2010
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
Re: How to ignore this msg if the player is admin -
LuxurioN™ - 01.02.2010
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];
}
}
}
}