Newmenus: Add necessary API changes for newmenu timeouts

This commit is contained in:
Valentin Grünbacher
2014-05-21 19:17:04 +02:00
parent c8b7a09028
commit 3b87c428dc
3 changed files with 20 additions and 6 deletions

View File

@ -825,8 +825,14 @@ static cell AMX_NATIVE_CALL menu_display(AMX *amx, cell *params)
}
}
// This will set the expire time of the menu to infinite
pPlayer->menuexpire = INFINITE;
int time = -1;
if (params[0] / sizeof(cell) >= 4)
time = params[4];
if (time < 0)
pPlayer->menuexpire = INFINITE;
else
pPlayer->menuexpire = gpGlobals->time + static_cast<float>(time);
return pMenu->Display(player, page);
}