View Single Post
skulk_on_dope
Junior Member
Join Date: Jan 2007
Old 12-27-2007 , 20:00   Re: Empires, get player score
Reply With Quote #6

First of all, thx your my last hope ;)

Code:
    new maxplayers = GetMaxClients();
    new maxents = GetMaxEntities();
    new ent;
    
    new String:classname[64];
    
    for(new i = maxplayers; i <= maxents; i++)
    {
        if(IsValidEntity(i))
        {
            GetEntityNetClass(i, classname, sizeof(classname));
            if(StrEqual(classname, "CTFPlayerResource"))
            {
                ent = i;
                return;
            }
        }
    }
    
    new offset = FindSendPropOffs("CTFPlayerResource", "m_iScore")
    
    for(new i=1; i<=maxplayers; i++)
    {
        if(!IsClientInGame(i)) continue
        PrintToServer("%d: %d", i, GetEntData(ent, offset + (i*4), 4));
    }
^^ that isnt working how it should, it say's that I've got 34 but i dont have any so it should return 0....

Edit:
even when I use the right Classname (CPlayerResource) its not working.
There Ive got a very very high numer...

Edit2:
ups i'm a real fool...
gimme a sec

Last edited by skulk_on_dope; 12-27-2007 at 20:23.
skulk_on_dope is offline