Raised This Month: $51 Target: $400
 12% 

[HELP] fix bug in score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 07-28-2016 , 13:08   [HELP] fix bug in score
Reply With Quote #1

hi guys.. i find plugin to make explode me + victim near from me
i moded it and added effects and more..

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <engine> 
#include <hamsandwich> 
#include <fakemeta_util>
#include <fun>
#include <colorchat>

#define MINE_MODEL_EXPLODE    "sprites/zerogxplode.spr"
new g_hExplode;
#define write_coord_f(%0) write_coord(floatround(%0))
new bool:cmd_used[33]  

public 
plugin_init() 

register_plugin("Explosion","Zaid","1.0"
register_clcmd("exp","Explosion")     


public 
Explosion(id
{
    
if(!
is_user_alive(id))
{
ColorChat(idGREY"^4[CS]^1 You should alive.")
return 
PLUGIN_HANDLED
}


// Limit the use of cmd
if (cmd_used[id])
{
ColorChat(idGREY"^4[CS]^1 You have already used this command...")
return 
PLUGIN_HANDLED;
}

new 
Float:Origin[3];
pev(idpev_originOrigin);
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord_f(Origin[0] + random_float(-22.022.0));
write_coord_f(Origin[1] + random_float(-22.022.0));
write_coord_f(Origin[2] + random_float(-22.022.0));
write_short(g_hExplode);
write_byte(random_num(1525));
write_byte(15);
write_byte(0);
message_end();

message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord_f(Origin[0] + random_float(-22.022.0));
write_coord_f(Origin[1] + random_float(-22.022.0));
write_coord_f(Origin[2] + random_float(-22.022.0));
write_short(g_hExplode);
write_byte(random_num(1525));
write_byte(15);
write_byte(0);
message_end();

message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord_f(Origin[0] + random_float(-22.022.0));
write_coord_f(Origin[1] + random_float(-22.022.0));
write_coord_f(Origin[2] + random_float(-22.022.0));
write_short(g_hExplode);
write_byte(random_num(1525));
write_byte(15);
write_byte(0);
message_end();

message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord_f(Origin[0] + random_float(-22.022.0));
write_coord_f(Origin[1] + random_float(-22.022.0));
write_coord_f(Origin[2] + random_float(-22.022.0));
write_short(g_hExplode);
write_byte(random_num(1525));
write_byte(15);
write_byte(0);
message_end();

message_begin(MSG_BROADCASTSVC_TEMPENTITY);
write_byte(TE_EXPLOSION);
write_coord_f(Origin[0] + random_float(-22.022.0));
write_coord_f(Origin[1] + random_float(-22.022.0));
write_coord_f(Origin[2] + random_float(-22.022.0));
write_short(g_hExplode);
write_byte(random_num(1525));
write_byte(15);
write_byte(0);
message_end();

message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short10<<12 )
write_short10<<16 )
write_short1<<)
write_byte255 )
write_byte)
write_byte)
write_byte255 )
message_end()

static 
originorigin[3]
get_user_origin(idoriginorigin)                
message_begin(MSG_PVSSVC_TEMPENTITYoriginorigin)
write_byte(TE_LAVASPLASH
write_coord(originorigin[0]) 
write_coord(originorigin[1]) 
write_coord(originorigin[2] - 26
message_end()

msg_screen_shakeid255<<1010<<10255<<10 );
cmd_used[id] = true
set_task
(0.1"Find"id, .flags="b")
return 
PLUGIN_CONTINUE
}

public 
msg_screen_shakeid,  Amplitud ,  DuracionFrecuencia  )

message_begin(MSG_ONE_UNRELIABLEget_user_msgid("ScreenShake"), {0,0,0}, id); 
write_short(255<<10);
write_short(10<<10);
write_short(255<<10);
message_end() 



public 
plugin_precache( )
{
g_hExplode engfuncEngFunc_PrecacheModelMINE_MODEL_EXPLODE );
}

public 
Find(pId// pId = Someone whom around we check radius   
{  
for (new 
id 1id 33id ++ ) // Check all players distance to this player  
{    
if (
get_entity_distanceidpId ) < 300 // 300 - Change if you need  
{  
ExecuteHamB(Ham_TakeDamageid0pId150.0DMG_BULLET)
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},pId)
write_short10<<12 )
write_short10<<16 )
write_short1<<)
write_byte255 )
write_byte)
write_byte
write_byte255 )
message_end() 
client_cmd(pId"spk fvox/flatline")
msg_screen_shakepId255<<1010<<10255<<10 );


message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short10<<12 )
write_short10<<16 )
write_short1<<)
write_byte255 )
write_byte)
write_byte
write_byte255 )
message_end() 
client_cmd(id"spk fvox/flatline")
msg_screen_shakeid255<<1010<<10255<<10 );

static 
originorigin[3]
get_user_origin(idoriginorigin)                
message_begin(MSG_PVSSVC_TEMPENTITYoriginorigin)
write_byte(TE_LAVASPLASH
write_coord(originorigin[0]) 
write_coord(originorigin[1]) 
write_coord(originorigin[2] - 26
message_end()

ExecuteHamB(Ham_KilledidpId2)
remove_task(id)
}  
}  
return 
PLUGIN_CONTINUE              

but! it's have bug in score :/



see!!
it's make double kill in score :/
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 07-28-2016 , 13:27   Re: [HELP] fix bug in score
Reply With Quote #2

Edit:
i tested this plugin when my server was 32/32
when i explode the server crashed :/

can any one rewrite this idea..
i need when i write in chat

explode
i need explode my self+die and any one near from me die
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-28-2016 , 13:28   Re: [HELP] fix bug in score
Reply With Quote #3

That is because you execute ham damage and kill at the same time you dumb ass, open your eyes

Why the heck are you still scripting? you can't even indent your code, not to talk about the genius idea of sending the same effect 3 times simultaneously

Of course it crashes the server, did you even know what you wrote there?

And again, stop advertising your non steam "hosting company" and stop bumping
__________________

Last edited by Depresie; 07-28-2016 at 13:44.
Depresie is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 07-28-2016 , 13:56   Re: [HELP] fix bug in score
Reply With Quote #4

Quote:
Originally Posted by Depresie View Post
That is because you execute ham damage and kill at the same time you dumb ass, open your eyes

Why the heck are you still scripting? you can't even indent your code, not to talk about the genius idea of sending the same effect 3 times simultaneously

Of course it crashes the server, did you even know what you wrote there?

And again, stop advertising your non steam "hosting company" and stop bumping
* Show errors you get on console
* Tell use in a more descriptive way what BUG you have with score?
Craxor is offline
Send a message via ICQ to Craxor
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-28-2016 , 15:22   Re: [HELP] fix bug in score
Reply With Quote #5

Why not being a smart-ass and just look at Undead Ultimate from WarCraft mode?
siriusmd99 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 07-28-2016 , 16:58   Re: [HELP] fix bug in score
Reply With Quote #6

There are way too many plugins which have exactly what he needs inside them...
__________________
Depresie is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 07-28-2016 , 17:50   Re: [HELP] fix bug in score
Reply With Quote #7

Quote:
Originally Posted by Depresie View Post
There are way too many plugins which have exactly what he needs inside them...
you mean this:
https://forums.alliedmods.net/showthread.php?p=648779
??
where i can find my request?
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 07-28-2016 , 18:02   Re: [HELP] fix bug in score
Reply With Quote #8

i moded this plugin from this topic:

https://forums.alliedmods.net/showth...ight=Explosion
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-28-2016 , 18:54   Re: [HELP] fix bug in score
Reply With Quote #9

heres a simple code on how entity kills a player

target is the player near the explosion...
check if his health beneath the damage explosion then log the kill.. otherwise it just dmg

PHP Code:

    
if(pev(targetpev_health) > damage)
        
ExecuteHamB(Ham_TakeDamagetargetentownerdamageDMG_BLAST);
    else
        
log_kill(ownertargetsticky_classnamefalse)


stock log_kill(killervictim, const weapon[], headshot)
{
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
    
ExecuteHamB(Ham_Killedvictimkiller2// set last param to 2 if you want victim to gib
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)

    
    
message_begin(MSG_BROADCASTget_user_msgid("DeathMsg"))
    
write_byte(killer)
    
write_byte(victim)
    
write_byte(headshot)
    
write_string(weapon)
    
message_end()
//
    
    
if(get_user_team(killer)!=get_user_team(victim))
        
set_user_frags(killer,get_user_frags(killer) +1)
    if(
get_user_team(killer)==get_user_team(victim))
        
set_user_frags(killer,get_user_frags(killer) -1)
        
    new 
kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10]

    
get_user_name(killerkname31)
    
get_user_team(killerkteam9)
    
get_user_authid(killerkauthid31)
 
    
get_user_name(victimvname31)
    
get_user_team(victimvteam9)
    
get_user_authid(victimvauthid31)
        
    
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^""
    
knameget_user_userid(killer), kauthidkteam
     
vnameget_user_userid(victim), vauthidvteamweapon)

     return 
PLUGIN_CONTINUE;


& btw what is this in the bold ? u trying to damage the player and kill him at the same time?

Code:
ExecuteHamB(Ham_TakeDamage, id, 0, pId, 150.0, DMG_BULLET)
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},pId)
write_short( 10<<12 )
write_short( 10<<16 )
write_short( 1<<1 )
write_byte( 255 )
write_byte( 0 )
write_byte( 0 ) 
write_byte( 255 )
message_end() 
client_cmd(pId, "spk fvox/flatline")
msg_screen_shake( pId, 255<<10, 10<<10, 255<<10 );


message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short( 10<<12 )
write_short( 10<<16 )
write_short( 1<<1 )
write_byte( 255 )
write_byte( 0 )
write_byte( 0 ) 
write_byte( 255 )
message_end() 
client_cmd(id, "spk fvox/flatline")
msg_screen_shake( id, 255<<10, 10<<10, 255<<10 );

static originorigin[3]
get_user_origin(id, originorigin)                
message_begin(MSG_PVS, SVC_TEMPENTITY, originorigin)
write_byte(TE_LAVASPLASH) 
write_coord(originorigin[0]) 
write_coord(originorigin[1]) 
write_coord(originorigin[2] - 26) 
message_end()

ExecuteHamB(Ham_Killed, id, pId, 2)

Last edited by Natsheh; 07-28-2016 at 18:59.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 07-28-2016 , 19:06   Re: [HELP] fix bug in score
Reply With Quote #10

Quote:
Originally Posted by Natsheh View Post
heres a simple code on how entity kills a player

target is the player near the explosion...
check if his health beneath the damage explosion then log the kill.. otherwise it just dmg

PHP Code:

    
if(pev(targetpev_health) > damage)
        
ExecuteHamB(Ham_TakeDamagetargetentownerdamageDMG_BLAST);
    else
        
log_kill(ownertargetsticky_classnamefalse)


stock log_kill(killervictim, const weapon[], headshot)
{
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
    
ExecuteHamB(Ham_Killedvictimkiller2// set last param to 2 if you want victim to gib
    
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT)

    
    
message_begin(MSG_BROADCASTget_user_msgid("DeathMsg"))
    
write_byte(killer)
    
write_byte(victim)
    
write_byte(headshot)
    
write_string(weapon)
    
message_end()
//
    
    
if(get_user_team(killer)!=get_user_team(victim))
        
set_user_frags(killer,get_user_frags(killer) +1)
    if(
get_user_team(killer)==get_user_team(victim))
        
set_user_frags(killer,get_user_frags(killer) -1)
        
    new 
kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10]

    
get_user_name(killerkname31)
    
get_user_team(killerkteam9)
    
get_user_authid(killerkauthid31)
 
    
get_user_name(victimvname31)
    
get_user_team(victimvteam9)
    
get_user_authid(victimvauthid31)
        
    
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^""
    
knameget_user_userid(killer), kauthidkteam
     
vnameget_user_userid(victim), vauthidvteamweapon)

     return 
PLUGIN_CONTINUE;

& btw what is this in the bold ? u trying to damage the player and kill him at the same time?

Code:
ExecuteHamB(Ham_TakeDamage, id, 0, pId, 150.0, DMG_BULLET)
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},pId)
write_short( 10<<12 )
write_short( 10<<16 )
write_short( 1<<1 )
write_byte( 255 )
write_byte( 0 )
write_byte( 0 ) 
write_byte( 255 )
message_end() 
client_cmd(pId, "spk fvox/flatline")
msg_screen_shake( pId, 255<<10, 10<<10, 255<<10 );


message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short( 10<<12 )
write_short( 10<<16 )
write_short( 1<<1 )
write_byte( 255 )
write_byte( 0 )
write_byte( 0 ) 
write_byte( 255 )
message_end() 
client_cmd(id, "spk fvox/flatline")
msg_screen_shake( id, 255<<10, 10<<10, 255<<10 );

static originorigin[3]
get_user_origin(id, originorigin)                
message_begin(MSG_PVS, SVC_TEMPENTITY, originorigin)
write_byte(TE_LAVASPLASH) 
write_coord(originorigin[0]) 
write_coord(originorigin[1]) 
write_coord(originorigin[2] - 26) 
message_end()

ExecuteHamB(Ham_Killed, id, pId, 2)
thank you very much for replay..
first: can you make this idea?? i tired from editing plugins :/ and more bugs and errors.
idea
Quote:
when a specific player Tape /Explode , He Set instant Damage on Every one near to Him in like 2m ( like a bomb Explosion ) ..
about your question
PHP Code:
ExecuteHamB(Ham_TakeDamageid0pId150.0DMG_BULLET
damage anyone near from me + damage me
PHP Code:
ExecuteHamB(Ham_KilledidpId2
kill myself after damage
__________________

Last edited by arvEL.; 07-28-2016 at 19:22.
arvEL. is offline
Send a message via Skype™ to arvEL.
Reply



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 03:31.


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