|
Senior Member
Join Date: Nov 2015
Location: Russia
|
02-18-2018
, 12:07
Re: [CSGO] Cameras and Drones (v1.2.0, 23-07-2017)
|
#33
|
1)fix for weapon hud
Spoiler
PHP Code:
bool removedweapon[MAXPLAYERS + 1];
int zweapon[MAXPLAYERS + 1];
...
public void TpToCam(int client_index, int cam)
{
...
SetEntProp(client_index, Prop_Send, "m_iHideHUD", GetEntProp(client_index, Prop_Send, "m_iHideHUD") | HIDEHUD_WEAPONSELECTION);
if(!removedweapon[client_index])
{
removedweapon[client_index] = true;
zweapon[client_index] = GetEntPropEnt(client_index, Prop_Data, "m_hActiveWeapon");
if (IsValidEntity(zweapon[client_index]))
{
RemovePlayerItem(client_index, zweapon[client_index]);
zweapon[client_index] = EntIndexToEntRef(zweapon[client_index]);
}
else zweapon[client_index] = -1;
}
}
public void ExitCam(int client_index)
{
SetEntProp(client_index, Prop_Send, "m_iHideHUD", GetEntProp(client_index, Prop_Send, "m_iHideHUD") & ~HIDEHUD_WEAPONSELECTION);
removedweapon[client_index] = false;
if(zweapon[client_index] != -1)
{
int oldweap = EntRefToEntIndex(zweapon[client_index]);
if(oldweap > 0 && IsValidEntity(oldweap)) EquipPlayerWeapon(client_index, oldweap);
}
...
delete stock hidehudguns
2)if someone have menu invalid handle
Spoiler
delete
Menu playerCamMenus[MAXPLAYERS + 1];
PHP Code:
public void Menu_Cameras(int client_index, int args)
{
Menu playerCamMenus = new Menu(MenuHandler_Cameras);
playerCamMenus.SetTitle...
and so on
3)if someone have error fakePlayersListCamera = -1
Spoiler
PHP Code:
public void ExitCam(int client_index)
{
...
combine code:
if(fakePlayersListCamera[client_index] != -1)
{
char modelName[PLATFORM_MAX_PATH];
GetEntPropString(fakePlayersListCamera[client_index], Prop_Data, "m_ModelName", modelName, sizeof(modelName));
SetEntityModel(client_index, modelName); // Set back to original model
float pos[3], rot[3];
GetEntPropVector(fakePlayersListCamera[client_index], Prop_Send, "m_vecOrigin", pos);
GetEntPropVector(fakePlayersListCamera[client_index], Prop_Send, "m_angRotation", rot);
TeleportEntity(client_index, pos, rot, NULL_VECTOR);
RemoveEdict(fakePlayersListCamera[client_index]);
}
4)fix for spectators of the player:
Spoiler
remove Hook_SetTransmitPlayer
PHP Code:
public void TpToCam(int client_index, int cam)
{
...
// SDKHook(client_index, SDKHook_SetTransmit, Hook_SetTransmitPlayer);
SetEntityRenderMode(client_index, RENDER_NONE);
public void ExitCam(int client_index)
{
...
// SDKUnhook(client_index, SDKHook_SetTransmit, Hook_SetTransmitPlayer);
SetEntityRenderMode(client_index, RENDER_NORMAL);
I was using only camera, drone fix are similar
Last edited by Indarello; 04-12-2018 at 22:57.
|
|
|
|