Problem in Object System
#1

Hi all, I decided to make a new RP mode but I've problem in Object System (It means, users items are stored in account file.).

The ID 0 Player can use this system successfully, but other players can't.

Can you help me ? I ate out of my mind for days because of this issue.

It's just a example for using Object System:


pawn Код:
new getobj [ 256 ];
            new aid[32];
            format(aid, sizeof aid, "AID:%d", vInfo[vid][vCID]);
            GetPObject ( playerid, GetPObjectID ( playerid, "Tip:1", aid ), "AID", getobj );
            if ( strval ( getobj ) != vInfo [ vid ] [ vCID ] ) return MSG ( playerid, "U", "You haven't got key.!" );
            Emote ( playerid, "aracı зalıştırmayı dener.", 1 );
            SetTimerEx ( "StartEngine", 2500, false, "dd", playerid, vid );
It's Object System.

pawn Код:
stock GetPObject ( oid, objid, deger [ ], returndegeri [ ] )
{
    new satir [ 256 ];
    format ( satir, sizeof satir, "Objects/Object%d/%s", objid, deger );
    GetPVarString ( oid, satir, returndegeri, 256 );
    return true;
}

stock GetPObjectID ( oid, ... )
{
    if ( !IsPlayerConnected ( oid ) ) return -1;
    new satir [ 64 ], dongu;
    dongu = GetPVarInt ( oid, "Objects" ) + 1;
    for ( new i; i < dongu; i++ )
    {
        new onay = 0;
        for ( new a; a < numargs ( ); a++ )
        {
            if ( onay != -1 )
            {
                new arg [ 128 ];
                for ( new z; z < 128; z++ ) arg [ z ] = getarg ( a, z );
                if ( strlen ( arg ) )
                {
                    new deger [ 32 ], idx, deger2 [ MAX_STRING ];
                    format ( satir, sizeof satir, "Objects/Object%d/%s", i, strtok ( arg, idx, ':' ) );
                    GetPVarString ( oid, satir, deger, sizeof deger );
                    deger2 = strtok ( arg, idx, ':' );
                    if ( !strcmp ( deger, deger2, true ) && strlen ( deger ) == strlen ( deger2 ) ) onay++;
                    else onay = -1;
                    printf ( "%d  %d  %s  %s", i, onay, satir, deger );
                }
            }
        }
        if ( onay > 0 ) return i;
    }
    return -1;
}
Reply
#2

Anyone ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)