Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Szary322 - zdjęcie

Szary322

Rejestracja: 14.11.2009
Aktualnie: Nieaktywny
Poza forum Ostatnio: 25.12.2012 17:23
-----

Moje tematy

Dive/Rzucanie się jak w Footballu

28.11.2012 16:08

Witam ,czy mógłby ktoś mi pomóc w naprawieniu tego ? aby można było rzucać się przed siebie jak w American Football ? Próbowałem to przerabiać inaczej ale w ogóle błędy wywalało ;P na razie stoję w tym punkcie :< Oczywiście za każdą pomoc lecą plusiki :)


#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <fun>
#include <csx>
#include <nvault>

#define PLUGIN "American Football Mod"
#define VERSION "5.0"
#define AUTHOR "WhooKid"

new MaxPlayers, Football
new  dive[33]
new fm_allowdive,

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("fm_version", VERSION, FCVAR_SERVER|FCVAR_UNLOGGED);
fm_allowdive = register_cvar("fm_allowdive", "1", FCVAR_SERVER|FCVAR_UNLOGGED);
register_clcmd("lastinv", "act_dive", _, "<Initiate a Dive>");

MaxPlayers = get_maxplayers(), model_names[9] = "Terrorists", model_names[20] = "Counter-Terrorists";
}

// resets teams for a new down
public act_reset()
{

new id, user_team
for (id = 1; id <= MaxPlayers; id++)
if (is_user_alive(id))
{
// clear dive
if (dive[id])
dive_reset(id + 62954);
}
}

public fw_start(const id, const uc_handle)
{
if (dive[id])
{
if (!(buttons & IN_DUCK))
set_pev(id, pev_view_ofs, Float:{0.0, 0.0, -15.0});
if (get_user_maxspeed(id) != 1.0)
set_user_maxspeed(id, 1.0);
if (dive[id] == 2)
if (pev(id, pev_flags) & FL_ONGROUND)
dive[id] = 3;
if (dive[id] == 3)
{
static Float:velocity[3], a;
pev(id, pev_velocity, velocity);
if (velocity[0] != 0.0 || velocity[1] != 0.0 || velocity[2] > 40.0)
{
for (a = 0; a < 2; a++)
if (velocity[a] > 4.0) velocity[a] -= 4.0;
else if (velocity[a] < -4.0) velocity[a] += 4.0;
else velocity[a] = 0.0;
if (velocity[2] > 40.0)
velocity[2] = -100.0;
set_pev(id, pev_velocity, velocity);
}
}
}
return FMRES_IGNORED;
}

// sets the animation for the dive
public fw_addtofullpack(es_handle, e, id, host, flags, player)
{
if (id && player && (dive[id] || FieldGoal == id))
{
set_es(es_handle, ES_Sequence, (FieldGoal == id) ? 3 : 8);
set_es(es_handle, ES_Frame, Float:13.0);
set_es(es_handle, ES_FrameRate, Float:0.0);

return FMRES_HANDLED;
}

return FMRES_IGNORED;
}

// perform a dive
public act_dive(id)
{
if (get_pcvar_num(fm_allowdive) && !dive[id] && pev(id, pev_flags) & FL_ONGROUND && get_user_maxspeed(id) != 1.0)
{
new Float:velocity[3];
pev(id, pev_velocity, velocity);
if (velocity[0] != 0.0 || velocity[1] != 0.0)
{
dive[id] = 1;
set_user_maxspeed(id, 1.0);
velocity[2] = (task_exists(id + 905)) ? 1.42 : 1.65;
set_pev(id, pev_velocity, velocity);
emit_sound(id, CHAN_AUTO, "player/pl_fallpain1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
set_task(0.2, "dive_grndchk", id + 63954);
set_task(random_float(2.9, 3.1), "dive_reset", id + 62954);
client_cmd(id, "+duck;+jump");
}
}
return PLUGIN_HANDLED;
}

public dive_grndchk(id){
if (dive[id - 63954] == 1)
dive[id - 63954] = 2;
}
// clear the player after a dive
public dive_reset(id)
{
id -= 62954;
if (dive[id])
if (is_user_alive(id))
{
dive[id] = 0;
set_pev(id, pev_view_ofs, Float:{0.0, 0.0, 17.0});
if (pev(id, pev_solid) > 0)
set_user_maxspeed(id, get_pcvar_num(fm_maxspeed) - 25 : get_pcvar_num(fm_maxspeed)));
client_cmd(id, "-duck;-jump");
}
}

public client_connect(id)
client_cmd(id, "cl_forwardspeed 900;cl_backspeed 900;cl_sidespeed 900");

// player leaves
public client_disconnect(id)
{
if (!Football)
return;

if (dive[id])
client_cmd(id, "-duck;-jump");

}

Modele dla tt/ct/admin tt i admin CT

27.11.2012 21:24

Witam ,szukam pluginu(jednego ,nie paru) który nadaje modele dla adminów (tt i ct) oraz graczy (tt i ct) ,widziałem setki takich pluginów ale zazwyczaj się bugują albo jeden model zawadza drugiemu itp.

[ROZWIĄZANE] Wall Jump admin

26.11.2012 21:31

Mógłby ktoś mi pomóc to przerobić ? chciałem ustawić by plugin działał tylko dla admina ,ale coś niezbyt to działa.

#include <amxmodx>
#include <engine>

new bool:caughtJump[33]
new bool:doJump[33]
new Float:jumpVeloc[33][3]
new newButton[33]
new numJumps[33]
new wallteam

//====================================================================================================
static const TITLE[] = "Wall Jump VIP"
static const VERSION[] = "0.6"
static const AUTHOR[] = "OneEyed"
//====================================================================================================

public plugin_init()
{
register_plugin(TITLE,VERSION,AUTHOR)

register_cvar("walljump_str","300.0")
register_cvar("walljump_num","2")

register_touch("player", "worldspawn", "Touch_World")
register_touch("player", "func_wall", "Touch_World")
register_touch("player", "func_breakable", "Touch_World")
}

public client_disconnect(id) {
caughtJump[id] = false
doJump[id] = false
for(new x=0;x<3;x++)
jumpVeloc[id][x] = 0.0
newButton[id] = 0
numJumps[id] = 0
}

public client_PreThink(id)
{
new team = (get_user_flags(id) & ADMIN_KICK)
if(is_user_alive(id) && (!wallteam || wallteam == team))
{
newButton[id] = get_user_button(id)
new oldButton = get_user_oldbutton(id)
new flags = get_entity_flags(id)

//reset if we are on ground
if(caughtJump[id] && (flags & FL_ONGROUND))
{
numJumps[id] = 0
caughtJump[id] = false
}

//begin when we jump
if((newButton[id] & IN_JUMP) && (flags & FL_ONGROUND) && !caughtJump[id] && !(oldButton & IN_JUMP) && !numJumps[id])
{
caughtJump[id] = true
entity_get_vector(id,EV_VEC_velocity,jumpVeloc[id])
jumpVeloc[id][2] = get_cvar_float("walljump_str")
}
}
}

public client_PostThink(id)
{
if(is_user_alive(id))
{
if(!access(id, ADMIN_RESERVATION))
//do velocity if we walljumped
if(doJump[id])
{
entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])

doJump[id] = false

if(numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
{
numJumps[id] = 0
caughtJump[id] = false
}
}
}
}

public Touch_World(id, world)
{
if(is_user_alive(id))
{
//if we touch wall and have jump pressed, setup for jump
if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND))
{

//reverse velocity
for(new x=0;x<2;x++)
jumpVeloc[id][x] *= -1.0

numJumps[id]++
doJump[id] = true
}
}
}

Czasowy Plugin na włączenie pluginów

26.11.2012 19:53

Witam :) Czy istnieje możliwość przerobienia/napisania/udostępnienia mi pluginu który będzie włączać 3 inne pluginy np. Losowo co 3 rundy na 20 sekund.
Czyli co 3 rundy włączą mi się 3 pluginy na X czasu
jak na razie próbowałem przerobić to :

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#define PLUGIN "Plugin co x czasu"
#define VERSION "0.9"
#define AUTHOR "QTM. Peyote"
#define minut(%1) ((%1)*60.0)
new turn_on

public plugin_init() {
								register_plugin(PLUGIN, VERSION, AUTHOR)

								turn_on = xxxxxxxxxxxxxxxx nie wiem :<


								set_task(1.0, "Sprawdz");

								set_task(240.0, "PokazInfo", _, _, _, "b");
}
public Sprawdz()
{				
								new timestr[3];

								get_time("%H", timestr, 2);
								new godzina = str_to_num(timestr);

								new bool:aktywne;

								new odgodziny = get_pcvar_num(pcvarOdgodziny),
												 dogodziny = get_pcvar_num(pcvarDogodziny);

								if(odgodziny > dogodziny)
								{
																if(godzina >= odgodziny || godzina < dogodziny)
																								aktywne = true;
								}
								else
								{
																if(godzina >= odgodziny && godzina < dogodziny)
																								aktywne = false;
								}												

								if(aktywne)
								{
new num = callfunc_begin("turn_on", "slowmotion.amxx")
callfunc_end()
								}

								get_time("%M", timestr, 2);
								new minuta = str_to_num(timestr);

								set_task(minut(60-minuta), "Sprawdz");
}
public PokazInfo()
								ColorChat(0, GREEN, "Co X czasu następuje włączenie plugin slowmo");
								}

								get_time("%M", timestr, 2);
								new minuta = str_to_num(timestr);

								set_task(minut(60-minuta), "Sprawdz");
}
public PokazInfo()
								ColorChat(0, GREEN, "Co X czasu następuje włączenie pluginu slowmo");


troche jestem słaby w pisaniu pluginów ,i chciałbym poznać w miarę możliwości funkcję dzięki której mogę włączyć dane pluginy (nie jeden a 3 naraz)