14.10.2010, 14:06
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:
It's Object System.
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 );
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;
}