14.06.2012, 13:48
PHP код:
forward onPlayerListBans ( playerid ) ;
public onPlayerListBans ( playerid ) {
new
idx ,
data [ 3 ] [ 32 ] ,
banned_id ,
g_szListBansBig [ 512 ] ,
g_szListBans [ 512 ] ,
rows ,
fields ;
cache_get_data ( rows , fields ) ;
for ( new x , i = rows ; x != i ; x++ ) {
cache_get_field_content ( x , "r_ban_id" , data [ 0 ] ) ;
banned_id = strval ( data [ 0 ] ) ;
cache_get_field_content ( x , "r_ban_name" , data [ 1 ] ) ;
cache_get_field_content ( x , "r_ban_ip" , data [ 2 ] ) ;
idx++;
format ( g_szListBans , sizeof g_szListBans , ""#C_WHITE"#%d) %s ( IP: \""#C_GREEN"%s"#C_WHITE"\" )\n" , banned_id , data [ 1 ] , data [ 2 ] ) ;
strcat ( g_szListBansBig , g_szListBans ) ;
}
if ( idx < 1 ) strcat ( g_szListBans , ""#C_WHITE"Bans List empty!" ) ;
return ShowPlayerDialog ( playerid , R_BAN_DIALOG_LIST , 1 , ""#C_GREEN"Bans List" , g_szListBans , "SEARCH" , ">>>" ) ;
}