.| Autor | Beitrag |
|---|---|
|
000 21.03.2001, 19:33 Robertos |
Hey Leutz ich habe mal ein paar Fragen ich hoffe ihr könnt sie mir beantworten. 1. Ich habe zwei Fehler wenn ich meine Client.dll compiliere. Ich hab probiert ein
nvg.cpp
Hier ist mein nvg.cpp: #include "hud.h"
DECLARE_MESSAGE(m_NVG, NVGActivate )
int CHudNVG::Init(void)
m_iNVG = 0;
m_iFlags = 0;
return 1;
int CHudNVG::VidInit(void)
// get the battery sprites
m_hBatteryFull = gHUD.GetSprite(HUD_battery_full);
m_iWidth = m_prcBatteryFull->right - m_prcBatteryFull->left; // calculate the y offset (using the flashlight sprite)
prcFL = &gHUD.GetSpriteRect( HUD_flashlight );
return 1;
return 1;
int CHudNVG::Draw(float fTime)
// updates the battery state, calculate colors
if (m_flBattery < 0)
a = MIN_ALPHA;
if (m_flBattery < 20)
ScaleColors(r, g, b, a); // calculate x/y offsets, empty width
offset = (m_flBattery * m_iWidth) / 100; // draw the empty part first...
rc = *m_prcBatteryEmpty;
// and then the full part
rc = *m_prcBatteryFull;
if (m_iOn)
SPR_Set(m_hFlicker, 10, 100, 10 ); {
SPR_Set(m_hFlicker, 10, 100, 10 ); // play at 15fps
w = SPR_Width(m_hFlicker,0);
return 1; int CHudNVG::MsgFunc_NVG(const char *pszName, int iSize, void *pbuf)
// update NVG data
if (m_iNVG)
m_iOn = 0; return 1;
int CHudNVG::MsgFunc_NVGActivate(const char *pszName, int iSize, void *pbuf)
// update NVG data
return 1;
|
|
Profil || Suche |
|
001 21.03.2001, 19:43 Prefect |
*gähn* der wird aber auch langsam alt... sorry Am Anfang der Datei util.h durch cl_util.h ersetzen. @TTT/Masterstroke: könnt ihr das in dem Tutorial nicht mal schnell ändern? cu,
Widelands - Gemütliche Aufbaustrategie, Free Software |
|
Profil || Suche |
|
002 21.03.2001, 23:03 apfelkorn |
@pref: das wird sich nie ändern... es muss doch irgendwas geben, an dem sich die fragen immer wieder aufhängen *g* -- |
|
Profil || Suche |
|
003 22.03.2001, 19:03 Prefect |
Stimmt auch wieder *g* cu,
Widelands - Gemütliche Aufbaustrategie, Free Software |
|
Profil || Suche |
|
004 30.05.2001, 14:46 Saugie |
muh also me hat auch ein prob damit (dies hier scheint älter zu sein da bei mir schon cl_ steht...) also hier meine fehler:
client.dll - 3 Fehler, 0 Warnung(en) der kram mit den Funktionsdefinitionen zeigt dann immer auf das { der letzten beiden funktionen und der andere fehlwer auf das } der letzten funktionen... was kann man an einer klammer flasch schrieben??? naja öhm also im tut stehts glaub ich genauso :-/ MfG Saugie -- |
|
Profil || Suche |
|
005 30.05.2001, 15:11 Archangel |
hmm, lokale funktionsdefininitionen sind unzulässig bedeutet meistens, das du eine '}' vergessen hast.. dann schließt eine funktion nämlich noch die nächste etc ein... -- |
|
Profil || Suche |
|
006 30.05.2001, 20:26 Saugie |
hab schon versucht die klammern wegzulassen und bis zu 3 mehr klammern gemacht und der code is genauso wie im tut.... :-/
int CHudNVG::MsgFunc_NVG(const char *pszName, int iSize, void *pbuf)
// update NVG data
if (m_iNVG)
m_iOn = 0; return 1;
int CHudNVG::MsgFunc_NVGActivate(const char *pszName, int iSize, void *pbuf)
// update NVG data
return 1;
|
|
Profil || Suche |
|
007 30.05.2001, 21:59 Killing Me Softly |
in der Funktion ÜBER CHudNVG::MsgFunc_NVG(...) fehlt eine Klammer, und zwar nach dem 'return 1;' --Der Horizont vieler Menschen ist ein Kreis mit Radius Null - und das nennen sie ihren Standpunkt. |
|
Profil || Suche |
|
008 30.05.2001, 22:58 Saugie |
so jez is da ne klammer abe rimmnoch ein fehler (und noch ne frage wie bist du dadrauf gekommen? is doch nur eine { und dafür 2 }??? :confused: ;)) --------------------Konfiguration: cl_dll - Win32 Debug--------------------
client.dll - 1 Fehler, 0 Warnung(en)
also jez is der untere fehler (fehler 2 :D) weg aber der erste bleibt... liegt das vielleicht daran das ichs aus ner html datei einfach kopiert hab? ;)
|
|
Profil || Suche |
|
009 01.06.2001, 19:32 -=)GhOsT(=- |
Ahoi ich hab auch ein sch.... fehler --------------------Configuration: hl - Win32 Release--------------------
hl.dll - 1 error(s), 0 warning(s) und hier der Code /***
===== items.cpp ======================================================== functions governing the selection/use of weapons for players */ #include "extdll.h"
extern int gmsgItemPickup; class CWorldItem : public CBaseEntity
LINK_ENTITY_TO_CLASS(world_items, CWorldItem); void CWorldItem::KeyValue(KeyValueData *pkvd)
void CWorldItem::Spawn( void )
switch (m_iType)
if (!pEntity)
REMOVE_ENTITY(edict());
void CItem::Spawn( void )
if (DROP_TO_FLOOR(ENT(pev)) == 0)
extern int gEvilImpulse101; void CItem::ItemTouch( CBaseEntity *pOther )
CBasePlayer *pPlayer = (CBasePlayer *)pOther; // ok, a player is touching this item, but can he have it?
if (MyTouch( pPlayer ))
CBaseEntity* CItem::Respawn( void )
UTIL_SetOrigin( pev, g_pGameRules->VecItemRespawnSpot( this ) );// blip to whereever you should respawn. SetThink ( Materialize );
void CItem::Materialize( void )
SetTouch( ItemTouch );
#define SF_SUIT_SHORTLOGON 0x0001 class CItemSuit : public CItem
if ( pev->spawnflags & SF_SUIT_SHORTLOGON )
pPlayer->pev->weapons |= (1<<WEAPON_SUIT);
LINK_ENTITY_TO_CLASS(item_suit, CItemSuit); class CItemBattery : public CItem
pPlayer->pev->armorvalue += gSkillData.batteryCapacity;
EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM ); MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev );
LINK_ENTITY_TO_CLASS(item_battery, CItemBattery); class CItemAntidote : public CItem
LINK_ENTITY_TO_CLASS(item_antidote, CItemAntidote); class CItemSecurity : public CItem
LINK_ENTITY_TO_CLASS(item_security, CItemSecurity); class CItemLongJump : public CItem
if ( ( pPlayer->pev->weapons & (1<<WEAPON_SUIT) ) )
g_engfuncs.pfnSetPhysicsKeyValue( pPlayer->edict(), "slj", "1" ); MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev );
// ... and tell them that we now have an NVG
EMIT_SOUND_SUIT( pPlayer->edict(), "!HEV_A1" ); // Play the longjump sound UNDONE: Kelly? correct sound?
LINK_ENTITY_TO_CLASS( item_longjump, CItemLongJump ); // advanced NVG
class CItemNVG : public CItem
if ( ( pPlayer->pev->weapons & (1<<WEAPON_SUIT) ) )
// make the client.dll print out the symbol on ammo history
// play a sound to tell the player he's picked up the NVG
LINK_ENTITY_TO_CLASS( item_nvg, CItemNVG );
thx im voraus -- |
|
Profil || Suche |
|
010 01.06.2001, 20:15 Archangel |
muss ich das verstehen? wieso wird denn in der CLongjump die NVGpickup msg gesendet? -- |
|
Profil || Suche |

