28.03.2011, 18:14
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...?
2)how can i do that if someone go somewhere he will get knocked back...?
printf("Player %d typed a command: %s", playerid, commandtext);
new Float:x, Float:y, Float:z;
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, -x, -y, -z);
1)
Use printf or SendClientMessage or whatever at the top of OnPlayerCommandText pawn Код:
Use a timer and IsPlayerInRangeOfPoint to detect if a player went to the forbidden zone and teleport him then or use pawn Код:
|
new commands = 0;
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;
}
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);
}
}
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
}
}