hi all, i am writing a metamod plugin and creating some native/raw functions that uses edict_t *pEdict.
How i can get if the player is bot??
PHP Code:
void cMisc::ClientPrintColor(edict_t *pEdict,const char *Format,...)
{
if(this->SayText == NULL)
{
SayText = GET_USER_MSG_ID(PLID,"SayText",NULL);
}
char Buffer[192] = {0};
va_list pArgs;
va_start(pArgs,Format);
vsprintf(&Buffer[0],Format,pArgs);
va_end(pArgs);
if(pEdict == NULL)
{
edict_t *pEntity = NULL;
for(int i = 1;i <= gpGlobals->maxClients;i++)
{
pEntity = INDEXENT(i);
if(FNullEnt(pEntity) || pEntity->free)
{
continue;
}
MESSAGE_BEGIN(MSG_ONE_UNRELIABLE,this->SayText,NULL,pEntity);
WRITE_BYTE(i);
WRITE_STRING(Buffer);
MESSAGE_END();
}
}
else
{
if(FNullEnt(pEdict) || pEdict->free)
{
return;
}
MESSAGE_BEGIN(MSG_ONE_UNRELIABLE,this->SayText,NULL,pEdict);
WRITE_BYTE(ENTINDEX(pEdict));
WRITE_STRING(Buffer);
MESSAGE_END();
}
}
Ps. Im not using amxx interface for plugin it is for metamod-p.
__________________