Question about commands
#1

Is there a way to force a player to run a specific command ?

For example I want ID 0 to run the command /help without the player typing the command.
Reply
#2

I think you could do this:
Код:
OnPlayerCommandText(0, "/help");
Reply
#3

Код:
new IsNew[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
    IsNew[playerid] = 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsNew[playerid] == 1)
    {
        // If you are using ZCMD
        cmd_help(playerid,"");
     }
}

public OnPlayerDisconnect(playerid, reason)
{
    IsNew[playerid] = 0;
}
Reply
#4

Thanks both of you. My idea was for example there is troll hack with /sk command. When player type this command it doesn't send to the server and I want to force the player to type this command to see will the server receive the command from this player, but this doesn't work. Any other ideas?
Reply
#5

Quote:
Originally Posted by Brooks1
Посмотреть сообщение
Thanks both of you. My idea was for example there is troll hack with /sk command. When player type this command it doesn't send to the server and I want to force the player to type this command to see will the server receive the command from this player, but this doesn't work. Any other ideas?
Client commands are client commands and server commands are server commands. It's not possible to detect that as far as I know.
Reply
#6

If you want to use that use SCMD.

It sets your commands with an id of itself...

example you can set that admins will see that player is using cmd id 3 which /help.

You just need to set that if(cmdid == 3) or switch cmdid, it depends on your preference.
{
foreach(new i : Player)
if(i is admin) you already know what it needs.
SendClientMessage(i, COLOR, "This player used this command.") <- this should be formatted but I know you understand.

You get the example?

if this is not what you meant then I'm sorry but I think to thing you want to do might be possibpe but not at this generation.
Reply
#7

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Client commands are client commands and server commands are server commands. It's not possible to detect that as far as I know.
What this guy says is correct. The command doesn't get sent to the server, it only turns up on the client.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)