Quote:
Originally Posted by Mauzen
1)
Use printf or SendClientMessage or whatever at the top of OnPlayerCommandText
pawn Код:
printf("Player %d typed a command: %s", playerid, commandtext);
2)
Use a timer and IsPlayerInRangeOfPoint to detect if a player went to the forbidden zone and teleport him then or use
pawn Код:
new Float:x, Float:y, Float:z; GetPlayerVelocity(playerid, x, y, z); SetPlayerVelocity(playerid, -x, -y, -z);
to knock him back.
|
first of all... thx but i want that only admins level 3+ can see the commands...
PlayerInfo[pInfo][AdminLevel]
Edit:
i used:
command:
pawn Код:
if(strcmp("/showcommands", cmdtext, true, 12) || strcmp("/sc", cmdtext, true, 2) == 0)
{
if(commands == 0)
{
commands = 1;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You can now see the players commands");
}
else
{
commands = 0;
SendClientMessage(playerid, COLOUR_LIGHTBLUE, "now, You can't see the players commands!");
}
return 1;
}
under OnPlayerCommandText...
pawn Код:
if(commands == 1 && PlayerInfo[playerid][AdminLevel] <= 2)
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(PlayerInfo[i][AdminLevel] >= 3)
{
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[%s]: %s (id:%d)", name, cmdtext[0], playerid);
SendClientMessage(playerid, COLOUR_GREY, string);
}
}
what have i done wrong?