Read comds problem? please help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Read comds problem? please help (
/showthread.php?tid=412569)
Read comds problem? please help -
CBCandyBoy - 02.02.2013
man this is my read cmds by which admins can read cmds for admin onlly
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new playname[MAX_PLAYER_NAME], ircCommand[256];
GetPlayerName(playerid, playname, sizeof(playname));
format(ircCommand, sizeof(ircCommand), "02[%i] 07%s: %s", playerid, playname, cmdtext);
IRC_GroupSay(gGroupID2, IRC_CHANNEL, ircCommand);
new string[256];
new idx;
string = strtok(cmdtext, idx);
//================ [ Read Comamands ] ===========================//
if(ServerInfo[ReadCmds] == 1)
{
format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if( (PlayerInfo[i][Level] > PlayerInfo[playerid][Level]) && (PlayerInfo[i][Level] > 1) && (i != playerid) ) {
SendClientMessage(i, grey, string);
}
}
}
}
}
but it wont show
Re: Read comds problem? please help -
Rapgangsta - 02.02.2013
Are you sure that ServerInfo[ReadCmds] is set to 1?
However
Код:
if(ServerInfo[ReadCmds] == 1)
{
format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(IsPlayerAdmin(playerid)) {
SendClientMessage(i, grey, string);
}
}
}
}
this should show the message to RCON ADMINS, however if you have a serverside admin system use post here your variable (if you don't know which just post here an admin command like /kick or /ban)
Re: Read comds problem? please help -
CBCandyBoy - 03.02.2013
yes it setted to 1 first it was commented then i uncommented it
Re: Read comds problem? please help -
Scenario - 03.02.2013
pawn Код:
if(ServerInfo[ReadCmds] == 1)
{
format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(playerid == i) continue;
if(PlayerInfo[i][Level] > PlayerInfo[playerid][Level]) SendClientMessage(i, grey, string);
}
}
}
If that doesn't work then one of the variables you're using to check things (i.e. in the if-statements) is not set to the proper value.