000
05.09.2005, 20:15
NxTwo
|
Hey, wenn ich ingame "give weapon_flaregun" eingeb, bekomm ich zwar die waffe, aber keine munition. Ausserdem kommt drunter die Meldung: "ERROR: Weapon (weapon_flaregun) using undefined primary ammo type (Flare_Round)"
Ammo:
class CItem_Flare_Round : public CItem { public: DECLARE_CLASS( CItem_Flare_Round, CItem );
void Spawn( void ) { Precache( ); SetModel( "models/items/flare.mdl"); BaseClass::Spawn( ); } void Precache( void ) { PrecacheModel ("models/items/flare.mdl"); } bool MyTouch( CBasePlayer *pPlayer ) { if (ITEM_GiveAmmo( pPlayer, 1, "FlareRound")) { if ( g_pGameRules->ItemShouldRespawn( this ) == GR_ITEM_RESPAWN_NO ) { UTIL_Remove(this); } return true; } return false; } }; LINK_ENTITY_TO_CLASS(item_flare_round, CItem_Flare_Round);
Script file:
WeaponData { // Weapon data is loaded by both the Game and Client DLLs. "printname" "FLAREGUN" "viewmodel" "models/weapons/v_flaregun.mdl" "playermodel" "models/weapons/w_flaregun.mdl" "anim_prefix" "python" "bucket" "1" "bucket_position" "5"
"clip_size" "1" "default_clip" "6" "primary_ammo" "Flare_Round" "secondary_ammo" "None"
"weight" "7" "item_flags" "0"
"damage" "75"
// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds) SoundData { "empty" "Weapon_Pistol.Empty" "single_shot" "Weapon_Flaregun.Single" }
ausserdem wenn ich im hammer ne item_Ammo_flare_round erstell, sieht man nix :( (evtl sollte ich ne box erstellen)
Problem2: wie kann ich impulse 101 verändern? also dass ich auch die flaregun bekomm
Problem3: Headcrabs von Zombies entfernen: Ich hab in der npc_zombie.cpp
SetBodygroup( ZOMBIE_BODYGROUP_HEADCRAB, !m_fIsHeadless );
auskommentiert. Jetzt fehlt zwar das Headcrab Model, allerdings wenn der Zombie tot is fliegt ein totes headcrab trotzdem weg.
Wenn ich das hier auskommentier:
//----------------------------------------------------------------------------- // Purpose: Returns the classname (ie "npc_headcrab") to spawn when our headcrab bails. //----------------------------------------------------------------------------- const char *CZombie::GetHeadcrabClassname( void ) { return "npc_headcrab"; }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- const char *CZombie::GetHeadcrabModel( void ) { return "models/headcrabclassic.mdl"; }
bekomm ich nen fehler in der untils.h
so, danke fürs lesen, evtl kann mir jmd helfen :P
--
Dieser Beitrag wurde am 05.09.2005 um 20:32 von NxTwo bearbeitet.
|
|
Profil || Suche
|
001
05.09.2005, 20:55
GcDesign
|
zum Cheat Impulse:
In der Datei hl2mp_player.cpp gibts eine Funktion "CheatImpulseCommands". Die ruft bei einem "101er" Impuls die Funktion "GiveAllItems" auf. (Da kannst du dem Spieler ürbigens auch gleich Munition für die Waffe geben!)
und zum Headcrab Problem:
wie wär's wenn du die Funktionen einfach einen leeren string zurückgeben lässt?
--
|
|
Profil || Suche
|
002
05.09.2005, 21:10
NxTwo
|
funzt beides :D thx jetzt nur noch das mit dem ammo :P
--
|
|
Profil || Suche
|
003
05.09.2005, 21:28
theDon
|
if (ITEM_GiveAmmo( pPlayer, 1, "FlareRound")) vs.
"primary_ammo" "Flare_Round" ...
--
\o tanz den naziprau! o/
And more than ever, I hope to never fall, Where enough is not the same it was before
|
|
Profil || Suche
|
004
05.09.2005, 21:39
NxTwo
|
kommt trotzdem noch der Fehler
ERROR: Attempting to give unknown ammo type (Flare_Round) ERROR: Weapon (weapon_flaregun) using undefined primary ammo type (Flare_Round)
--
|
|
Profil || Suche
|
005
06.09.2005, 00:38
NxTwo
|
Also ich habs nun hinbekommen Allerdings gibt mir die box keine munition wenn meine knarre leer is...
--
|
|
Profil || Suche
|