20.07.2016, 14:35
So i want to add a Kevlar Vest to Police Officers when they go on duty.And I let's say defined it :
Putted it when you delete player's stats :
And then the command comes :
So you go on duty and you get the Vest for a sec and it dissapears...Can any one help me?
Код:
new Kevlar[ MAX_PLAYERS ];
Код:
Kevlar[ playerid ] = 0;
Код:
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;
}

