Quote:
|
Originally Posted by SweatyBanana
Like so:
Code:
new players[32];
get_players(players,g_num,"c")
for(new GABEN = 0; GABEN < g_num; GABEN++)
{
new GABENadmin = players[GABEN]
if(is_user_admin(GABENadmin))
{
client_print(id,print_chat,"text for admin %s",command)
server_print("text for admin %s",command)
}
}
|
Stop using "GABEN" as variable names. It's not funny, and it makes it harder to read.
There were also a couple of errors in that script. Here's a fixed and more readable version:
Code:
new iPlayers[32],iPlayersnum,iPlayer
get_players(iPlayers,iPlayersnum,"c")
for(new iCount = 0;iCount < iPlayersnum;iCount++)
{
iPlayer = iPlayers[iCount]
if(is_user_admin(iPlayer))
{
client_print(iPlayer,print_chat,"text for admin %s",command)
server_print("text for admin %s",command)
}
}
__________________