|
for ( new i = 0 ; i < g_signs; i++){
if (equali(sz_name, g_szName[i])){
format(p_message,127,"^x03%s【个性签名】^x04%s", sz_name, g_szSign[i]);
server_print("%s:%s", sz_name, g_szSign[i]);
sign_message(p_message);
break;
}
}
}
}
public cmd_reloadSigns(){
load_signs();
}
load_signs(){
new sz_cfgFile[128];
get_localinfo("amxx_configsdir", sz_cfgFile, 127);
add ( sz_cfgFile, 127, "\signs.ini");
if (!file_exists(sz_cfgFile))
return 0;
g_signs = 0;
new n_txtLen, n_pos = 0;
new sz_output[128];
while ( g_signs < MAX_SIGN && read_file (sz_cfgFile, n_pos++, sz_output, 127, n_txtLen)){
if (sz_output[0] != '"')
continue;
parse (sz_output, g_szName[g_signs], 31, g_szSign[g_signs], 95);
g_signs++;
}
server_print ("载入 %d 个签名. 最大 %d 个签名.", g_signs, MAX_SIGN);
return 1;
}
sign_message(p_message[]){
message_begin(MSG_ALL, get_user_msgid("SayText"))
write_byte(1)
write_string(p_message)
message_end()
}
|
|