Multiple parameters with a single stock function
#10

pawn Код:
stock SendAdminMessage(string[], level = 0, color = COLOR_LIGHTBLUE)
{
    foreach(Player, i)
    {
        if(pInfo[i][pAdminLevel] > 0)
            if(pInfo[i][pAdminLevel] > level) SendClientMessage(i, color, string);
    }
}
You call it with:
pawn Код:
SendAdminMessage(string[], level = 0, color = COLOR_LIGHTBLUE)
//String must be used
//Optional - Level is 0 if there is no parameter
//Optional - Color is LightBlue if there is no parameter
SendAdminMessage("Test",2);//There is example
[EDIT]I late a bit xD
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)