Add CS_UpdateClientModel native to cstrike extension (bug 5905, r=psychonic).
This commit is contained in:
parent
427e93c573
commit
75ce4c395a
extensions/cstrike
gamedata/sm-cstrike.games
plugins/include
@ -787,6 +787,25 @@ static cell_t CS_GetClientAssists(IPluginContext *pContext, const cell_t *params
|
||||
#endif
|
||||
}
|
||||
|
||||
static cell_t CS_UpdateClientModel(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static ICallWrapper *pWrapper = NULL;
|
||||
if (!pWrapper)
|
||||
{
|
||||
REGISTER_NATIVE_ADDR("SetModelFromClass",
|
||||
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, NULL, 0));
|
||||
}
|
||||
|
||||
CBaseEntity *pEntity;
|
||||
if (!(pEntity=GetCBaseEntity(params[1], true)))
|
||||
{
|
||||
return pContext->ThrowNativeError("Client index %d is not valid", params[1]);
|
||||
}
|
||||
|
||||
pWrapper->Execute(&pEntity, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
sp_nativeinfo_t g_CSNatives[] =
|
||||
{
|
||||
{"CS_RespawnPlayer", CS_RespawnPlayer},
|
||||
@ -807,6 +826,7 @@ sp_nativeinfo_t g_CSNatives[] =
|
||||
{"CS_SetClientContributionScore", CS_SetClientContributionScore},
|
||||
{"CS_GetClientAssists", CS_GetClientAssists},
|
||||
{"CS_SetClientAssists", CS_SetClientAssists},
|
||||
{"CS_UpdateClientModel", CS_UpdateClientModel},
|
||||
{"CS_IsValidWeaponID", CS_IsValidWeaponID},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -138,6 +138,13 @@
|
||||
"linux" "@_ZNK16FileWeaponInfo_t15GetAttributeIntEPKcPK13CEconItemView"
|
||||
"mac" "@_ZNK16FileWeaponInfo_t15GetAttributeIntEPKcPK13CEconItemView"
|
||||
}
|
||||
"SetModelFromClass"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x51\x53\x56\x8B\xF1\x57\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x8B\xD8"
|
||||
"linux" "@_ZN9CCSPlayer17SetModelFromClassEv"
|
||||
"mac" "@_ZN9CCSPlayer17SetModelFromClassEv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,6 +138,13 @@
|
||||
"linux" "@_ZN12CCSGameRules13CheckWinLimitEv"
|
||||
"mac" "@_ZN12CCSGameRules5ThinkEv"
|
||||
}
|
||||
"SetModelFromClass"
|
||||
{
|
||||
"library" "server"
|
||||
"windows" "\x55\x8B\xEC\x83\xEC\x2C\x89\x4D\xD4\x8B\x4D\xD4\xE8\x2A\x2A\x2A\x2A\x83\xF8\x02\x0F\x85\x2A\x2A\x2A\x2A\x8B"
|
||||
"linux" "@_ZN9CCSPlayer17SetModelFromClassEv"
|
||||
"mac" "@_ZN9CCSPlayer17SetModelFromClassEv"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,6 +367,15 @@ native CS_WeaponIDToAlias(CSWeaponID:weaponID, String:destination[], len);
|
||||
*/
|
||||
native bool:CS_IsValidWeaponID(CSWeaponID:id);
|
||||
|
||||
/**
|
||||
* Sets a player's model based on their current class
|
||||
*
|
||||
* @param client Player's index.
|
||||
* @noreturn
|
||||
* @error Invalid client index, client not in game.
|
||||
*/
|
||||
native CS_UpdateClientModel(client);
|
||||
|
||||
/**
|
||||
* Do not edit below this line!
|
||||
*/
|
||||
@ -404,6 +413,7 @@ public __ext_cstrike_SetNTVOptional()
|
||||
MarkNativeAsOptional("CS_AliasToWeaponID");
|
||||
MarkNativeAsOptional("CS_WeaponIDToAlias");
|
||||
MarkNativeAsOptional("CS_IsValidWeaponID");
|
||||
MarkNativeAsOptional("CS_UpdateClientModel");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user