mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
Add "give" client cheat command (e.g give weapon_ak47) like in csgo (#415)
* Add "give" client cheat command (e.g give weapon_ak47) like in csgo
This commit is contained in:
parent
a386ef41ea
commit
7607207d32
@ -3521,6 +3521,23 @@ void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *pa
|
|||||||
{
|
{
|
||||||
pPlayer->SmartRadio();
|
pPlayer->SmartRadio();
|
||||||
}
|
}
|
||||||
|
#ifdef REGAMEDLL_ADD
|
||||||
|
else if (FStrEq(pcmd, "give"))
|
||||||
|
{
|
||||||
|
if (CVAR_GET_FLOAT("sv_cheats") != 0.0f && CMD_ARGC() > 1 && FStrnEq(parg1, "weapon_", sizeof("weapon_") - 1))
|
||||||
|
{
|
||||||
|
const auto pInfo = GetWeaponInfo(parg1);
|
||||||
|
if (pInfo)
|
||||||
|
{
|
||||||
|
if (pInfo->id != WEAPON_GLOCK && pInfo->id != WEAPON_C4 /* && pInfo->id != WEAPON_KNIFE */)
|
||||||
|
{
|
||||||
|
pPlayer->GiveNamedItemEx(pInfo->entityName);
|
||||||
|
pPlayer->GiveAmmo(pInfo->maxRounds, pInfo->ammoName2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (HandleBuyAliasCommands(pPlayer, pcmd))
|
if (HandleBuyAliasCommands(pPlayer, pcmd))
|
||||||
|
Loading…
Reference in New Issue
Block a user