#include <amxmisc>daj
#include <hamsandwich>
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 _McHappy w 19.02.2019 17:26
Napisane przez _McHappy w 22.01.2019 14:13
Napisane przez _McHappy w 29.12.2018 14:19
Napisane przez _McHappy w 16.12.2018 00:24
Napisane przez _McHappy w 16.12.2018 00:14
Napisane przez _McHappy w 05.12.2018 01:09
Napisane przez _McHappy w 28.09.2018 22:26
Napisane przez _McHappy w 27.09.2018 21:43
damage += (damage * (float(obrazenia_gracza[idattacker])*0.003))~>
damage += (damage * (float(obrazenia_gracza[idattacker]+bonusowe_obrazenia_gracza[idattacker])*0.003))Dodałeś samemu natyw, który zwiększa obrażenia bonusowe. Tutorial Dark'a opisuje zbiór zmian, które nie przewidują użycia tego natywu w innych pluginach, dlatego wymagane jest uwzględnienie dodanej przez Ciebie zmiennej w obliczeniach obrażeń.
Napisane przez _McHappy w 12.09.2018 12:04
Stosowanie natywów dynamicznych z parametrem 'style' równym 1 uniemożliwia kontrolę liczby przekazywanych do natywu (przy wywołaniu) parametrów, co w przypadku bardziej złożonych funkcji przekłada się na zwiększone ryzyko wystąpienia komplikacji w trakcie wykonywania kodu. Ponadto, natywy rejestrowane bez w/w parametru pozwalają na identyfikację pluginu, który je wywołał oraz nie wymagają w/w, dodatkowej konwersji parametrów (tablic) do postaci referencyjnej.
Często, dla prostych kontrukcji natywów, rejestrowanie z parametrem 'style' równym 1 wydaje się być właściwszym rozwiązaniem (rozwiązanie mniej skomplikowane i szybsze).
Napisane przez _McHappy w 03.09.2018 02:33
Napisane przez _McHappy w 02.09.2018 23:13
Napisane przez _McHappy w 11.08.2018 16:58
public paint_fire(id, num) { new a, ent; while (a++ < g_pbcount - 1 && !ent) if (g_pbstatus[a] == 0) ent = g_pbstatus[a] = g_paintballs[a]; if (!ent) while (a-- > 1 && !ent) if (g_pbstatus[a] == 2) ent = g_pbstatus[a] = g_paintballs[a]; if (pev_valid(ent) && is_user_alive(id)) { new Float:vangles[3], Float:nvelocity[3], Float:voriginf[3], vorigin[3], clr; set_pev(ent, pev_owner, id); new my_pbgun = user_has_pbgun(id); set_pev(ent, pev_classname, "pbBullet"); engfunc(EngFunc_SetModel, ent, "models/w_paintball.mdl"); if (my_pbgun == PB_SNIPER) //make them smaller to avoid creation collisions engfunc(EngFunc_SetSize, ent, Float:{0.0, 0.0, 0.0}, Float:{1.0, 1.0, 1.0}); else engfunc(EngFunc_SetSize, ent, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0}); switch (get_pcvar_num(color)) { case 2: clr = (get_user_team(id) == 1) ? 0 : 1; case 3: clr = (get_user_team(id) == 1) ? 4 : 3; case 4: clr = (get_user_team(id) == 1) ? 2 : 5; default: clr = random_num(0, 6); } set_pev(ent, pev_skin, clr); set_pev(ent, pev_gravity, 0.5); vangles[0] = random_float(-180.0, 360.0); vangles[1] = random_float(-180.0, 360.0); set_pev(ent, pev_angles, vangles); pev(id, pev_v_angle, vangles); set_pev(ent, pev_v_angle, vangles); get_user_origin(id, vorigin, 1); IVecFVec(vorigin, voriginf); if (my_pbgun == PB_SNIPER) { new Float:vresult[3], Float:fDistance, Float:fDistanceStep = 20.0; fDistance = power(-1, num)*((num+1)/2)*fDistanceStep; // obliczenie mnoznika dystansu wzgledem srodkowej kulki if(fDistance != 0.0) { angle_vector(vangles, ANGLEVECTOR_RIGHT, vresult) xs_vec_mul_scalar(vresult, fDistance, vresult); xs_vec_add(voriginf, vresult, voriginf); } } engfunc(EngFunc_SetOrigin, ent, voriginf); pev(id, pev_view_ofs, vangles); set_pev(ent, pev_view_ofs, vangles); new veloc; if (get_pcvar_num(gravity)) set_pev(ent, pev_movetype, MOVETYPE_BOUNCE); else set_pev(ent, pev_movetype, MOVETYPE_FLY); set_pev(ent, pev_solid, 2); //Different guns shoot at different speeds switch (my_pbgun) { case PB_MARKER: veloc = get_pcvar_num(speed_marker); case PB_GLOCK: veloc = get_pcvar_num(speed_pistol); case PB_USP: veloc = get_pcvar_num(speed_pistol); case PB_SNIPER: veloc = get_pcvar_num(speed_sniper); case PB_SUPERMARKER: veloc = get_pcvar_num(speed_smarker); default: veloc = get_pcvar_num(speed_pistol); } velocity_by_aim(id, veloc, nvelocity); //Fix aim for bots if (is_user_bot(id)) switch (my_pbgun) { case PB_MARKER: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0; case PB_GLOCK: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0; case PB_USP: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0; case PB_SNIPER: nvelocity[2] += (get_pcvar_num(gravity))? 35 : 0; case PB_SUPERMARKER: nvelocity[2] += (get_pcvar_num(gravity))? 100 : 0; default: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0; } //Recoil!!! if (cs_get_user_zoom(id)== CS_SET_NO_ZOOM){ //the sniper will shoot terribly bad without a scope new modifier = (my_pbgun != PB_SNIPER)? 1 : 5; new buttons = pev(id, pev_button); if (my_pbgun == PB_SNIPER) modifier = 2; else //shoot worse while moving if (buttons & IN_JUMP || buttons & IN_FORWARD || buttons & IN_BACK || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT) modifier *= 2; new disp = get_pcvar_num(dispersion); nvelocity[0] += (random(disp)-disp/2) * modifier; nvelocity[1] += (random(disp)-disp/2) * modifier; nvelocity[2] += (random(disp)-disp/2) * modifier; } set_pev(ent, pev_velocity, nvelocity); set_pev(ent, pev_effects, pev(ent, pev_effects) & ~EF_NODRAW); //glow set_task(0.1, "paint_glow", ent); set_task(15.0 , "paint_reset", ent+TASK_PB_RESET); } return ent; }
Napisane przez _McHappy w 10.08.2018 23:18
public paint_fire(id, num) { new a, ent; while (a++ < g_pbcount - 1 && !ent) if (g_pbstatus[a] == 0) ent = g_pbstatus[a] = g_paintballs[a]; if (!ent) while (a-- > 1 && !ent) if (g_pbstatus[a] == 2) ent = g_pbstatus[a] = g_paintballs[a]; if (pev_valid(ent) && is_user_alive(id)) { new Float:vangles[3], Float:nvelocity[3], Float:voriginf[3], vorigin[3], clr; set_pev(ent, pev_owner, id); new my_pbgun = user_has_pbgun(id); set_pev(ent, pev_classname, "pbBullet"); engfunc(EngFunc_SetModel, ent, "models/w_paintball.mdl"); if (my_pbgun == PB_SNIPER) //make them smaller to avoid creation collisions engfunc(EngFunc_SetSize, ent, Float:{0.0, 0.0, 0.0}, Float:{1.0, 1.0, 1.0}); else engfunc(EngFunc_SetSize, ent, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0}); switch (get_pcvar_num(color)) { case 2: clr = (get_user_team(id) == 1) ? 0 : 1; case 3: clr = (get_user_team(id) == 1) ? 4 : 3; case 4: clr = (get_user_team(id) == 1) ? 2 : 5; default: clr = random_num(0, 6); } set_pev(ent, pev_skin, clr); set_pev(ent, pev_gravity, 0.5); vangles[0] = random_float(-180.0, 360.0); vangles[1] = random_float(-180.0, 360.0); set_pev(ent, pev_angles, vangles); pev(id, pev_v_angle, vangles); set_pev(ent, pev_v_angle, vangles); get_user_origin(id, vorigin, 1); IVecFVec(vorigin, voriginf); if (my_pbgun == PB_SNIPER) { new Float:vresult[3], Float:fDistance, Float:fDistanceStep = 20.0; fDistance = power(-1, num+1)*(num+1)/2*fDistanceStep; // obliczenie mnoznika dystansu wzgledem srodkowej kulki if(fDistance != 0.0) { angle_vector(vangles, ANGLEVECTOR_RIGHT, vresult) xs_vec_mul_scalar(vresult, fDistance, vresult); xs_vec_add(voriginf, vresult, voriginf); } } engfunc(EngFunc_SetOrigin, ent, voriginf); pev(id, pev_view_ofs, vangles); set_pev(ent, pev_view_ofs, vangles); new veloc; if (get_pcvar_num(gravity)) set_pev(ent, pev_movetype, MOVETYPE_BOUNCE); else set_pev(ent, pev_movetype, MOVETYPE_FLY); set_pev(ent, pev_solid, 2); //Different guns shoot at different speeds switch (my_pbgun) { case PB_MARKER: veloc = get_pcvar_num(speed_marker); case PB_GLOCK: veloc = get_pcvar_num(speed_pistol); case PB_USP: veloc = get_pcvar_num(speed_pistol); case PB_SNIPER: veloc = get_pcvar_num(speed_sniper); case PB_SUPERMARKER: veloc = get_pcvar_num(speed_smarker); default: veloc = get_pcvar_num(speed_pistol); } velocity_by_aim(id, veloc, nvelocity); //Fix aim for bots if (is_user_bot(id)) switch (my_pbgun) { case PB_MARKER: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0; case PB_GLOCK: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0; case PB_USP: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0; case PB_SNIPER: nvelocity[2] += (get_pcvar_num(gravity))? 35 : 0; case PB_SUPERMARKER: nvelocity[2] += (get_pcvar_num(gravity))? 100 : 0; default: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0; } //Recoil!!! if (cs_get_user_zoom(id)== CS_SET_NO_ZOOM){ //the sniper will shoot terribly bad without a scope new modifier = (my_pbgun != PB_SNIPER)? 1 : 5; new buttons = pev(id, pev_button); if (my_pbgun == PB_SNIPER) modifier = 2; else //shoot worse while moving if (buttons & IN_JUMP || buttons & IN_FORWARD || buttons & IN_BACK || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT) modifier *= 2; new disp = get_pcvar_num(dispersion); nvelocity[0] += (random(disp)-disp/2) * modifier; nvelocity[1] += (random(disp)-disp/2) * modifier; nvelocity[2] += (random(disp)-disp/2) * modifier; } set_pev(ent, pev_velocity, nvelocity); set_pev(ent, pev_effects, pev(ent, pev_effects) & ~EF_NODRAW); //glow set_task(0.1, "paint_glow", ent); set_task(15.0 , "paint_reset", ent+TASK_PB_RESET); } return ent; }
Napisane przez _McHappy w 09.08.2018 15:14