Raised This Month: $ Target: $400
 0% 

laser mines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
teamer1
New Member
Join Date: Jan 2013
Old 01-17-2013 , 09:50   laser mines
Reply With Quote #1

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).
teamer1 is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 01-17-2013 , 09:57   Re: laser mines
Reply With Quote #2

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.
__________________

Last edited by Neeeeeeeeeel.-; 01-17-2013 at 09:58.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
teamer1
New Member
Join Date: Jan 2013
Old 01-17-2013 , 10:13   Re: laser mines
Reply With Quote #3

I'm sorry
Here's the source code.
Fix please, and throw off the corrected
Attached Files
File Type: sma Get Plugin or Get Source (lasermine_020.sma - 117 views - 26.8 KB)
teamer1 is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-17-2013 , 12:55   Re: laser mines
Reply With Quote #4

please post the output of the following commands:
  • rcon version.
  • rcon meta list.
__________________

Last edited by ANTICHRISTUS; 01-17-2013 at 13:02.
ANTICHRISTUS is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-17-2013 , 14:01   Re: laser mines
Reply With Quote #5

Quote:
Originally Posted by ANTICHRISTUS View Post
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

__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
teamer1
New Member
Join Date: Jan 2013
Old 01-17-2013 , 14:08   Re: laser mines
Reply With Quote #6

Please correct plugin and throw off fixed sma will be grateful
teamer1 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-17-2013 , 14:15   Re: laser mines
Reply With Quote #7

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.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 01-17-2013 at 14:16.
wickedd is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-17-2013 , 17:29   Re: laser mines
Reply With Quote #8

Quote:
Originally Posted by AngeIII View Post
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.
__________________
ANTICHRISTUS is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-17-2013 , 17:34   Re: laser mines
Reply With Quote #9

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
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-18-2013 , 03:09   Re: laser mines
Reply With Quote #10

[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.
__________________
simanovich is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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