Problem with SetPlayerAttachedObject
#1

So i want to add a Kevlar Vest to Police Officers when they go on duty.And I let's say defined it :
Код:
 new Kevlar[ MAX_PLAYERS ];
Putted it when you delete player's stats :
Код:
 Kevlar[ playerid ] = 0;
And then the command comes :
Код:
CMD:duty( playerid, params[] ) {
	new id = PlayerInfo[ playerid ][ xClan ];
	if( GetFactionType( playerid )  != ORG_TIP_PD ) return SendErrorMessage( playerid, "Niste u mogucnosti koristiti ovu komandu" );
	if( !IsPlayerInRangeOfPoint( playerid, 3.0, OI[ id ][ oDutyPoint ][ 0 ], OI[ id ][ oDutyPoint ][ 1 ], OI[ id ][ oDutyPoint ][ 2 ] ) ) return SendErrorMessage( playerid, "Morate biti na pickupu za koriscenje ove komande." );
    if( PlayerInfo[ playerid ][ xRank ] == 0 ) return SendErrorMessage( playerid, "Suspendovani ste." );
	if( PoliceDuty[ playerid ] == false ) {
		PoliceDuty[ playerid ] = true;
		format( globalstring, sizeof( globalstring ), "HQ: %s je sada na duznosti.", ImeIgraca( playerid ) );
		OrgPoruka( id, 0x2641FEAA, globalstring );
		format( globalstring, sizeof( globalstring ), "* %s %s uzima znacku i opremu iz ormarica.", getOrgRank( playerid, PlayerInfo[ playerid ][ xClan ] ), ImeIgraca( playerid ) );
		PorukaRadius( 10.0, playerid, globalstring, LJUBICASTA );
		SetPlayerColor( playerid, 0x2641FE00 );
        SetPlayerAttachedObject(playerid, 3, 19515, 1, 0.074000, 0.038999, 0.07000, 0.000000, 0.000000, 0.000000, 1.000000, 1.117000, 0.085000, 0x000000FF, 0x000000FF);
	}
	else if( PoliceDuty[ playerid ] == true ) {
	    PoliceDuty[ playerid ] = false;
		ResetAllWeapons( playerid );
		Dimi_SetPlayerArmour( playerid, 0 );
		BrojLisica[ playerid ] = 0;
		Dimi_SetPlayerArmour( playerid, 0 );
		Dimi_SetPlayerHealth( playerid, 75 );
		SetPlayerSkin( playerid, PlayerInfo[ playerid ][ xSkin ] );
		format( globalstring, sizeof( globalstring ), "* %s vraca znacku i opremu u ormaric.", ImeIgraca( playerid ) );
		PorukaRadius( 10.0, playerid, globalstring, LJUBICASTA );
		SetPlayerColor( playerid, 0xFFFFFF00 );
	}
	return true;
}
So you go on duty and you get the Vest for a sec and it dissapears...Can any one help me?
Reply
#2

I had this problem, when I removed the colors it fixed... so try that instead
PHP код:
SetPlayerAttachedObject(playerid31951510.0740000.0389990.070000.0000000.0000000.0000001.0000001.1170000.085000); 
Reply
#3

It works! Tnx <3
Reply
#4

Quote:

materialcolor1 (optional) The first object color to set, as an integer or hex in ARGB color format.
materialcolor2 (optional) The second object color to set, as an integer or hex in ARGB color format

Your using the wrong format

Something like: FF1E1E would work..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)