[Ascent] [Help] Compiling problems
OK this is what i done :
I downloaded the Visual C++ 2008 Express Edition
I found this scripts on other forums
Announce.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
#ifdef WIN32
#pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
#endif
void PvPAnnounce (Player* killer, Player* victim)
{
if(killer->getLevel() <= victim->getLevel() + 5 || killer->getLevel() >= victim->getLevel() - 5)
{
char killstro[200];
sprintf(killstro, "%s Has Killed %s With Honor! Thats the spirit!", killer->GetName(), victim->GetName());
sWorld.SendWorldWideScreenText(killstro);
}
else
{
if(killer->getLevel() <= victim ->getLevel() + 5 || killer->getLevel() >= victim->getLevel() - 20)
{
char killstro[200];
sprintf(killstro, "%s Has Ganked %s, try picking on someone your own level!", killer->GetName(), victim->GetName());
sWorld.SendWorldWideScreenText(killstro); }
else
{
char killstro[200];
sprintf(killstro, "%s Has Ganked a lowbie %s, they will now Suffer", killer->GetName(), victim->GetName());
sWorld.SendWorldWideScreenText(killstro);
killer->SetHealthPct(15);
}
}
}
void Setupannounce(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, PvPAnnounce);
}
Setup.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
extern "C" SCRIPT_DECL uint32 _exp_get_version()
{
return MAKE_SCRIPT_VERSION(SCRIPTLIB_VERSION_MAJOR, SCRIPTLIB_VERSION_MINOR);
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
Setupannounce(mgr);
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Setup.h
Code:
#ifndef INSTANCE_SCRIPTS_SETUP_H
#define INSTANCE_SCRIPTS_SETUP_H
void Setupannounce(ScriptMgr * mgr);
#endif
I opened Visual C++ 2008 Express Edition and make a new project , selected Win32 Console Application , I give it name "Announce" and at the Location I selected a new folder from the desktop , and at Solution I selected Create new Solution . At the Application Settings I selected DLL and click Finish.
Now at the Announce.cpp I copy & paste the script from Announce.cpp. After that I click on the Add New Item , selected Header File (.h) and name it Setup .After i created these Setup.h I copy&paste the script from Setup.h .
I click Build >> Build solution and after that i get these errors :
Code:
------ Build started: Project: Announce, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
Compiling...
Announce.cpp
c:\documents and settings\kalandi\desktop\testannounce\announce\announce\setup.h(4) : error C2065: 'ScriptMgr' : undeclared identifier
c:\documents and settings\kalandi\desktop\testannounce\announce\announce\setup.h(4) : error C2065: 'mgr' : undeclared identifier
c:\documents and settings\kalandi\desktop\testannounce\announce\announce\setup.h(4) : error C2182: 'Setupannounce' : illegal use of type 'void'
c:\documents and settings\kalandi\desktop\testannounce\announce\announce\setup.h(4) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Build log was saved at "file://c:\Documents and Settings\kalandi\Desktop\TestAnnounce\Announce\Announce\Debug\BuildLog.htm"
Announce - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What i did wrong ? :confused::confused::confused: