#1

1)how can i that when someone write a command i will see it?
2)how can i do that if someone go somewhere he will get knocked back...?
Reply
#2

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.
Reply
#3

EDIT: To late.
Reply
#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
#5

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*/ i, COLOUR_GREY, string);  // you want to send it to i, not to playerid
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)