Quote:
Originally Posted by CoR3
Hello i have this code, but i have a problem; when some player "click map" sends me alerts of everyone.
PHP код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
foreach (Player, i)
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
new string[128];
new sendername[MAX_PLAYERS];
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "AdmWarning:[%d][%s]Posible TP, Revisalo rapido!",i, sendername);
SendSpeedMessage(COLOR_YELLOW, string);
SendDebugMessage("AntiCheat");
}
return 1;
}
And i've seen in other server that, when a player click map the point don't appears. How can i do that?
|
If this is what you mean, its actually a code when a player not greater that admin level 1 clicks that map, a message will go to all admins of level 1 and higher.
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
new string[128];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmWarning:[%d][%s]Posible TP, Revisalo rapido!",i, sendername);
foreach (Player, i)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
SendClientMessage(i, COLOR_YELLOW, string);
SendDebugMessage("AntiCheat");
}
}
}
return 1;
}
NOTE: i have used
SendClientMessage(i, COLOR_YELLOW, string); because you haven't provided the code for
SendSpeedMessage, or anything related to it!
Also, you had the wrong string size entered in the format part!
For the pointer not to appear, simply
return 0; in the callback!