Added cmd "lastinv" and "drop".
This commit is contained in:
parent
051d07fbcf
commit
090461860e
11 changed files with 56 additions and 18 deletions
|
@ -33,17 +33,6 @@ Game_ConsoleCommand(void)
|
|||
case "radio3":
|
||||
Textmenu_Call("RADIOC");
|
||||
break;
|
||||
case "motd":
|
||||
/*VGUI_MessageOfTheDay();*/
|
||||
break;
|
||||
case "buy":
|
||||
/*if (getstatf(STAT_BUYZONE) == TRUE) {
|
||||
VGUI_BuyMenu();
|
||||
}*/
|
||||
break;
|
||||
case "chooseteam":
|
||||
/*VGUI_ChooseTeam();*/
|
||||
break;
|
||||
case "nightvision":
|
||||
/*Nightvision_Toggle();*/
|
||||
break;
|
||||
|
|
|
@ -30,6 +30,7 @@ struct
|
|||
int m_iVMBones;
|
||||
int m_iVMEjectBone;
|
||||
int m_iLastWeapon;
|
||||
int m_iOldWeapon;
|
||||
float m_flBobTime;
|
||||
float m_flBob;
|
||||
|
||||
|
|
|
@ -91,7 +91,11 @@ HUD_DrawWeaponSelect_Trigger(void)
|
|||
void
|
||||
HUD_DrawWeaponSelect_Last(void)
|
||||
{
|
||||
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
|
||||
pl.activeweapon = pSeat->m_iOldWeapon;
|
||||
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iOldWeapon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -97,7 +97,11 @@ HUD_DrawWeaponSelect_Trigger(void)
|
|||
void
|
||||
HUD_DrawWeaponSelect_Last(void)
|
||||
{
|
||||
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
|
||||
pl.activeweapon = pSeat->m_iOldWeapon;
|
||||
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iOldWeapon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -95,7 +95,11 @@ void HUD_DrawWeaponSelect_Trigger(void)
|
|||
|
||||
void HUD_DrawWeaponSelect_Last(void)
|
||||
{
|
||||
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
|
||||
pl.activeweapon = pSeat->m_iOldWeapon;
|
||||
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iOldWeapon);
|
||||
}
|
||||
}
|
||||
|
||||
void HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
||||
|
|
|
@ -28,6 +28,7 @@ struct
|
|||
int m_iVMBones;
|
||||
int m_iVMEjectBone;
|
||||
int m_iLastWeapon;
|
||||
int m_iOldWeapon;
|
||||
float m_flBobTime;
|
||||
float m_flBob;
|
||||
|
||||
|
|
|
@ -91,7 +91,11 @@ HUD_DrawWeaponSelect_Trigger(void)
|
|||
void
|
||||
HUD_DrawWeaponSelect_Last(void)
|
||||
{
|
||||
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
|
||||
pl.activeweapon = pSeat->m_iOldWeapon;
|
||||
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iOldWeapon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -23,6 +23,7 @@ View_UpdateWeapon(entity vm, entity mflash)
|
|||
if (pSeat->m_iLastWeapon == pl.activeweapon) {
|
||||
return;
|
||||
}
|
||||
pSeat->m_iOldWeapon = pSeat->m_iLastWeapon;
|
||||
pSeat->m_iLastWeapon = pl.activeweapon;
|
||||
|
||||
if (!pl.activeweapon) {
|
||||
|
|
|
@ -115,6 +115,10 @@ armoury_entity::touch(void)
|
|||
return;
|
||||
}
|
||||
|
||||
/* temp */
|
||||
if (m_iItem == 17 || m_iItem == 16)
|
||||
return;
|
||||
|
||||
if (Weapons_AddItem((player)other, m_iItem) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -71,13 +71,13 @@ w_usp45_updateammo(player pl)
|
|||
string
|
||||
w_usp45_wmodel(void)
|
||||
{
|
||||
return "models/w_usp45.mdl";
|
||||
return "models/w_usp.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_usp45_pmodel(void)
|
||||
{
|
||||
return "models/p_usp45.mdl";
|
||||
return "models/p_usp.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
|
|
|
@ -370,5 +370,31 @@ void Weapons_ReloadWeapon(player pl, .int mag, .int ammo, int max)
|
|||
pl.(mag) += iNeed;
|
||||
pl.(ammo) -= iNeed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSEv_DropWeapon(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
static void DropWeapon_Enable(void)
|
||||
{
|
||||
self.solid = SOLID_TRIGGER;
|
||||
}
|
||||
|
||||
if (!pl.activeweapon)
|
||||
return;
|
||||
|
||||
item_pickup drop = spawn(item_pickup);
|
||||
drop.setitem(pl.activeweapon);
|
||||
setorigin(drop, pl.origin);
|
||||
drop.solid = SOLID_NOT;
|
||||
drop.think = DropWeapon_Enable;
|
||||
drop.nextthink = time + 1.5f;
|
||||
drop.movetype = MOVETYPE_TOSS;
|
||||
|
||||
makevectors(pl.v_angle);
|
||||
drop.velocity = v_forward * 256;
|
||||
drop.avelocity[1] = 500;
|
||||
Weapons_RemoveItem(pl, pl.activeweapon);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue