[Help] Bomb Odds
Hi,
First off, I'm a noob. so please. spare me. I asked for help through the suggestion section but I guess the one who replied didn't really have time so I was thinking of trying it out. I have a VERY LIMITED knowledge of AMXX coding. But I do know how to formulate logic on stuff but on another programming language. so, I'm basing my code on Defuse Mistake 1.4 code. The main purpose of it is "Plant Mistake" so basically, the bomb will detonate on a random chance when planted. I also tried to use [FAQ/Tutorial] CS Bomb Scripting as a reference. can someone please help me? P.S. +credits goes to the creator of Defue Mistake 1.4: RedShift187 Code:
#include <amxmodx> |
Re: [Help] Bomb Odds
register_event("BarTime", "planting_bomb", "be", "1=3")
BarTime is an event per player, so called on a specific player, here when a guy is planting the bomb. So, the player's index is passed directly in the callback, meaning : public planting_bomb() -> public planting_bomb( id ) Then you can remove get_loguser_index(). |
Re: [Help] Bomb Odds
Quote:
*posted the new code above. Code:
new pname[18]Code:
client_print(0,print_chat, "%s triggered the bomb to explode", pname)explode. I tried looking at the source code of Force C4 Explode but it seems that it used another method in which it manipulates the whole environment and kills everybody within range and I'm not sure how will I be able to reuse it. (sorry for the noobness) do you have any suggestion or comment on what I can do to fix it? thanks in advance |
Re: [Help] Bomb Odds
Just a note: pname should be 32, not 18.
|
Re: [Help] Bomb Odds
Quote:
by the way I think the problem about not being able to make it explode is because the code: Code:
public bomb_explosion()have the bomb be planted first. I tried rework it using RadiusDamage from the Engine module but It doesnt seem to work Code:
public planting_bomb(id) { |
Re: [Help] Bomb Odds
Use native cs_set_c4_explode_time(index, Float:value); where value is gametime() + yourtime. So basicly, if player fails on planting, set timer to +1.0 and it will explode :)
|
Re: [Help] Bomb Odds
Problem is that you are trying to find a planted bomb when bomber is planting, so you won't ever be able to find one as you come at the begining of the process.
Better to include <csx> and to use forward "bomb_planted" Usage : PHP Code:
PHP Code:
-> PHP Code:
Also, your bomb detection is not efficient enough considering some plugins may change the c4 model, better to check m_bIsC4 pdata for this : PHP Code:
If you want to stick with amxx 1.8.2 for now, you can find get_pdata_bool stock here : http://forums.alliedmods.net/showpos...01#post1712101 I'm not sure, but for some reason csx module could send bomb_planted forward before the bomb is completely planted, so if the code doesn't work, use a delayed 0.1s task from bomb_planted in order to be able to retrieve correctly c4 index. |
Re: [Help] Bomb Odds
sorry for not being able to reply to this thread after a long time. I have problems with my internet connection since I came here in China last Sunday. Anyway.
@Connor, Just as I have suspected. I will try your suggestion for finding bomb_planted sequence. and thanks for the new learning, I didnt know that C4's were considered as grenades in cstrike. I guess I have to find some sort of a resource list @GusKis, thanks I will also try that. I will give you guys a feedback once I have finished coding and testing it |
| All times are GMT -4. The time now is 18:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.