AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Godmode Problem (https://forums.alliedmods.net/showthread.php?t=188919)

MokeN 07-01-2012 17:13

Godmode Problem
 
Hello,

I got a problem with set_user_godmode function..

i got

PHP Code:

CS_TEAM_CT

bla bla bla
set_user_godmode
(id1

But this godmode function doesn't work with Ham_Touch_Grenade_Pre..
Why not?
Do i have to use Ham_TakeDamage_Pre?

Thanks

Liverwiz 07-01-2012 20:51

Re: Godmode Problem
 
show your code.
Those three lines mean nothing.

MokeN 07-02-2012 05:38

Re: Godmode Problem
 
Yeh, i mean

this godmode function (set_user_gomode)
PHP Code:

public SnowballGame()
{
    
g_iCurrentGame GAME_SNOWBALL
    
    
new iPlayers[32]
    new 
iNum
    
new id
 
    get_players
iPlayersiNum"a" )
 
    for( new 
0iNumi++ )
    {
        
id iPlayers[i]
       
        
set_hudmessage 2556464, -1.00.3500.15.00.10.1, -
        
show_hudmessage 0"[SG]: Snowball Game Started!")
       
        
strip_user_weaponsid )
       
        if (
cs_get_user_team(id) == CS_TEAM_CT)
        {
    
give_item(id"weapon_knife")
    
set_user_godmode(id1)
       
      } else if (
cs_get_user_team(id) == CS_TEAM_T)
        {
            
give_item(id"weapon_hegrenade")
            
cs_set_user_bpammoidCSW_HEGRENADE200 )
        }
       
    }


doesn't work with this

PHP Code:

public Ham_Touch_Grenade_PreiEntityid )
{
        if(
g_iCurrentGame != GAME_DGBALL && g_iCurrentGame != GAME_SNOWBALL && g_iCurrentGame != GAME_ANGRYBIRDS && g_iCurrentGame != GAME_ZMBOMBS) return HAM_IGNORED 
       
        
if(is_user_alive(id)) ExecuteHamB(Ham_Killedid,pev(iEntity,pev_owner), 0);
       
        
remove_entity(iEntity)
       
        return 
HAM_IGNORED



<VeCo> 07-02-2012 05:54

Re: Godmode Problem
 
PHP Code:

if(is_user_alive(id)) ExecuteHamB(Ham_Killedid,pev(iEntity,pev_owner), 0); 

Try to make it:

PHP Code:

if(is_user_alive(id))
{
set_user_godmode(id)
ExecuteHamB(Ham_Killedid,pev(iEntity,pev_owner), 0);



MokeN 07-02-2012 05:56

Re: Godmode Problem
 
thanks :D

ConnorMcLeod 07-02-2012 06:04

Re: Godmode Problem
 
On touch, instead of Ham_Killed, send Ham_TakeDamage.

MokeN 07-02-2012 10:01

Re: Godmode Problem
 
But it bugs alot with this ham take damage function, in round start they got godmode but when u start a game they don't got it anymore..

PHP Code:

public Ham_TakeDamage_PrevictiminflictorattackerFloat:damagedmgbits )
{
    if(
g_iCurrentGame == GAME_HIDE || g_iCurrentGame == GAME_MUSIC) return HAM_IGNORED
    
    
return (cs_get_user_team(victim) == CS_TEAM_CT) ? HAM_SUPERCEDE HAM_IGNORED


Quote:

Originally Posted by ConnorMcLeod (Post 1741036)
On touch, instead of Ham_Killed, send Ham_TakeDamage.

EDIT: Now i get alot of errors/warnings in the logs;

Code:

L 07/02/2012 - 16:13:01: [AMXX] Run time error 10 (plugin "gamemenu.amxx") (native "ExecuteHamB") - debug not enabled!
L 07/02/2012 - 16:13:01: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 07/02/2012 - 16:13:02: [HAMSANDWICH] Bad arg count.  Expected 6, got 4.



All times are GMT -4. The time now is 15:23.

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