@@ -76,6 +76,7 @@ void CLuaPedDefs::LoadFunctions()
7676 {" setPedControlState" , SetPedControlState},
7777 {" setPedAnalogControlState" , SetPedAnalogControlState},
7878 {" setPedDoingGangDriveby" , SetPedDoingGangDriveby},
79+ {" setPedFightingStyle" , SetPedFightingStyle},
7980 {" setPedLookAt" , SetPedLookAt},
8081 {" setPedHeadless" , SetPedHeadless},
8182 {" setPedFrozen" , SetPedFrozen},
@@ -168,6 +169,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
168169 lua_classfunction (luaVM, " setOxygenLevel" , " setPedOxygenLevel" );
169170 lua_classfunction (luaVM, " setWeaponSlot" , " setPedWeaponSlot" );
170171 lua_classfunction (luaVM, " setDoingGangDriveby" , " setPedDoingGangDriveby" );
172+ lua_classfunction (luaVM, " setFightingStyle" , " setPedFightingStyle" );
171173 lua_classfunction (luaVM, " setHeadless" , " setPedHeadless" );
172174 lua_classfunction (luaVM, " setOnFire" , " setPedOnFire" );
173175 lua_classfunction (luaVM, " setTargetingMarkerEnabled" , " setPedTargetingMarkerEnabled" );
@@ -186,7 +188,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
186188 lua_classvariable (luaVM, " hasJetPack" , NULL , " doesPedHaveJetPack" );
187189 lua_classvariable (luaVM, " jetpack" , NULL , " isPedWearingJetpack" ); // introduced in 1.5.5-9.13846
188190 lua_classvariable (luaVM, " armor" , NULL , " getPedArmor" );
189- lua_classvariable (luaVM, " fightingStyle" , NULL , " getPedFightingStyle" );
191+ lua_classvariable (luaVM, " fightingStyle" , " setPedFightingStyle " , " getPedFightingStyle" );
190192 lua_classvariable (luaVM, " cameraRotation" , " setPedCameraRotation" , " getPedCameraRotation" );
191193 lua_classvariable (luaVM, " contactElement" , NULL , " getPedContactElement" );
192194 lua_classvariable (luaVM, " moveState" , NULL , " getPedMoveState" );
@@ -1700,6 +1702,21 @@ int CLuaPedDefs::SetPedDoingGangDriveby(lua_State* luaVM)
17001702 return 1 ;
17011703}
17021704
1705+ int CLuaPedDefs::SetPedFightingStyle (lua_State* luaVM)
1706+ {
1707+ CClientEntity* pEntity;
1708+ unsigned char ucStyle;
1709+ CScriptArgReader argStream (luaVM);
1710+ argStream.ReadUserData (pEntity);
1711+ argStream.ReadNumber (ucStyle);
1712+
1713+ if (argStream.HasErrors ())
1714+ return luaL_error (luaVM, argStream.GetFullErrorMessage ());
1715+
1716+ lua_pushboolean (luaVM, CStaticFunctionDefinitions::SetPedFightingStyle (*pEntity, ucStyle));
1717+ return 1 ;
1718+ }
1719+
17031720int CLuaPedDefs::SetPedLookAt (lua_State* luaVM)
17041721{
17051722 // Verify the argument
0 commit comments