Raised This Month: $32 Target: $400
 8% 

GameME HUD Rank


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 02-21-2020 , 16:00   GameME HUD Rank
Reply With Quote #1

Hello,

I'm trying to make this tap into gameME api to get a players rank / position and display it in a HUD. It has a tag mismatch. Also the HUD isn't displaying at all.

Maybe I'm taking the wrong approach or doing this totally wrong. I spent so much time editing this, can anyone help me finish it?

Thanks in advance.

Compiled warning:

PHP Code:
// C:\Program Files (x86)\Steam\steamapps\common\Half-Life\cstrike\addons\amxmodx\scripting\test32.sma(28) : warning 213: tag mismatch
// Header size:            460 bytes
// Code size:              756 bytes
// Data size:              712 bytes
// Stack/heap size:      16384 bytes
// Total requirements:   18312 bytes
//
// 1 Warning.
// Done.
//
// Compilation Time: 0.36 sec
// ---------------------------------------- 
My would be Frankenstein plugin.

PHP Code:
#include <amxmodx>
#include <gameme>
#include <csx>

#define QUERY_TYPE_ONCLIENTPUTINSERVER    1

const Float:REFRESH_RATE 1.0;

public 
plugin_init( )
{
    
register_plugin"GameME HUD Rank""0.1""no0ne" );
    
    
set_taskREFRESH_RATE"QuerygameMEStatsCallback", .flags "b" );
}

public 
cmdginfo(id) { 
    
// We call the native to get a response from gameme 
    
QueryGameMEStats("playerinfo"id"QuerygameMEStatsCallback"QUERY_TYPE_ONCLIENTPUTINSERVER); 
    return 
PLUGIN_HANDLED;
}    

public 
QuerygameMEStatsCallback(commandpayloadclient, &DataPack:datapack
{
    
    { 
    
ResetPack(datapack
    new 
iRank ReadPackCell(datapack
    
SetPackPosition(datapack18)
    
    new 
iSkill ReadPackCell(datapack); 

    
DestroyDataPack(datapack
        
    
set_hudmessage02550, -0.01, -0.2, .holdtime = ( REFRESH_RATE 0.2 ), .fadeintime 0.1, .fadeouttime 0.1, .channel );
    
show_hudmessageiRank"Rank: %d / %d""QuerygameMEStatsCallback: command -> %i, payload -> %i, client -> %N"commandpayloadclientiRankiSkill );
    }

INC file for gameME api / gameme.inc:

PHP Code:
#if defined _gameme_included_
    #endinput
#endif
#define _gameme_included_

// raw message handling
#define RAW_MESSAGE_RANK                1
#define RAW_MESSAGE_PLACE                2
#define RAW_MESSAGE_KDEATH                3
#define RAW_MESSAGE_SESSION_DATA        4
#define RAW_MESSAGE_TOP10                5
#define RAW_MESSAGE_NEXT                6

// callbacks
#define RAW_MESSAGE_CALLBACK_PLAYER        101
#define RAW_MESSAGE_CALLBACK_TOP10        102
#define RAW_MESSAGE_CALLBACK_NEXT        103

// internal usage
#define RAW_MESSAGE_CALLBACK_INT_CLOSE        1000
#define RAW_MESSAGE_CALLBACK_INT_SPECTATOR    1001

forward onGameMEStatsRank(commandclientmessage_prefix[], &DataPack:datapack);
forward onGameMEStatsPublicCommand(commandclientmessage_prefix[], &DataPack:datapack);
forward onGameMEStatsTop10(commandclientmessage_prefix[], &DataPack:datapack);
forward onGameMEStatsNext(commandclientmessage_prefix[], &DataPack:datapack);

/**
 * Query gameME Stats data from a client
 * 
 * @param request        Request type (only 'playerinfo' available)
 * @param client        Client index.
 * @param func        Callback function.
 * @param payload        Payload to distinct queries.
 * @noreturn
 */
native QueryGameMEStats(request[], clientfunc[], payload 0);

/**
 * Query Top10 players from gameME Stats
 * 
 * @param request        Request type (currently only 'top10' available)
 * @param client        Client index.
 * @param func        Callback function.
 * @param payload        Payload to distinct queries.
 * @noreturn
 */
native QueryGameMEStatsTop10(request[], clientfunc[], payload 0);

/**
 * Query next players from gameME Stats for s specified client
 * 
 * @param request        Request type (currently only 'next' available)
 * @param client        Client index.
 * @param func        Callback function.
 * @param payload        Payload to distinct queries.
 * @noreturn
 */
native QueryGameMEStatsNext(request[], clientfunc[], payload 0);

/**
 * Query internal (preformatted) gameME Stats data
 * 
 * @param request        Request type.
 * @param client        Client index.
 * @param func        Callback function.
 * @param payload        Payload to distinct queries.
 * @noreturn
 */
native QueryIntGameMEStats(request[], clientfunc[], payload 0limit 0); 

Last edited by iclassdon; 02-28-2020 at 00:09.
iclassdon is offline
Send a message via MSN to iclassdon
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 02:21.


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