Raised This Month: $ Target: $400
 0% 

Compiling Source Mod...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
InsidiousGnomes
Member
Join Date: Nov 2008
Old 11-30-2008 , 16:32   Re: Compiling Source Mod...
Reply With Quote #5

Thanks for your help and your quick reply.

To my knowledge there is no msvc9 folder on the latest version of sourcemod. I just checked the SVN server and it's not there. Is SVN the best way to get the most recent version? Also, I got the code that's causing the link errors from smn_player.cpp, and if it can link there I don't see why I shouldn't be able to link it. I could try to just call this native function from my extension code but 1) it's bad form, and 2) I would have to pull a an IPluginContext out of thin air.

Code:
static cell_t GetWeaponName(IPluginContext *pContext, const cell_t *params)
{
    int client = params[1];

    CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
    if (!pPlayer)
    {
        return pContext->ThrowNativeError("Client index %d is invalid", client);
    } else if (!pPlayer->IsInGame()) {
        return pContext->ThrowNativeError("Client %d is not in game", client);
    }

    IPlayerInfo *pInfo = pPlayer->GetPlayerInfo();
    if (!pInfo)
    {
        return pContext->ThrowNativeError("IPlayerInfo not supported by game");
    }

    const char *weapon = pInfo->GetWeaponName();
    pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), weapon ? weapon : "", NULL);

    return 1;
}
InsidiousGnomes is offline
 



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 18:26.


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