@@ -1600,6 +1600,42 @@ cell AMX_NATIVE_CALL rg_instant_reload_weapons(AMX *amx, cell *params)
16001600 return TRUE ;
16011601}
16021602
1603+ /*
1604+ * Plant a bomb.
1605+ *
1606+ * @param index Owner index or 0 for worldspawn.
1607+ * @param origin The origin of the bomb where it will be planted.
1608+ * @param angles The angles of the planted bomb.
1609+ *
1610+ * @return Index of bomb entity or AMX_NULLENT (-1) otherwise
1611+ *
1612+ * native rg_plant_bomb(const index, Float:vecOrigin[3], Float:vecAngles[3] = {0.0,0.0,0.0});
1613+ */
1614+ cell AMX_NATIVE_CALL rg_plant_bomb (AMX *amx, cell *params)
1615+ {
1616+ enum args_e { arg_count, arg_index, arg_origin, arg_angles };
1617+ CAmxArgs args (amx, params);
1618+
1619+ entvars_t *pevOwner = nullptr ;
1620+
1621+ if (params[arg_index] != 0 )
1622+ {
1623+ CHECK_ISPLAYER (arg_index);
1624+
1625+ CBasePlayer *pPlayer = UTIL_PlayerByIndex (params[arg_index]);
1626+ CHECK_CONNECTED (pPlayer, arg_index);
1627+ pevOwner = pPlayer->pev ;
1628+ }
1629+
1630+ CGrenade *pBomb = g_ReGameFuncs->PlantBomb (pevOwner, args[arg_origin], args[arg_angles]);
1631+
1632+ // Sanity check anyway
1633+ if (pBomb)
1634+ return indexOfPDataAmx (pBomb);
1635+
1636+ return AMX_NULLENT ;
1637+ }
1638+
16031639/*
16041640* Sets the amount of reward in the game account for all players.
16051641*
@@ -2231,7 +2267,7 @@ cell AMX_NATIVE_CALL rg_initialize_player_counts(AMX *amx, cell *params)
22312267 cell& numAliveCT = *getAmxAddr (amx, params[arg_num_alive_ct]);
22322268 cell& numDeadTerrorist = *getAmxAddr (amx, params[arg_num_dead_terrorist]);
22332269 cell& numDeadCT = *getAmxAddr (amx, params[arg_num_dead_ct]);
2234-
2270+
22352271 CSGameRules ()->InitializePlayerCounts (numAliveTerrorist, numAliveCT, numDeadTerrorist, numDeadCT);
22362272 return TRUE ;
22372273}
@@ -2371,6 +2407,7 @@ AMX_NATIVE_INFO Misc_Natives_RG[] =
23712407
23722408 { " rg_transfer_c4" , rg_transfer_c4 },
23732409 { " rg_instant_reload_weapons" , rg_instant_reload_weapons },
2410+ { " rg_plant_bomb" , rg_plant_bomb },
23742411
23752412 { " rg_set_account_rules" , rg_set_account_rules },
23762413 { " rg_get_account_rules" , rg_get_account_rules },
0 commit comments