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?