SA-MP Forums Archive
/arrest - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /arrest (/showthread.php?tid=156040)



/arrest - Kar - 20.06.2010

scrolllllllllllllllll downnnnnnn


Re: sendmessagetoonlineadmins - Niixie - 20.06.2010

loop it, if you store it in a enum then its something like

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][AdminLevel] => 1)
{
//MEssage to admins
}
}



Re: sendmessagetoonlineadmins - Kar - 20.06.2010


Код:
[for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[playerid][pAdmin] < 5)
{
SentClientMessage();
}
}/code]

i gotta do this in every command >.<?



Re: sendmessagetoonlineadmins - Jefff - 20.06.2010

No.
Код:
stock SendCmdToAdmins(playerid,text[])
{
	new str[180],Name[24];
	GetPlayerName(playerid,Name,24);
	format(str,sizeof(str),"(%s has used the command %s)!",Name,text);
	for(new d,g=GetMaxPlayers(); d < g; d++)
		if(d != playerid && PlayerInfo[d][AdminLevel] >= 1)
			SendClientMessage(d,COLOR,str);
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
SendCmdToAdmins(playerid,cmdtext);
something like that


Re: sendmessagetoonlineadmins - Kar - 20.06.2010

doesnt work..


Re: sendmessagetoonlineadmins - Jefff - 21.06.2010

Must be 2 players or remove
Код:
d != playerid &&



Re: sendmessagetoonlineadmins - titanak - 21.06.2010

pawn Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        {
            if(PlayerInfo[i][pAdmin] < 5)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return 1;
}
now you can use: MessageToAdmins(COLOR,string);


Re: sendmessagetoonlineadmins - Antonio [G-RP] - 21.06.2010

Quote:
Originally Posted by » Titan «
pawn Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1)
        {
            if(PlayerInfo[i][pAdmin] < 5)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return 1;
}
now you can use: MessageToAdmins(COLOR,string);
Thats checking if their admin is lower that 5, therefore even players that aren't admins will get the message, nice job


Re: sendmessagetoonlineadmins - titanak - 21.06.2010

ooh yea XDDD

pawn Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[])
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
if(PlayerInfo[i][pAdmin] == 5)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}



Re: sendmessagetoonlineadmins - Antonio [G-RP] - 21.06.2010

Hopefully Kar isn't nooby enough to simply copy and paste.