Show commands typed by players to admins -
KamalBakri - 05.06.2015
Hello, I'm a newbie and I want a command like that it will tell the commands typed by players, even it is /slfjadflksajdl;a, or /heyhowareyoubrotherblahblah. I want it command to be named as /listen, for level 6 admins and must be in strcmp format.
if (adlvl[playerid] != 6) return 0;
Re: Show commands typed by players to admins -
JaydenJason - 05.06.2015
that's impossible to do, unless you add at every scripted command a function that sends it to every alevel6 admins, i recommend you use zcmd, with that it is possible.
Re: Show commands typed by players to admins -
KamalBakri - 05.06.2015
I dont know how to convert it to ZCMD, can you do it for me?
Re: Show commands typed by players to admins -
ProDude - 20.12.2015
Код:
CMD:listen(playerid, params[])
{
if (adlvl[playerid] < 6) return 0;
if(CListen[playerid] == 0)
{
CListen[playerid] = 1;
SendClientMessage(playerid, -1, "You have started listening to commands.");
}
else
{
CListen[playerid] = 0;
SendClientMessage(playerid, -1, "You have stopped listening to commands.");
}
return 1;
}
Here you Go
Re: Show commands typed by players to admins -
MIDO007 - 08.09.2018
Quote:
Originally Posted by ProDude
Код:
CMD:listen(playerid, params[])
{
if (adlvl[playerid] < 6) return 0;
if(CListen[playerid] == 0)
{
CListen[playerid] = 1;
SendClientMessage(playerid, -1, "You have started listening to commands.");
}
else
{
CListen[playerid] = 0;
SendClientMessage(playerid, -1, "You have stopped listening to commands.");
}
return 1;
}
Here you Go
|
This command is not working in my script
Re: Show commands typed by players to admins -
Hunud - 08.09.2018
Quote:
Originally Posted by JaydenJason
that's impossible to do, unless you add at every scripted command a function that sends it to every alevel6 admins, i recommend you use zcmd, with that it is possible.
|
What ?
Re: Show commands typed by players to admins -
AlexMSK - 08.09.2018
Quote:
Originally Posted by MIDO007
This command is not working in my script
|
Make sure you've included ZCMD
https://sampforum.blast.hk/showthread.php?tid=91354
Re: Show commands typed by players to admins -
solstice_ - 08.09.2018
Quote:
Originally Posted by JaydenJason
that's impossible to do, unless you add at every scripted command a function that sends it to every alevel6 admins, i recommend you use zcmd, with that it is possible.
|
How is that impossible?
Re: Show commands typed by players to admins -
CaptainBoi - 08.09.2018
PHP код:
enum PlayerInfo
{
bool:Listening
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:listen(playerid, params[])
{
if(pInfo[playerid][Listening] == false)
{
pInfo[playerid][Listening] = true;
SendClientMessage(playerid, -1, "You have started listening to commands.");
}
else
{
pInfo[playerid][Listening] = false;
SendClientMessage(playerid, -1, "You have stopped listening to commands.");
}
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if (!IsPlayerConnected2(playerid)) return 0;
new cstring[100],playerids[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerids, sizeof(playerids));
format(cstring, sizeof(cstring), "[cmd] [%s]: %s", playerids, cmdtext);
foreach(new i: Player)
{
if(adminvariable >= 1 && Listen(i) == 1)
{
if(adminvariable <= adminvariable)
{
if(i != playerid) SendClientMessage(i, -1, cstring);
}
}
}
return 1;
}
forward Listen(playerid);
public Listen(playerid)
{
return pInfo[playerid][Listening];
}
here
Re: Show commands typed by players to admins -
solstice_ - 08.09.2018
Quote:
Originally Posted by CaptainBoi
PHP код:
enum PlayerInfo
{
bool:Listening
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:listen(playerid, params[])
{
if(pInfo[playerid][Listening] == false)
{
pInfo[playerid][Listening] = true;
SendClientMessage(playerid, -1, "You have started listening to commands.");
}
else
{
pInfo[playerid][Listening] = false;
SendClientMessage(playerid, -1, "You have stopped listening to commands.");
}
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if (!IsPlayerConnected2(playerid)) return 0;
new cstring[100],playerids[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerids, sizeof(playerids));
format(cstring, sizeof(cstring), "[cmd] [%s]: %s", playerids, cmdtext);
foreach(new i: Player)
{
if(adminvariable >= 1 && Listen(i) == 1)
{
if(adminvariable <= adminvariable)
{
if(i != playerid) SendClientMessage(i, -1, cstring);
}
}
}
return 1;
}
forward Listen(playerid);
public Listen(playerid)
{
return pInfo[playerid][Listening];
}
here
|
And where have you defined adminvariable? Where is the explanation? Are you just posting code to gain reputation without even explaining it?