Raised This Month: $51 Target: $400
 12% 

Compile Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-23-2013 , 04:37   Compile Error
Reply With Quote #1

Hi guys, i have an error when i try to compile my source, here the full code
Code:
//#include "CString.h"
#include "zombie_hunting.h"

int DispatchSpawn( edict_t * ) {	
	edict_t * pFog;	
	pFog = g_engfuncs.pfnCreateNamedEntity( g_engfuncs.pfnAllocString( "env_fog" ) );

	if( !FNullEnt( pFog ) ) {
		KeyValueData KVD;
		KVD.szClassName = "env_fog";
		KVD.szKeyName = "density";
		KVD.szValue = "0.0018";
		KVD.fHandled = 0;		
		MDLL_KeyValue( pFog, & KVD );

		KVD.szClassName = "env_fog";
		KVD.szKeyName = "rendercolor";
		KVD.szValue = "125 0 0";
		KVD.fHandled = 0;
		MDLL_KeyValue( pFog, & KVD );
	}

	RETURN_META_VALUE( MRES_IGNORED, 0 );
}

void ServerActivated_Post( edict_t *, int, int ) {
	CVAR_SET_STRING( "sv_skyname", "space" );

	RETURN_META( MRES_IGNORED );
}

static cell AMX_NATIVE_CALL get_zombie( AMX * pAmx, cell * pParamaters ) {
	CHECK_PLAYER( pParamaters[ 1 ] );

	return g_iPlayers[ pParamaters[ 1 ] ].bZombie;
};

static cell AMX_NATIVE_CALL set_zombie( AMX * pAmx, cell * pParamaters ) {
	CHECK_PLAYER( pParamaters[ 1 ] );

	g_iPlayers[ pParamaters[ 1 ] ].bZombie = pParamaters[ 2 ] ? true : false;

	return 1;
};

static cell AMX_NATIVE_CALL get_nemesis( AMX * pAmx, cell * pParamaters ) {
	return g_iPlayers[ pParamaters[ 1 ] ].bNemesis;
};

static cell AMX_NATIVE_CALL set_nemesis( AMX * pAmx, cell * pParamaters ) {
	CHECK_PLAYER( pParamaters[ 1 ] );

	g_iPlayers[ pParamaters[ 1 ] ].bNemesis = pParamaters[ 2 ] ? true : false;

	return 1;
};

static cell AMX_NATIVE_CALL get_survivor( AMX * pAmx, cell * pParamaters ) {
	CHECK_PLAYER( pParamaters[ 1 ] );

	return g_iPlayers[ pParamaters[ 1 ] ].bSurvivor;
};

static cell AMX_NATIVE_CALL set_survivor( AMX * pAmx, cell * pParamaters ) {
	CHECK_PLAYER( pParamaters[ 1 ] );

	g_iPlayers[ pParamaters[ 1 ] ].bSurvivor ? true : false;

	return 1;
};

AMX_NATIVE_INFO g_szNatives[ ] = {
	{ "get_zombie", get_zombie },
	{ "set_zombie", set_zombie },
	{ "get_nemesis", get_nemesis },
	{ "set_nemesis", set_nemesis },
	{ "get_survivor", get_survivor },
	{ "set_survivor", set_survivor },
	{ NULL, NULL }
};

void OnAmxxAttach( ) {
	MF_AddNatives(g_szNatives);
}

void OnPluginsLoaded( ) {
	g_iForwards.iClientInfected = MF_RegisterForward( "client_infected", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE );
	g_iForwards.iClientInfected_Post = MF_RegisterForward( "client_infected_post", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE );
	g_iForwards.iClientCured = MF_RegisterForward( "client_cured", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE );
	g_iForwards.iClientCured_Post = MF_RegisterForward( "client_cured_post", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE );
}

int InfectClient( int iVictim, int iAttacker ) {
	MF_ExecuteForward( g_iForwards.iClientInfected, iVictim, iAttacker );

	if( g_iPlayers[ iAttacker ].bNemesis ) {
		g_iPlayers[ iAttacker ].pEdict -> v.health = 200000.0;
		g_iPlayers[ iAttacker ].pEdict -> v.speed = 250.0;
		g_iPlayers[ iAttacker ].pEdict -> v.gravity = 0.5;
	} else {
	}

	MF_ExecuteForward( g_iForwards.iClientInfected_Post, iVictim, iAttacker );

	return 1;
}

int CureClient( int iVictim, int iAttacker ) {
	MF_ExecuteForward( g_iForwards.iClientCured, iVictim, iAttacker );

	if( g_iPlayers[ iAttacker ].bSurvivor ) {
		g_iPlayers[ iAttacker ].pEdict -> v.health = 2500.0;
		g_iPlayers[ iAttacker ].pEdict -> v.speed = 250.0;
		g_iPlayers[ iAttacker ].pEdict -> v.gravity = 1.0;
	} else {
	}

	MF_ExecuteForward( g_iForwards.iClientCured_Post, iVictim, iAttacker );

	return 1;
}

void UTIL_ClientColoredPrint( int iPlayer, const char * pszMessage ) {
	if (iPlayer)
		MESSAGE_BEGIN( MSG_ONE, GET_USER_MSG_ID( PLID, "SayText", NULL ), NULL, g_iPlayers[ iPlayer ].pEdict );
	else
		MESSAGE_BEGIN( MSG_BROADCAST, GET_USER_MSG_ID( PLID, "SayText", NULL) );
	WRITE_BYTE( gpGlobals -> maxClients + 1 );
	WRITE_STRING( pszMessage );
	MESSAGE_END( );
}
and the compiler say:
Code:
1>------ Build started: Project: zombie_hunting, Configuration: Release Win32 ------
1>  zombie_hunting.cpp
1>C:\Developement\HLSDK\multiplayer\engine\eiface.h(416): warning C4005: 'ARRAYSIZE' : macro redefinition
1>          C:\Program Files\Windows Kits\8.0\Include\um\winnt.h(1182) : see previous definition of 'ARRAYSIZE'
1>     Creating library .\Release/zombie_hunting.lib and object .\Release/zombie_hunting.exp
1>amxxmodule.obj : error LNK2001: unresolved external symbol "void __cdecl ServerActivate_Post(struct edict_s *,int,int)" (?ServerActivate_Post@@YAXPAUedict_s@@HH@Z)
1>C:\Users\ADMIN\Desktop\Zombie Hunting\msvc10\Release\zombie_hunting_amxx.dll : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Thank's in advance :p

Last edited by TheDS1337; 03-23-2013 at 04:39.
TheDS1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2013 , 04:58   Re: Compile Error
Reply With Quote #2

ServerActivate_Post not declared ; if you use the AMXX SDK, you have to uncomment the function in moduleconfig.h.
__________________
Arkshine is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-23-2013 , 07:46   Re: Compile Error
Reply With Quote #3

Already did :d
TheDS1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2013 , 07:48   Re: Compile Error
Reply With Quote #4

Don't know. You need to show more.
__________________
Arkshine is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-23-2013 , 07:51   Re: Compile Error
Reply With Quote #5

That's all i made ;)
TheDS1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2013 , 07:56   Re: Compile Error
Reply With Quote #6

Not what I'm talking about. You should attach the whole project so we can see what you missed.
__________________
Arkshine is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-23-2013 , 08:04   Re: Compile Error
Reply With Quote #7

Done
Thank's for fast reply ;)
Attached Files
File Type: zip Zombie Hunting.zip (46.4 KB, 95 views)
TheDS1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2013 , 08:20   Re: Compile Error
Reply With Quote #8

Typo.

ServerActivated_Post
->
ServerActivate_Post
__________________
Arkshine is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 03-23-2013 , 08:46   Re: Compile Error
Reply With Quote #9

aha ty ;)
TheDS1337 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode