#4

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:
pawn Код:
new commands = 0;
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?
Reply


Messages In This Thread
help - by omer5198 - 28.03.2011, 18:14
Re: help - by Mauzen - 28.03.2011, 18:23
Re: help - by Stigg - 28.03.2011, 18:23
Re: help - by omer5198 - 28.03.2011, 18:25
Re: help - by Mauzen - 29.03.2011, 21:14

Forum Jump:


Users browsing this thread: 4 Guest(s)