AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Make this only for HE (https://forums.alliedmods.net/showthread.php?t=237323)

proffs 03-22-2014 11:04

Make this only for HE
 
I have this code which is for all the nades:

PHP Code:

register_think("grenade""GrenadeThink"

PHP Code:

public GrenadeThink(iEnt
{
    if(
GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS)
        return 
PLUGIN_HANDLED
        
    
return PLUGIN_CONTINUE


I want it only be for HE nade like my old code:

PHP Code:

public think_grenadeent 
{    
    if( 
GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS 
    { 
        new 
model[32];
        
entity_get_string(entEV_SZ_modelmodel31)
        
        if(
equali(model,"models/w_dodgeball.mdl")) 
        {
            return 
PLUGIN_CONTINUE
            
        
}
            
        
// stop grenade from blowing up
        
return PLUGIN_HANDLED
        
    
}
    
    return 
PLUGIN_CONTINUE;



Black Rose 03-22-2014 15:22

Re: Make this only for HE
 
Ctrl+C & Ctrl+V seems to solve it.
I don't understand at all.
Could you explain what you want help with?

proffs 03-22-2014 15:31

Re: Make this only for HE
 
Quote:

Originally Posted by Black Rose (Post 2114613)
Ctrl+C & Ctrl+V seems to solve it.
I don't understand at all.
Could you explain what you want help with?

The first code is a bit optimized. and the second one is rubbish.

Black Rose 03-22-2014 15:36

Re: Make this only for HE
 
Code:
if(GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS && entity_get_int(iEnt, EV_INT_modelindex) == 216)
?

215: Flashbang
216: HE
228: Smoke

proffs 03-22-2014 15:45

Re: Make this only for HE
 
Quote:

Originally Posted by Black Rose (Post 2114619)
Code:
if(GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS && entity_get_int(iEnt, EV_INT_modelindex) == 216)
?

215: Flashbang
216: HE
228: Smoke


So this is right?

PHP Code:

public GrenadeThink(iEnt)  

    if(
GAME_DGBALL <= g_iCurrentGame <= GAME_ZMBOMBS && entity_get_int(iEntEV_INT_modelindex) == 216)
        return 
PLUGIN_HANDLED 
         
    
return PLUGIN_CONTINUE 


EDIT: sometimes it blows the HE doesn't work properly

Black Rose 03-22-2014 17:11

Re: Make this only for HE
 
Add this line before everything else
Code:
server_print("%d <= %d <= %d && %d == 216", GAME_DGBALL, g_iCurrentGame, GAME_ZMBOMBS, entity_get_int(iEnt, EV_INT_modelindex));
When it doesn't work, copy the text from server console and print it here.

proffs 03-22-2014 17:48

Re: Make this only for HE
 
Quote:

Originally Posted by Black Rose (Post 2114661)
Add this line before everything else
Code:
server_print("%d <= %d <= %d && %d == 216", GAME_DGBALL, g_iCurrentGame <= GAME_ZMBOMBS, entity_get_int(iEnt, EV_INT_modelindex));
When it doesn't work, copy the text from server console and print it here.

Code:

03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")


Black Rose 03-22-2014 18:18

Re: Make this only for HE
 
Quote:

Originally Posted by proffs (Post 2114674)
Code:

03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:26: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:26: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:26: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:26: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")
L 03/22/2014 - 21:47:27: [AMXX] Run time error 25: parameter error
L 03/22/2014 - 21:47:27: [AMXX]    [0] now.sma::GrenadeThink (line 651)
L 03/22/2014 - 21:47:27: String formatted incorrectly - parameter 5 (total 4)
L 03/22/2014 - 21:47:27: [AMXX] Displaying debug trace (plugin "now.amxx")


Sorry, fixed that format error.


All times are GMT -4. The time now is 06:04.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.