kz_records |
Здравствуйте, гость Вход | Регистрация
Наши новости:
|
|
|
kz_records |
RoUn
|
30.6.2010, 15:02
Сообщение
|
|||
|
|
здрасте...
нужно чуть подправить плагин, а именно чтобы сообщения выдавались не всем игрокам а только тем кто пропишет в чате /wr это 1ое вот функция вывода сообщения... Код Код public hookSay( plr ) { static msg[512], cmd[32], map[32]; read_args( cmd, 31 ); remove_quotes( cmd ); if( !cmd[0] || strlen( cmd ) != 3 ) { return PLUGIN_CONTINUE; } for( new i; i < MAX; i++ ) { for( new j; j < SAY; j++ ) { if( !equali( cmd, g_SayCommands[i][j], 3 ) ) { continue; } static author[EXT][32], kztime[8], extension[EXT][8], len, founds; if( cmd[4] ) { founds = get_record_data( i, cmd[4], author, kztime, extension ); len = format( msg, 511, " %s Record of %s:", g_CountryAdjective[i], cmd[4] ); }else{ get_mapname( map, 31 ); founds = get_record_data( i, map, author, kztime, extension ); len = format( msg, 511, "^4[KZ]^1 %s Record of^4 %s^1 by:", g_CountryAdjective[i], map ); } if( author[0][0] ){ for( new x; x < founds; x++ ){ if( !author[x][0] ){ break; } if( extension[x][0] ){ len += format( msg[len], 511 - len, "^n [%s] %s %i:%02i. ", extension[x], author[x], ( kztime[x] / 60 ), ( kztime[x] % 60 ) ); }else{ len += format( msg[len], 511 - len, "^n^3 %s ^1in ^3%i^1:^3%02i^1. ", author[x], ( kztime[x] / 60 ), ( kztime[x] % 60 ) ); } } }else{ ColorChat(0,NORMAL,"^4[KZ] ^1This map dont have an Official Record"); return PLUGIN_HANDLED; } //set_hudmessage( g_iColors[0], g_iColors[1], g_iColors[2], g_fCoords[0], g_fCoords[1], _, _, g_fShowtime, _, _, -1 ); //show_hudmessage( plr, msg ); ColorChat(0,NORMAL,msg); return PLUGIN_HANDLED; } } return PLUGIN_CONTINUE; } 2ое нужно дописать в плагине, чтобы когда игрок прописывает в чате /wr [mapname] выдавал рекорд этой карты... вроде в этом куске кода оно есть (: Код Код public cmdHookSay( plr ) { static message[512]; read_args( message, sizeof message - 1 ); remove_quotes( message ); if( message[0] ) { for( new i; i < MAX; i++ ) { if( equali( g_CommandList[i], message, 3 ) ) { static list[3], mapname[64]; format( list, sizeof list - 1, "%s", message ); if( message[4] ) copy( mapname, sizeof mapname - 1, message[4] ); // maybe i should add some function which does show maps with similar names?! else get_mapname( mapname, sizeof mapname - 1 ); if( file_exists( g_flDemoData[i] ) ) { static line, line_len; static data[64]; static map[32], kreedzer[32], time_str[16], len, temp[32], ext[16]; new time_num; while( ( line = read_file( g_flDemoData[i], line, data, sizeof data - 1, line_len ) ) != 0 ) { parse( data, temp, sizeof temp - 1, time_str, sizeof time_str - 1, kreedzer, sizeof kreedzer - 1 ); if( containi( temp, "[" ) != -1 ) { replace( temp, sizeof temp - 1, "[", " " ); replace( temp, sizeof temp - 1, "]", " " ); parse( temp, map, sizeof map - 1, ext, sizeof ext - 1 ); format( ext, sizeof ext - 1, "[%s]", ext ); } else { map = temp; ext = ""; } if( equali( mapname, map ) ) { if( !time_num ) { time_num = str_to_num( time_str ); len = format( message, sizeof message - 1, "%s:^n Map: %s^n Author: %s (%d:%02d) %s", g_Record[i], mapname, kreedzer, ( time_num / 60 ), ( time_num % 60 ), ext ); } else { time_num = str_to_num( time_str ); len += format( message[len], sizeof message - len - 1, "^n %s (%d:%02d) %s", kreedzer, ( time_num / 60 ), ( time_num % 60 ), ext ); } } } if ( !time_num ) format( message, sizeof message - 1, "%s:^n Map: %s^n Author: N/A", g_Record[i], mapname ); } else { format( message, sizeof message - 1, "Cannot view the record, please contact an admin!^n^"%s^" was not found", g_flDemoData[i] ); log_amx( "^"%s^" was not found!", g_flDemoData[i] ); } set_hudmessage( g_iColors[0], g_iColors[1], g_iColors[2], g_fCoords[0], g_fCoords[1], _, _, get_pcvar_float( g_CvarShowTime ), _, _, -1 ); show_hudmessage( plr, message ); } } } } полный исходник с инклудами в аттаче
kz_records.rar ( 3,89 килобайт )
Кол-во скачиваний: 23с меня +
Отредактировал: RoUn, - 1.7.2010, 5:53
|
|||
|
|
||||
RoUn
|
1.7.2010, 9:31
Сообщение
|
|||
|
|
апапап
|
|||
|
|
||||
RoUn
|
2.7.2010, 8:39
Сообщение
|
|||
|
|
спасибо, теперь на 2ой нада (:
|
|||
|
|
||||
RoUn
|
4.7.2010, 5:34
Сообщение
|
|||
|
|
ну, мне помогут?
|
|||
|
|
||||
![]() ![]() |