ok so i tried compiling a .dll but it didnt work it
pvp.dll 0x00000000 : error!
setup.cpp
Code:
#include "StdAfx.h"
#include "Setup.h"
#define SKIP_ALLOCATOR_SHARING 1
#include <ScriptSetup.h>
extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupToken1(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 SetupToken1(ScriptMgr * mgr);
#endif
pvp.cpp
Code:
#ifndef INSTANCE_SCRIPTS_SETUP_H
#define INSTANCE_SCRIPTS_SETUP_H
void SetupToken1(ScriptMgr * mgr);
#endif
pvp.VCProj
Code:
#include "StdAfx.h"
#include "Setup.h"
#define PVP_TOKEN 29434 //Put Your Token ID Here
void Token1(Player* plr, Player* victim)
{
if(plr->getLevel() >= 18 && victim->getLevel() >= 18 && plr->GetTeam() != victim->GetTeam())
{
char message[200];
sprintf(message, "|cff00ff00[World PvP]|r |cffff0000%s|cffffffff(%i)|r has killed %s|cffffffff(%i)|r...This Is MADNESS!|r", plr->GetName(),plr->getLevel(), victim->GetName(),victim->getLevel());
sWorld.SendWorldWideScreenText(message);
sLog.outColor(TRED,"n[WPVP]: WPVP Activated - the killer was %s...The victim was %s.", plr->GetName(), victim->GetName());
sLog.outColor(TNORMAL,"n");
int die;
die = + 1;
if((die == 1) || (die == 2))
{
plr->GetItemInterface()->SafeAddItem(PVP_TOKEN, INVENTORY_SLOT_NOT_SET, -1);
Item * it = objmgr.CreateItem(PVP_TOKEN, plr);
plr->GetItemInterface()->AddItemToFreeSlot(it);
sLog.outColor(TGREEN,"[WPVP]: A Token was added for this kill to %s", plr->GetName());
sLog.outColor(TNORMAL,"n");
}
else
{
sLog.outColor(TYELLOW,"[WPVP]: A Token was not added to %s", plr->GetName());
sLog.outColor(TNORMAL,"n");
}
}
}
void SetupToken1(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void*)Token1);
}
if anyone could help will +rep
thxx