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
 

Zdjęcie

Modele


  • Zamknięty Temat jest zamknięty
4 odpowiedzi w tym temacie

#1 G[o]Q

    I'm G[o]Q

  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 04.01.2010 19:50

Mam kod ktory postawi model na mapie ale postawi on go po smierci gracza w miejscu ktorym on stal - taki nagrobek a chcialbym zeby model byl postawiony w miejscu gdzie wskazalismy celownikiem moglibyscie podac jak to zrobic?? ew wskazowki jakies :D


Cod:
#include <amxmodx>
#include <fakemeta>


#define MINS Float:{-12.650000, -22.070000, -3.950000} // definiujemy najmniejsze wartosci
#define MAXS Float:{19.870001, 8.390000, 20.540001} // definiujemy najwieksze wartosci obiektu

public plugin_init() {
    register_plugin("model", "1.0"," AUTHOR")
}
public client_death(killer,victim,weapon,hit,TK)
{
    static Float:victim_origin[3], Float:fNewOrigin[3]; // Tworzymy nowe wartosci Float
    // Ustawiamy pozycje dla obiektu!
    pev(victim,pev_origin,victim_origin); 
    new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"));
    fNewOrigin[0] = victim_origin[0] + 40.0;
    fNewOrigin[1] = victim_origin[1];
    fNewOrigin[2] = victim_origin[2] - 32.0;
    engfunc(EngFunc_SetOrigin,ent,fNewOrigin);
    
    if(!pev_valid(ent)) // Jezeli obiekt jest uszkodzony zatrzymujemy
        return 0;
    
    engfunc(EngFunc_SetModel,ent,"models/model.mdl"); // Ustawiamy model
    set_pev(ent,pev_classname,"model"); // Ustawiamy classe modelu,pomoze nam ona potem wyroznic model od reszty
    dllfunc(DLLFunc_Spawn, ent); // Stawiamy model
    set_pev(ent,pev_solid,SOLID_BBOX); // Ustawiamy trwalosc modelu
    set_pev(ent,pev_movetype,MOVETYPE_FLY); // Typ przesuwania ustawiamy na powietrze
    engfunc(EngFunc_SetSize,ent,MINS,MAXS); // Ustawiamy jego wielkosc!
    engfunc(EngFunc_DropToFloor,ent); // Ustawiamy go na ziemi ,aby nie latal
    
    return 0; // Zwracamy wartosc funkcji
}

  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#2 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 05.01.2010 00:10

AlliedModders - View Single Post - [INFO] Fakemeta & Ham detailed function descriptions and examples
  • +
  • -
  • 0

#3 G[o]Q

    I'm G[o]Q

  • Autor tematu
  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 05.01.2010 14:45

a moze jakis cod??
  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D

#4 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 05.01.2010 15:19

Maruda jestes, ale masz jak chcesz:

#define DONT_IGNORE_MONSTERS            0
#define IGNORE_MONSTERS                 1
#define IGNORE_MISSILE                  2
#define IGNORE_GLASS                    0x100

engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)

engfunc(EngFunc_TraceLine, start, end, DONT_IGNORE_MONSTERS, 0, tr)

engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)

engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS, 0, tr)

// Description: This creates a trace handle! 
// It is important to use because we don't want our plugins to mess with eachothers info!
new ptr = create_tr2()

// Description: This creates a trace handle! 
// It is important to use because we don't want our plugins to mess with each others info!
free_tr2(ptr)

// Description: Gets/Sets information from/in the trace_handle
[g|s]et_tr2(trace_handle, CONSTANT, number_if_needed!)

enum TraceResult
{
	TR_AllSolid,		// int
	TR_StartSolid,		// int
	TR_InOpen,		// int
	TR_InWater,		// int
	TR_flFraction,		// float
	TR_vecEndPos,		// float array[3]
	TR_flPlaneDist,		// float
	TR_vecPlaneNormal,	// float array[3]
	TR_pHit,		// int (edict_t*)
	TR_iHitgroup,		// int
};

new allsolid = get_tr2(trace, TR_AllSolid)
	new startsolid = get_tr2(trace, TR_StartSolid)
	// TR_StartSolid is a boolean that says whether you were "inside" something 
	// (usually the world) when the trace started (point A)
	// TR_AllSolid tells you if you ever got out of the "inside" or not.
    
	new inopen = get_tr2(trace, TR_InOpen)
	// TR_InOpen means that the start point is in Open
	// That means in the world and not in an ent or something
	
	new hit = get_tr2(trace, TR_pHit)
	// What was hit by the traceline. It will either be a player index,
	// entity index, 0 (part of map), or -1 (didn't hit anything; 
	// doesn't happen with player tracelines).
    
	new hitgroup = get_tr2(trace, TR_iHitgroup)
	// If the traceline hit another player, returns will be HIT_HEAD,
	// HIT_CHEST, HIT_LEFTLEG... etc. If the traceline hit part of the
	// map, this returns HIT_GENERIC.
    
	new Float:fraction
	get_tr2(trace, TR_flFraction, fraction)
	// Returns a number between 0.0 and 1.0, indicating how far the
	// traceline traveled start to end before it hit something. Depending
	// on what conditions were passed to this traceline forward function,
	// it could either be a wall or another entity.
	
	new Float:end_origin[3]
	get_tr2(trace, TR_vecEndPos, end_origin)
	// The official end of the traceline. Not necesarily the same as the
	// second argument passed to this traceline forward function.
	
	new Float:normal[3]
	get_tr2(trace, TR_vecPlaneNormal, normal)
	// Returns a 1 unit long vector normal to the spot that it hit. Note
	// that "normal" has a special connotation here. It doesn't mean "regular."

stock is_wall_between_points(Float:start[3], Float:end[3], ignore_ent)
{
	// Create the trace handle! It is best to create it!
	new ptr = create_tr2()
	
	// The main traceline function!
	// This function ignores GLASS, MISSILE and MONSTERS!
	// Here is an example of how you should combine all the flags!
	engfunc(EngFunc_TraceLine, start, end, IGNORE_GLASS | IGNORE_MONSTERS | IGNORE_MISSILE, ignore_ent, ptr)
	
	// We are interested in the fraction parameter
	new fraction
	get_tr2(ptr, TR_flFraction, fraction)
	
	// Free the trace handle (don't forget to do this!)
	free_tr2(ptr)
	
	// If = 1.0 then it didn't hit anything!
	return (fraction != 1.0)
}

  • +
  • -
  • 0

#5 G[o]Q

    I'm G[o]Q

  • Autor tematu
  • Przyjaciel

Reputacja: 1 344
Godlike

  • Postów:3 563
  • Steam:steam
  • Imię:Krzysiek
  • Lokalizacja:C: / program Files / Valve / Cstrike / G[o]Q.dem
Offline

Napisano 05.01.2010 16:01

ciesze sie ze skopiowales tamto no ale coz ja nie znam sie w ogóle na module fakemeta dlatego jakby ktos mogl powiedziec co mniej wiecej za co odpowiada i jak pobrac wspolrzedne celownika bo model na wsp postawic chyba umiem :D dodam ze chce zrobic sobie DR timer :D
  • +
  • -
  • 0
Manual ponad wszystko, konsola ponad manual :D :&

Chcesz wysłać do mnie PW ? użyj nazwy GoQ zamiast G[o]Q
Chcesz Kupić moduł płatności via Pukawka,Tserwery, Gamesol, Zabijaka do mojego sklepu? napisz PW cena to tylko 10 zł/sztuka

GG:6022845 (nie pomagam za free osobom ponizej rangi MoD) :D




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych