|
|
@ -173,7 +173,7 @@ struct checkpoint_s |
|
|
|
} g_checkpoints[4]; |
|
|
|
} g_checkpoints[4]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CoopClearData( void ) |
|
|
|
void UTIL_CoopClearData( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// nullify
|
|
|
|
// nullify
|
|
|
|
SavedCoords l_SavedCoords = {0}; |
|
|
|
SavedCoords l_SavedCoords = {0}; |
|
|
@ -182,7 +182,7 @@ void CoopClearData( void ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool g_fPause; |
|
|
|
bool g_fPause; |
|
|
|
void CoopApplyData( void ) |
|
|
|
void UTIL_CoopApplyData( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( s_SavedCoords.valid ) |
|
|
|
if( s_SavedCoords.valid ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -627,3 +627,62 @@ CBaseEntity *UTIL_CoopGetPlayerTrain( CBaseEntity *pPlayer) |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
return train; |
|
|
|
return train; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Collect all weapons tat player touchet in coop ant give to all players at spawn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CWeaponList g_WeaponList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CWeaponList::Clear() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_iWeapons = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void CWeaponList::GiveToPlayer(CBasePlayer *pPlayer) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for(int i = 0; i < m_iWeapons;i++) |
|
|
|
|
|
|
|
pPlayer->GiveNamedItem(weapons[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void CWeaponList::AddWeapon( const char *classname ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i; |
|
|
|
|
|
|
|
for(i = 0; i < m_iWeapons;i++) |
|
|
|
|
|
|
|
if(!strcmp(weapons[i], classname)) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
strcpy(weapons[m_iWeapons++], classname); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
extern int gmsgShowMenu; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UTIL_CoopShowMenu( CBasePlayer *pPlayer, const char *title, int count, const char **slot, signed char time ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if( pPlayer->m_fTouchMenu) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char buf[256]; |
|
|
|
|
|
|
|
#define MENU_STR(VAR) (#VAR) |
|
|
|
|
|
|
|
sprintf( buf, MENU_STR(slot10\ntouch_hide _coops*\ntouch_show _coops\ntouch_addbutton "_coopst" "#%s" "" 0.16 0.11 0.41 0.3 0 255 0 255 78 1.5\n), title); |
|
|
|
|
|
|
|
CLIENT_COMMAND( pPlayer->edict(), buf); |
|
|
|
|
|
|
|
for( int i = 0; i < count; i++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
sprintf( buf, MENU_STR(touch_settexture _coops%d "#%d. %s"\ntouch_show _coops%d\n), i+1, i+1, slot[i], i + 1 ); |
|
|
|
|
|
|
|
CLIENT_COMMAND( pPlayer->edict(), buf); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
char buf[128], *pbuf = buf; |
|
|
|
|
|
|
|
short int flags = 1<<9; |
|
|
|
|
|
|
|
pbuf += sprintf( pbuf, "^2%s:\n", title ); |
|
|
|
|
|
|
|
for( int i = 0; i < count; i++ ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
pbuf += sprintf( pbuf, "^3%d.^7 %s\n", i+1, slot[i]); |
|
|
|
|
|
|
|
flags |= 1<<i; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MESSAGE_BEGIN(MSG_ONE, gmsgShowMenu, NULL, pPlayer->pev); |
|
|
|
|
|
|
|
WRITE_SHORT( flags ); // slots
|
|
|
|
|
|
|
|
WRITE_CHAR( time ); // show time
|
|
|
|
|
|
|
|
WRITE_BYTE( 0 ); // need more
|
|
|
|
|
|
|
|
WRITE_STRING( buf ); |
|
|
|
|
|
|
|
MESSAGE_END(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//CLIENT_COMMAND( pPlayer->edict(), "exec touch_default/numbers.cfg\n");
|
|
|
|
|
|
|
|
} |
|
|
|