Raised This Month: $ Target: $400
 0% 

[SourceMod Extension] Looking for help with issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 01-11-2014 , 14:45   [SourceMod Extension] Looking for help with issues
Reply With Quote #1

Hi guys
I'm looking for some help with SourceMod extension
I've setup everything according to wiki but still most of stuff doesn't works or either is buggy
example:
PHP Code:
cell_t GetStuffXD(IPluginContext *pContext, const cell_t *params)
{
    
cell_t test GetInterfaceVersion()

Shows up error on GetInterfaceVersion() (GetInterfaceVersion is undefined)
Same with GetAdminFlag()
Including stuff doesn't works like it should
PHP Code:
#include <public/IAdminSystem.h> 
doesn't works but this
PHP Code:
#include <IAdminSystem.h> 
does

Help would be really helpful indeed

- Thanks

Edit:

The case might be fact that after editing enviormental settings in windows i didn't restarted it
But i ain't sure

Edit 2:


PHP Code:
#include "extension.h"
#include <IAdminSystem.h>
#include <ISourceMod.h>
/**
 * @file extension.cpp
 * @brief Implement extension code here.
 */

Sample g_Sample;        /**< Global singleton for extension's main interface */

SMEXT_LINK(&g_Sample);


cell_t AddSayChatHook(IPluginContext *pContext, const cell_t *params)
{
    
cell_t pluginid GetPluginId();

Same issue here
I don't understand

Edit 3:

And here
PHP Code:
    cell_t userid 5;
    
cell_t tom GetAdminImmunityLevel(userid); 
__________________
...

Last edited by Oshizu; 01-11-2014 at 15:32.
Oshizu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-15-2014 , 09:59   Re: [SourceMod Extension] Looking for help with issues
Reply With Quote #2

Have you looked into smsdk_config.h, specifically at the commented defines near the bottom? Specifically this one?
PHP Code:
//#define SMEXT_ENABLE_ADMINSYS 
which will give you a neat adminsys variable (which is a pointer to an IAdminSystem)

Incidentally, C++ is object oriented, which is why your functions are failing... you need to call those methods on an object. i.e.

PHP Code:
cell_t userid 5;
cell_t tom adminsys->GetAdminImmunityLevel(userid); 
Incidentally, that call is still wrong because GetAdminImmunityLevel takes an AdminId and returns an unsigned int... and it looks like you need an IGamePlayer object (from SMEXT_ENABLE_PLAYERHELPERS / IPlayerManager) to get a player's AdminId...

So, something like
PHP Code:
unsigned int immunity 0;
int client 5// or otherwise fetch it
IGamePlayer player playerhelpers->GetGamePlayer(client);
AdminId admin player->GetAdminId();
if (
admin != INVALID_ADMIN_ID)
{
    
immunity adminsys->GetAdminImmunityLevel(admin);

__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 01-15-2014 at 10:20.
Powerlord is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 01-15-2014 , 11:45   Re: [SourceMod Extension] Looking for help with issues
Reply With Quote #3

Thanks for help
__________________
...
Oshizu 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 05:40.


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