#include <windows.h>
#include <string>
#include <assert.h>
#include "CSAMPFUNCS.h"
CSAMPFUNCS *SF = new CSAMPFUNCS();
void cmd_show_info_player( char *param )
{
int i = atoi( param );
char buf[128];
stRemotePlayer *pPlayer = SF->getSAMP()->getPlayers()->pRemotePlayer[ i ];
sprintf_s( buf, "Nickname - %s, Ping - %d, Score - %d, isNPC - %d, AFKState - %d",
pPlayer->szPlayerName,
pPlayer->iPing,
pPlayer->iScore,
pPlayer->iIsNPC,
pPlayer->pPlayerData->iAFKState );
SF->getSAMP()->getChat()->AddChatMessage( -1, buf );
}
void CALLBACK mainloop(void)
{
static bool init = false;
if(!init)
{
if(!SF->getSAMP()->IsInitialized()) return;
SF->getSAMP()->registerChatCommand("ubot",(CMDPROC) cmd_show_info_player);
init = true;
}
}
BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReasonForCall, LPVOID lpReserved )
{
switch ( dwReasonForCall )
{
case DLL_PROCESS_ATTACH:
SF->initPlugin( mainloop, hModule );
}
return true;
}