View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-11-2011 , 11:36   Re: VIP Objective Balance
Reply With Quote #10

Quote:
Originally Posted by MPNumB View Post
In my tests when using is_user_alive() only, I had some error when player was joining, therefor included is_user_connected() also.
Your test was wrong so.


PHP Code:
static cell AMX_NATIVE_CALL is_user_connected(AMX *amxcell *params/* 1 param */
{
    
int index params[1];
    
    if (
index || index gpGlobals->maxClients)
        return 
0;
    
    
CPlayerpPlayer GET_PLAYER_POINTER_I(index);
    
    return (
pPlayer->ingame 0);

PHP Code:
static cell AMX_NATIVE_CALL is_user_alive(AMX *amxcell *params/* 1 param */
{
    
int index params[1];
    
    if (
index || index gpGlobals->maxClients)
    {
        return 
0;
    }
    
    
CPlayerpPlayer GET_PLAYER_POINTER_I(index);

    if (
g_bmod_tfc)
    {
        
edict_t *pPlayer->pEdict;
        if (
e->v.flags FL_SPECTATOR || 
            (!
e->v.team || !e->v.playerclass))
        {
            return 
0;
        }
    }
    
    return ((
pPlayer->ingame && pPlayer->IsAlive()) ? 0);

pPlayer->ingame is used in both, thus is_user_alive is enough.
__________________
Arkshine is offline