AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   laser mines (https://forums.alliedmods.net/showthread.php?t=205996)

teamer1 01-17-2013 09:50

laser mines
 
Please help fix

Code:

L 01/17/2013 - 02:38:07: [CSTRIKE] Invalid player 4
L 01/17/2013 - 02:38:07: [AMXX] Run time error 10 (plugin "lasermine.amxx") (native "cs_get_user_money") - debug not enabled!
L 01/17/2013 - 02:38:07: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 01/17/2013 - 10:59:04: [CSTRIKE] Invalid player 6
L 01/17/2013 - 10:59:04: [AMXX] Run time error 10 (plugin "lasermine.amxx") (native "cs_get_user_money") - debug not enabled!
L 01/17/2013 - 10:59:04: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 01/17/2013 - 12:19:46: [CSTRIKE] Invalid player 6
L 01/17/2013 - 12:19:46: [AMXX] Run time error 10 (plugin "lasermine.amxx") (native "cs_get_user_money") - debug not enabled!
L 01/17/2013 - 12:19:46: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 01/17/2013 - 15:37:58: [CSTRIKE] Invalid player 2
L 01/17/2013 - 15:37:58: [AMXX] Run time error 10 (plugin "lasermine.amxx") (native "cs_get_user_money") - debug not enabled!
L 01/17/2013 - 15:37:58: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).


Neeeeeeeeeel.- 01-17-2013 09:57

Re: laser mines
 
First of all run de plugin on debug mode.

Put "debug" after plugin's name.

Then show your lasermine's code. I think you forgot to use is_user_connected.

teamer1 01-17-2013 10:13

Re: laser mines
 
1 Attachment(s)
I'm sorry
Here's the source code.
Fix please, and throw off the corrected

ANTICHRISTUS 01-17-2013 12:55

Re: laser mines
 
please post the output of the following commands:
  • rcon version.
  • rcon meta list.

AngeIII 01-17-2013 14:01

Re: laser mines
 
Quote:

Originally Posted by ANTICHRISTUS (Post 1875101)
please post the output of the following commands:
  • rcon version.
  • rcon meta list.

for what this is needed? problem is in plugin, cause plugin doesn't check for is user connected.

for what the fuck is rcon ... needed I can't understand.

line: 574
CreateDamage(iCurrent,DmgMAX,Float:Radius)

and line: 666
CreateLaserDamage(iCurrent,isHit)

inside this stock's you need to check if entity owner exists. { this is attacker }

PHP Code:


CreateDamage
(iCurrent,DmgMAX,Float:Radius)
{
    new 
AtkID pev(iCurrent,LASERMINE_OWNER)// entity_get_int(iCurrent,LASERMINE_OWNER)
    
new TeamIDpev(iCurrent,LASERMINE_INT_TEAM//entity_get_int(iCurrent,LASERMINE_INT_TEAM)
    
new Player = -1;
    new 
Float:distance,dmg;
    new 
Float:tOrigin[3];
    new 
Float:vOrigin[3];
    new 
iHitHP,iHitTeam;
    
pev(iCurrent,pev_origin,vOrigin);
    
Player engfunc(EngFunc_FindEntityInSphere,Player,vOrigin,Radius);
    while(
Player != 0)
    {
        if(
is_user_alive(Player))
        {
            
pev(Player,pev_origin,tOrigin)
            
distance get_distance_f(vOrigintOrigin)
            
dmg floatround(DmgMAX - ((DmgMAX Radius) * distance))
            
iHitHP pev_user_health(Player) - dmg
            iHitTeam 
int:cs_get_user_team(Player)
            if(
iHitHP <= 0)
            {
                if(
iHitTeam != TeamID)
                {
                    if(
is_user_connected(AtkID))
                    {
                        
cs_set_user_money(AtkID,cs_get_user_money(AtkID) + get_pcvar_num(g_LFMONEY))
                        
set_score(AtkID,Player,1,iHitHP)
                    }
                    else
                    {
                         new 
tarfrags pev_user_frags(Player) + //get_user_frags(Player) + 1
                         
set_user_frags(Player,tarfrags)
                         
set_user_health(Player,iHitHP)
                     }
                }else
                {
                    if(
get_pcvar_num(g_LFF))
                    {
                        if(
is_user_connected(AtkID))
                        {
                             
cs_set_user_money(AtkID,cs_get_user_money(AtkID) - get_pcvar_num(g_LFMONEY))
                             
set_score(AtkID,Player,-1,iHitHP)
                        }
                        else
                        {
                           new 
tarfrags pev_user_frags(Player) + //get_user_frags(Player) + 1
                           
set_user_frags(Player,tarfrags)
                           
set_user_health(Player,iHitHP)
                        }                     
                    }
                }
            }else
            {
                if(
iHitTeam != TeamID || get_pcvar_num(g_LFF))
                {
                    
//set_pev(Player,pev_health,iHitHP)
                    
set_user_health(PlayeriHitHP)
                    
message_begin(MSG_ONE_UNRELIABLEg_msgDamage, {0,0,0}, Player
                    
write_byte(dmg)
                    
write_byte(dmg)
                    
write_long(DMG_BULLET)
                    
engfunc(EngFunc_WriteCoord,vOrigin[0])
                    
engfunc(EngFunc_WriteCoord,vOrigin[1])
                    
engfunc(EngFunc_WriteCoord,vOrigin[2])
                    
message_end()
                }
            }
        }
        
Player =  engfunc(EngFunc_FindEntityInSphere,Player,vOrigin,Radius)
    }
    return 
PLUGIN_CONTINUE


and
PHP Code:

CreateLaserDamage(iCurrent,isHit)
{
    new 
Float:vOrigin[3],Float:vEnd[3]
    
pev(iCurrent,pev_origin,vOrigin)
    
pev(iCurrent,pev_vuser1,vEnd)

    
//new isHit = fm_trace_line(iCurrent, vOrigin, vEnd, vTrace)
    
new teamid pev(iCurrentLASERMINE_INT_TEAM)

    new 
szClassName[32]
    new 
Alive,God
    
new iHitTeam,iHitHP,id
    
new hitscore

    
if(isHit ) return PLUGIN_CONTINUE
    
    szClassName
[0] = '^0'
    
pev(isHit,pev_classname,szClassName,32)
    
    if(
equal(szClassName"player"))
    {
        
Alive is_user_alive(isHit)
        
God get_user_godmode(isHit)
        if(!
Alive || God) return PLUGIN_CONTINUE
             
        iHitTeam 
int:cs_get_user_team(isHit)
        
//iHitHP = entity_get_float(isHit,EV_FL_health) - float(LASER_HIT_DMG)
        
iHitHP pev_user_health(isHit) - get_pcvar_num(g_LDMG)
        
id pev(iCurrent,LASERMINE_OWNER)//, szNetName[32]
        
if( get_pcvar_num(g_LMODE) == MODE_LASERMINE)
        {
            if(
iHitHP <= 0)
            {
                if(
iHitTeam != teamid)
                {
                    
hitscore 1
                    
if(is_user_connected(id))
                    {
                        
cs_set_user_money(id,cs_get_user_money(id) + get_pcvar_num(g_LFMONEY))
                        
set_score(id,isHit,hitscore,iHitHP)
                    }
                    else
                    {
                         new 
tarfrags pev_user_frags(isHit) + //get_user_frags(Player) + 1
                         
set_user_frags(isHit,tarfrags)
                         
set_user_health(isHit,iHitHP)
                    }
                    
//set_user_health(iHit, 0)    
                    //entity_set_float(iHit, EV_FL_health,0.0)
                    
emit_sound(isHitCHAN_WEAPONENT_SOUND41.0ATTN_NORM0PITCH_NORM )
                    
                    
//entity_get_string(iHit, EV_SZ_netname, szNetName, 32)
                    //client_print(id, print_chat, "[LaserMines] %s killed your mine.",szNetName)
                
}else
                {
                    if(
get_pcvar_num(g_LFF))
                    {
                        
hitscore = -1
                        
if(is_user_connected(id))
                        {
                            
cs_set_user_money(id,cs_get_user_money(id) - get_pcvar_num(g_LFMONEY))
                            
set_score(id,isHit,hitscore,iHitHP)
                        else
                        {
                             new 
tarfrags pev_user_frags(isHit) + //get_user_frags(Player) + 1
                             
set_user_frags(isHit,tarfrags)
                             
set_user_health(isHit,iHitHP)
                        }
                        
emit_sound(isHitCHAN_WEAPONENT_SOUND41.0ATTN_NORM0PITCH_NORM )
                        
                        
//set_user_health(iHit, 0)
                        //entity_set_float(iHit, EV_FL_health, 0.0)
                        //entity_get_string(iHit, EV_SZ_netname, szNetName, 32)
                        //client_print(id, print_chat, "[LaserMines] %s killed your mine.",szNetName)
                    
}
                }
            }else if(
iHitTeam != teamid || get_pcvar_num(g_LFF))
            {
                
//entity_set_float(isHit,EV_FL_health,iHitHP)
                //set_user_health(isHit, iHitHP)
                
set_user_health(isHit,iHitHP)
                
message_begin(MSG_ONE_UNRELIABLEg_msgDamage, {0,0,0}, isHit
                
write_byte(get_pcvar_num(g_LDMG))
                
write_byte(get_pcvar_num(g_LDMG))
                
write_long(DMG_BULLET)
                
engfunc(EngFunc_WriteCoord,vOrigin[0])
                
engfunc(EngFunc_WriteCoord,vOrigin[1])
                
engfunc(EngFunc_WriteCoord,vOrigin[2])
                
message_end()
            }
        }else
        {
            
CreateExplosion(iCurrent)
            
CreateDamage(iCurrent,get_pcvar_num(g_LRDMG),get_pcvar_float(g_LRADIUS))
            
RemoveEntity(iCurrent);
        }
    }else if(
equal(szClassNameENT_CLASS_NAME3))
    {
        new 
hl;
        
hl pev_user_health(isHit);
        
set_user_health(isHit,hl-get_pcvar_num(g_LDMG));
    }
    return 
PLUGIN_CONTINUE



teamer1 01-17-2013 14:08

Re: laser mines
 
Please correct plugin and throw off fixed sma will be grateful

wickedd 01-17-2013 14:15

Re: laser mines
 
No one is going to fix the plugin for you, this is the scripting help forum. Try to fix it yourself, if it doesn't work post what you have tried and we'll help you again.

Edit: If you don't know how to script, post your problem in the plugin thread.

ANTICHRISTUS 01-17-2013 17:29

Re: laser mines
 
Quote:

Originally Posted by AngeIII (Post 1875157)
for what this is needed? problem is in plugin, cause plugin doesn't check for is user connected.

for what the fuck is rcon ... needed I can't understand.

if you can't understand then don't reply. problem is a working plugin that didn't work in this case.

AngeIII 01-17-2013 17:34

Re: laser mines
 
plugin is working, I don't argue with that. but only one mistake, plugin doesn't not check for attacker state, for example if attacker will drop from server, but berofe they have posted lasermine, this will cause error. in my post i fixed that with checking is_user_connected

simanovich 01-18-2013 03:09

Re: laser mines
 
[CSTRIKE] Invalid player X MSG's means that the player X isn't connected.

You need to put a check if the player is connected.


All times are GMT -4. The time now is 13:42.

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