/arrest
#1

scrolllllllllllllllll downnnnnnn
Reply
#2

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
}
}
Reply
#3


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

i gotta do this in every command >.<?
Reply
#4

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
Reply
#5

doesnt work..
Reply
#6

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

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);
Reply
#8

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
Reply
#9

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)