rand = random_num(0, 4);]
new rand = random_num(0, 4);
i tu
else if(rand == 3){ client_cmd(id, "mp3 play %s", muza4);. }
masz kropkę na końcu, nie wiem czy tylko o to ci chodzi bo nie rozwinąłeś swojego problemu.
To równanie zostało stworzone przy pomocy kodu LaTeX:
Edytor LaTeX online: CodeCogs.com/latex/eqneditor.php
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisane przez ChrisN w 27.11.2017 19:48
Napisane przez ChrisN w 27.11.2017 19:26
Takiego to chyba nie znajdziesz na tym forum z 1 linijką. Przerób sobie ten plugin: https://amxx.pl/topi...racz-rundy-say/
Po prostu nick gracza i jego staty wlep do jednej linijki zamiast dzielić to na 3 linijki. Ewentualnie jutro podeślę przeróbkę jak nie będziesz umiał sobie poradzić.
jakbys mogl bo mi bledy wyskakuja ; /
proszę,
#include <amxmodx> #define PLUGIN "BestPlayer" #define VERSION "1.0" #define AUTHOR "KaMaZZ" new g_iKills[33] new g_iDeaths[33] new g_hs[33] new bestplayer = 0, g_iMaxPlayers; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg", "death_event", "a", "1>0"); register_event("HLTV", "eHLTV", "a", "1=0", "2=0"); register_logevent("wiadomosc",2,"1=Round_End") g_iMaxPlayers = get_maxplayers(); } /*============================================ ============================================= =======*/ /*************************************** [Color Chat] *********************************************/ /*============================================ =================================R=E=Y=M=O=N= =A=R=G=*/ enum Color { NORMAL = 1, // clients scr_concolor cvar color GREEN, // Green Color TEAM_COLOR, // Red, grey, blue GREY, // grey RED, // Red BLUE, // Blue } new TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" } ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) { new message[256]; switch(type) { case NORMAL: // clients scr_concolor cvar color { message[0] = 0x01; } case GREEN: // Green { message[0] = 0x04; } default: // White, Red, Blue { message[0] = 0x03; } } vformat(message[1], 251, msg, 4); // Make sure message is not longer than 192 character. Will crash the server. message[192] = '^0'; new team, ColorChange, index, MSG_Type; if(id) { MSG_Type = MSG_ONE; index = id; } else { index = FindPlayer(); MSG_Type = MSG_ALL; } team = get_user_team(index); ColorChange = ColorSelection(index, MSG_Type, type); ShowColorMessage(index, MSG_Type, message); if(ColorChange) { Team_Info(index, MSG_Type, TeamName[team]); } } ShowColorMessage(id, type, message[]) { static bool:saytext_used; static get_user_msgid_saytext; if(!saytext_used) { get_user_msgid_saytext = get_user_msgid("SayText"); saytext_used = true; } message_begin(type, get_user_msgid_saytext, _, id); write_byte(id) write_string(message); message_end(); } Team_Info(id, type, team[]) { static bool:teaminfo_used; static get_user_msgid_teaminfo; if(!teaminfo_used) { get_user_msgid_teaminfo = get_user_msgid("TeamInfo"); teaminfo_used = true; } message_begin(type, get_user_msgid_teaminfo, _, id); write_byte(id); write_string(team); message_end(); return 1; } ColorSelection(index, type, Color:Type) { switch(Type) { case RED: { return Team_Info(index, type, TeamName[1]); } case BLUE: { return Team_Info(index, type, TeamName[2]); } case GREY: { return Team_Info(index, type, TeamName[0]); } } return 0; } FindPlayer() { new i = -1; while(i <= get_maxplayers()) { if(is_user_connected(++i)) return i; } return -1; } public client_connect(id) { g_iKills[id] = 0 g_iDeaths[id] = 0 } public death_event() { new iKiller = read_data(1), iVictim = read_data(2), iHitplace = read_data(3); if (iKiller == iVictim) { g_iDeaths[iKiller]++; return; } g_iKills[iKiller]++; g_iDeaths[iVictim]++; if(iHitplace) { g_hs[iKiller]++; } } public wiadomosc() { if(get_playersnum() < 2) return for(new i=1; i <= g_iMaxPlayers; i++) { if (g_iKills[i] > g_iKills[bestplayer] || g_iKills[i] == g_iKills[bestplayer] && g_iDeaths[i] < g_iDeaths[bestplayer] || g_iKills[i] == g_iKills[bestplayer] && g_hs[i] > g_hs[bestplayer]) { bestplayer = i; } } new name[32]; get_user_name(bestplayer, name, 31); new iKills = g_iKills[bestplayer] new iHS = g_hs[bestplayer] if(iKills >= 5 || iKills == 0) { ColorChat(0, GREEN, "^x03Best Player: Najlepszy gracz w tej rundzie: %s | Zdobyl %d fragow (W tym %d HS)", name, iKills, iHS) } else if(iKills > 1 && iKills < 5) { ColorChat(0, GREEN, "^x03Best Player: Najlepszy gracz w tej rundzie: %s | Zdobyl %d fragi (W tym %d HS)", name, iKills, iHS) } else if(iKills == 1) { ColorChat(0, GREEN, "^x03Best Player: Najlepszy gracz w tej rundzie: %s | Zdobyl %d fraga (W tym %d HS)", name, iKills, iHS) } } public eHLTV() { for( new i = 1 ; i <= g_iMaxPlayers ; i++ ) { g_iKills[ i ] = 0; g_iDeaths[ i ] = 0; g_hs[ i ] = 0; } }
Napisane przez ChrisN w 25.11.2017 18:25
Nie bardzo chcę go tu dawać bo się troszkę napracowałem. Moim zdaniem problem nie leży od strony silnika tylko raczej od strony klasy. ponieważ gdy mam klasę z samą grawitacją to kalsa normalnie działą i można dawać punkty w regeneracje hp lecz nie mozna ustawić np na start klasie 20 punktów w regeneracje bo klasa przestaje wtedy działąć. myślę że problem lezy po stronie nativu.
Jaki powinien być nativ do statystyki regeneracji hp
Wycinek z konsoli:Console initialized. Using breakpad crash handler Setting breakpad minidump AppID = 10 Forcing breakpad minidump interfaces to load dlopen failed trying to load: /home/servers/users/srv50075/.steam/sdk32/steamclient.so with error: /home/servers/users/srv50075/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit Protocol version 48 Exe version 1.1.2.7/Stdio (cstrike) Exe build: 21:15:21 Oct 19 2016 (921) STEAM Auth Server Server IP address 145.239.236.195:27080 Metamod version 1.21-am Copyright (c) 2001-2013 Will Day <[url=/cdn-cgi/l/email-protection][email protected][/url]> Metamod comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'. This is free software, and you are welcome to redistribute it under certain conditions; type `meta gpl' for details. AMX Mod X version 1.8.3-dev+5073 Copyright (c) 2004-2015 AMX Mod X Development Team AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'. This is free software and you are welcome to redistribute it under certain conditions; type 'amxx gpl' for details. L 11/23/2017 - 22:47:07: [FAKEMETA] get/set_gamerules_* natives have been disabled because g_pGameRules address could not be found. L 11/23/2017 - 22:47:07: [GEOIP] Database info: GeoLite2 Country database 2.0 L 11/23/2017 - 22:47:07: [CSTRIKE] BuyGunAmmo is not available L 11/23/2017 - 22:47:07: [CSTRIKE] AddAccount is not available L 11/23/2017 - 22:47:07: [CSTRIKE] Some functions are not available - forwards CS_OnBuy[Attempt] have been disabled L 11/23/2017 - 22:47:07: [CSTRIKE] g_pGameRules is not available - Forward CS_OnBuy has been disabled L 11/23/2017 - 22:47:07: Binding/Hooking cvars have been disabled - check your gamedata files. [REAUTHCHECK] Version: 0.1.4 Linux 'Counter-Strike 1.6' [REAUTHCHECK] Success: Configuration executed. [REAUTHCHECK] Success: Build ReHLDS version defined Linux '921' [WHB] Version: 1.5.626 Linux [WHB] Success: Build ReHLDS version defined Linux "921" [WHB] Success: Configuration executed. ReGameDLL build: 02:21:06 Jul 21 2016 (0.2.128) ReGameDLL API version 4.1 L 11/23/2017 - 22:47:07: -------- Mapchange to de_dust2 -------- Executing ReGameDLL Configuration File [AMXX] Loaded 2 admins from file [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. dlopen failed trying to load: /home/servers/users/srv50075/.steam/sdk32/steamclient.so with error: /home/servers/users/srv50075/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory Looking up breakpad interfaces from steamclient Calling BreakpadMiniDumpSystemInit Executing AMX Mod X Configuration File Scrolling message displaying frequency: 10:00 minutes couldn't exec listip.cfg couldn't exec banned.cfg Connection to Steam servers successful. VAC secure mode is activated.
Napisane przez ChrisN w 23.11.2017 18:51
To już 2 osoba w przeciągu tygodnia, która pyta się co jak zrobić a potem piszę o tym poradnik. Wygląda to co najmniej komicznie. Mogłeś od razu podać kod na testowe menu bo jak ktoś zaczyna zabawę w amxx to raczej ciężko mu będzie odgadnąć o co ci chodzi.
ale chce cie poinformować kolego, że sam dogrzebałem się do tego poprzez wgląd w plugin codmoda, bo w moim temacie nikt mi z tym nie pomógł a nagle tyle mądrych się znalazło
A no tak przepraszam, od dziś jesteś moim Bogiem! Zamiast pisać bezsensowne tematy od razu powinieneś zajrzeć w źródło jak jest zrobiony, a nie teraz zgrywać wielkiego bohatera, który wyciągnał 4 linijki kodu z silnika CODMOD'a. OKLASKI OKLASKI
Napisane przez ChrisN w 23.11.2017 18:49
znalazłem 2 błędy: 1. mniej ważny po uzyciu trzeba zmienić broń na inną i zpowrotem aby model się wczytał, a 2 ważnejszy można tego używać cały czas (co minie 5 sek można to znów włączyć)
I jeszcze pytanko Zmieniając
if((button & IN_ATTACK2) && get_user_weapon(attacker) == CSW_KNIFE && inflictor == attacker)
Na
if((button & IN_ATTACK) && get_user_weapon(attacker) == CSW_KNIFE && inflictor == attacker)
Bd działało na LPM ?
Co do tego IN_ATTACK2 a IN_ATTACK to tak, pierwszy to LPM drugi to PPM
Tutaj masz poprawiony z blokadą
#include <amxmodx> #include <hamsandwich> #include <fakemeta> #include <colorchat> #define model "models/v_cod_class_knife.mdl" forward cod_class_enabled(id, klasa) forward cod_class_disabled(id, klasa) forward cod_class_skill_used(id) native cod_register_class(const nazwa[], const opis[], bronie, punkty_zdrowia, punkty_kondycji, punkty_inteligencji, punkty_wytrzymalosci) new bool:g_player_has_class[33],Float:g_player_item_time[33] new bool:wykorzystal[33]; public plugin_precache() precache_model(model) public plugin_init() { register_plugin("cod class nazwa klasy", "1.0", "fresh") cod_register_class("Nazwa","Opis",0,0,0,0,0) RegisterHam(Ham_TakeDamage,"player","bacon_player_takedamage_pre",false) RegisterHam(Ham_Killed,"player","bacon_player_killed_post",true) register_event("ResetHUD", "ResetHUD", "abe"); register_event("CurWeapon","event_curweapon","be","1=1","2=29") } public cod_class_enabled(id) { g_player_has_class[id] = true; ResetHUD(id); } public cod_class_disabled(id) g_player_has_class[id] = false public cod_class_skill_used(id) { if(!is_user_alive(id)) return; if(wykorzystal[id]) { ColorChat(id, RED, "Wykorzystales juz swoja umiejetnosc."); return; } wykorzystal[id] = true; set_task(5.0, "task_remove_knife_model", id) g_player_item_time[id] = get_gametime() + 5.0 static weapon; weapon = get_pdata_cbase(id, 370) if(pev_valid(weapon)) ExecuteHam(Ham_Item_Deploy,weapon) } public bacon_player_takedamage_pre(id,inflictor,attacker,Float:damage,damagetype) { if(!is_user_alive(attacker) || !g_player_has_class[attacker] || get_gametime() > g_player_item_time[attacker]) return HAM_IGNORED static button button = pev(attacker,pev_button) if((button & IN_ATTACK2) && get_user_weapon(attacker) == CSW_KNIFE && inflictor == attacker) { static Float:health pev(id,pev_health,health) SetHamParamFloat(4,health*10.0) return HAM_HANDLED } return HAM_IGNORED } public bacon_player_killed_post(id,attacker,shouldgib) if(task_exists(id)) remove_task(id) public event_curweapon(id) { if(!is_user_alive(id) || !g_player_has_class[id] || get_gametime() > g_player_item_time[id]) return; set_pev(id,pev_viewmodel2,model) } public task_remove_knife_model(id) { if(!g_player_has_class[id]) return; static weapon; weapon = get_user_weapon(id) if(weapon != CSW_KNIFE) return; static viewmodel[64] pev(id,pev_viewmodel2,viewmodel,63) if(equal(viewmodel,model)) { weapon = get_pdata_cbase(id, 370) if(pev_valid(weapon)) ExecuteHam(Ham_Item_Deploy,weapon) } } public ResetHUD(id) wykorzystal[id] = false;
Napisane przez ChrisN w 21.11.2017 17:24
aSik Ja nie czaję aż tak amxx'a, mi albo musisz w hu** dokładnie albo gotowca. Średnio wiem co to jest ta funkcja.
Napisane przez ChrisN w 20.11.2017 18:04
bump bump
Napisane przez ChrisN w 08.11.2017 23:56
Napisane przez ChrisN w 08.11.2017 15:09
Napisane przez ChrisN w 06.11.2017 19:26
Napisane przez ChrisN w 01.11.2017 20:24
Napisane przez ChrisN w 30.10.2017 23:15
Napisane przez ChrisN w 30.10.2017 22:08
Logi? Inne klasy działają? Wrzuciłeś codclass_partyzant.amxx do folderu plugins?
L 10/30/2017 - 19:27:54: Start of error session.
L 10/30/2017 - 19:27:54: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 19:27:54: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
L 10/30/2017 - 19:28:04: Start of error session.
L 10/30/2017 - 19:28:04: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 19:28:04: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
L 10/30/2017 - 19:28:08: Start of error session.
L 10/30/2017 - 19:28:08: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 19:28:08: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
L 10/30/2017 - 19:53:07: Start of error session.
L 10/30/2017 - 19:53:07: Info (map "de_airstrip") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 19:53:07: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
L 10/30/2017 - 20:18:06: Start of error session.
L 10/30/2017 - 20:18:06: Info (map "cs_havana") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 20:18:06: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
L 10/30/2017 - 20:39:12: Start of error session.
L 10/30/2017 - 20:39:12: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20171030.log")
L 10/30/2017 - 20:39:12: [AMXX] Invalid Plugin (plugin "codclass_partyzant.amxx")
Podstawowe klasy działają.. pisałem wyżej podeslalem tez plugins ;f czytaj, czytaj
A to już wiem, kompilowane przez kompilator ze strony. Skompiluj go lokalnie i będzie śmigać