Raised This Month: $ Target: $400
 0% 

Solved Can I create new entity with property in Game Engine using AMXX


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
LiZou Mapper
Member
Join Date: Oct 2018
Location: The Red City !
Old 08-10-2020 , 21:38   Re: Problem with hamsandwich ham_use !
Reply With Quote #7

Like in client side :
PHP Code:
/* 
    ==== CONSOLE ENTITIES ====
    They do stuff in the console.
*/

#include "extdll.h"
#include "util.h"
#include "cbase.h"

class CTriggerConsolePrinter : public CBaseEntity
{
public:
    
void Spawn();
    
void KeyValue(KeyValueData *pkvd);

    
void Use(CBaseEntity *pActivatorCBaseEntity *pCallerUSE_TYPE useTypefloat value);

private:
    
string_t m_iszMessage;
};

LINK_ENTITY_TO_CLASS(trigger_conprintCTriggerConsolePrinter);

void CTriggerConsolePrinter::Spawn()
{
    
// Nothing
}

void CTriggerConsolePrinter::KeyValue(KeyValueData *pkvd)
{
    if (
FStrEq(pkvd->szKeyName"conmessage"))
    {
        
m_iszMessage ALLOC_STRING(pkvd->szValue);
        
pkvd->fHandled TRUE;
    }

    else
        
CBaseEntity::KeyValue(pkvd);
}

void CTriggerConsolePrinter::Use(CBaseEntity *pActivatorCBaseEntity *pCallerUSE_TYPE useTypefloat value)
{
    
ALERT(at_console"%s"STRING(m_iszMessage));

__________________

-------------
My Maps !
Zombie Escape Mod !
-------------

LiZou Mapper 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 13:51.


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