No problems when:
Setting default model then changing to custom arms.
This doesn't work:
Setting default model then changing to custom arms then changing to custom model.
In this case the arms will overlap again.
nvm, you snippet works without overlapping
Important note:
You have to have a
game_player_equip with atleast one weapon eg.: weapon_knife to make it work.
That's why franc thought he fixed it, in some map this entity isn't implemented.
We have two options, whether to spawn the player a weapon and remove it or loop for game_player_equip and remove the ent and recreate it with a weapon.
And I'm not using a timer, I use 20 delayed frames.
Shout out to
KissLick's stock:
PHP Code:
stock RequestFrame2(RequestFrameCallback:func, framesAhead = 1, any:data = 0)
{
if (framesAhead < 1)
return;
if (framesAhead == 1) {
RequestFrame(func, data);
} else {
new Handle:pack = CreateDataPack();
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 7
WritePackFunction(pack, func);
#else
WritePackCell(pack, func);
#endif
WritePackCell(pack, framesAhead);
WritePackCell(pack, data);
RequestFrame(RequestFrame2_CallBack, pack);
}
}
public RequestFrame2_CallBack(any:pack)
{
ResetPack(Handle:pack);
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 7
new RequestFrameCallback:func = RequestFrameCallback:ReadPackFunction(Handle:pack);
#else
new RequestFrameCallback:func = RequestFrameCallback:ReadPackCell(Handle:pack);
#endif
new framesAhead = ReadPackCell(Handle:pack) - 1;
new data = ReadPackCell(Handle:pack);
CloseHandle(Handle:pack);
RequestFrame2(func, framesAhead, data);
}