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

I want to write a Earth Quake effect!!!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-17-2010 , 05:17   I want to write a Earth Quake effect!!!
Reply With Quote #1

I want to write a Earth Quake effect that can kill all the common infected around, the radius is determined by my level of Earth Quake skill (EarthQuakeLv[Client]) and my skill point (Intelligence[Client]).

Below are the code that does the job, but i know that i am not the killer of those killed common infected, so i cant get the exp by killing them(killing the commond infected in usual way can gain exp)......

So how can i become the killer of those killed common infected?

PHP Code:
public bool:Create_PointHurt(Client)
{
    new 
Entity;
    new 
String:sDamage[128];
    new 
String:sRadius[128];
    new 
String:sType[128];
    
    
FloatToString(0.0sDamagesizeof(sDamage));
    if((
50+Intelligence[Client])*EarthQuakeLv[Client] < 3001)
    {
        
FloatToString((50.0+Intelligence[Client])*EarthQuakeLv[Client], sRadiussizeof(sRadius));
    }
    else
    {
        
FloatToString(4375.0sRadiussizeof(sRadius));
    }

    
IntToString(64sTypesizeof(sType));
    
    
Entity CreateEntityByName("point_hurt");
    
    if (!
IsValidEdict(Entity)) return false;
    
DispatchKeyValue(Entity"targetname""point_hurt");
    
DispatchKeyValue(Entity"DamageRadius"sRadius);
    
DispatchKeyValue(Entity"Damage"sDamage);
    
DispatchKeyValue(Entity"DamageType"sType);
    
    
DispatchSpawn(Entity);
    
    
TeleportEntity(EntityNowLocation[Client], NULL_VECTORNULL_VECTOR);
    
    
AcceptEntityInput(Entity"Hurt", (Client 0) ? Client : -1);
    
    
DispatchKeyValue(Entity"classname""point_hurt");
    
DispatchKeyValue(Entity"targetname""null");
    
RemoveEdict(Entity);
    
    return 
true;

chu1720 is offline
Send a message via MSN to chu1720
dYZER
Member
Join Date: Jan 2010
Location: Germany
Old 07-17-2010 , 06:15   Re: I want to write a Earth Quake effect!!!
Reply With Quote #2

take a look http://forums.alliedmods.net/showthread.php?t=121711

sources snip
PHP Code:

public ScreenShake(target)
{
    new 
Handle:msg;
    if (
GetConVarInt(l4d2_lw_shake_shooteronly))
    {
        
msg StartMessageAll("Shake");
    }
    else
    {
        
msg StartMessageOne("Shake"target);
    }
    
BfWriteByte(msg0);
     
BfWriteFloat(msgGetConVarFloat(l4d2_lw_shake_intensity));
     
BfWriteFloat(msg10.0);
     
BfWriteFloat(msg3.0);
    
EndMessage();

dYZER is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-17-2010 , 07:00   Re: I want to write a Earth Quake effect!!!
Reply With Quote #3

you would have to write a death event of the person killed, who they were kiled by , what weapon , etc

http://forums.alliedmods.net/showthr...ht=death+event
__________________
Peoples Army is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 07-17-2010 , 11:05   Re: I want to write a Earth Quake effect!!!
Reply With Quote #4

you should probably be reading the scripting forums.. this was just posted yesterday or the day before:
PHP Code:
//Damage types you can have
#define DMG_GENERIC            0
#define DMG_CRUSH            (1 << 0)
#define DMG_BULLET            (1 << 1)
#define DMG_SLASH            (1 << 2)
#define DMG_BURN            (1 << 3)
#define DMG_VEHICLE            (1 << 4)
#define DMG_FALL            (1 << 5)
#define DMG_BLAST            (1 << 6)
#define DMG_CLUB            (1 << 7)
#define DMG_SHOCK            (1 << 8)
#define DMG_SONIC            (1 << 9)
#define DMG_ENERGYBEAM            (1 << 10)
#define DMG_PREVENT_PHYSICS_FORCE    (1 << 11)
#define DMG_NEVERGIB            (1 << 12)
#define DMG_ALWAYSGIB            (1 << 13)
#define DMG_DROWN            (1 << 14)
#define DMG_TIMEBASED            (DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN)
#define DMG_PARALYZE            (1 << 15)
#define DMG_NERVEGAS            (1 << 16)
#define DMG_POISON            (1 << 17)
#define DMG_RADIATION            (1 << 18)
#define DMG_DROWNRECOVER        (1 << 19)
#define DMG_ACID            (1 << 20)
#define DMG_SLOWBURN            (1 << 21)
#define DMG_REMOVENORAGDOLL        (1 << 22)
#define DMG_PHYSGUN            (1 << 23)
#define DMG_PLASMA            (1 << 24)
#define DMG_AIRBOAT            (1 << 25)
#define DMG_DISSOLVE            (1 << 26)
#define DMG_BLAST_SURFACE        (1 << 27)
#define DMG_DIRECT            (1 << 28)
#define DMG_BUCKSHOT            (1 << 29)

DealDamage(victim,damage,attacker=0,dmg_type=0,String:weapon[]="")
{
    if(
victim>&& IsValidEdict(victim) && IsClientInGame(victim) && IsPlayerAlive(victim) && damage>0)
    {
        new 
String:dmg_str[16];
        
IntToString(damage,dmg_str,16);
        new 
String:dmg_type_str[32];
        
IntToString(dmg_type,dmg_type_str,32);
        
PointHurt CreateEntityByName("point_hurt");
        if(
PointHurt)
        {
            
DispatchKeyValue(victim,"targetname","dmged_target");
            
DispatchKeyValue(PointHurt,"DamageTarget","dmged_target");
            
DispatchKeyValue(PointHurt,"Damage",dmg_str);
            
DispatchKeyValue(PointHurt,"DamageType",dmg_type_str);
            if(!
StrEqual(weapon,""))
            {
                
DispatchKeyValue(PointHurt,"classname",weapon);
            }
            
DispatchSpawn(PointHurt);
            
AcceptEntityInput(PointHurt,"Hurt",(attacker>0)?attacker:-1);
            
DispatchKeyValue(PointHurt,"classname","point_hurt");
            
DispatchKeyValue(victim,"targetname","nondmged_target");
            
RemoveEdict(PointHurt);
        }
    }

dirka_dirka is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-17-2010 , 17:15   Re: I want to write a Earth Quake effect!!!
Reply With Quote #5

that doesn't send a death message though , that just shows the damage types to the game, he can use that but then he also still has to send a death message to make sure that some one gets the kill
__________________
Peoples Army is offline
dirka_dirka
Veteran Member
Join Date: Nov 2009
Old 07-17-2010 , 19:44   Re: I want to write a Earth Quake effect!!!
Reply With Quote #6

maybe you should read the lines that are not orange.
dirka_dirka is offline
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-17-2010 , 23:38   Re: I want to write a Earth Quake effect!!!
Reply With Quote #7

Quote:
Originally Posted by dirka_dirka View Post
maybe you should read the lines that are not orange.
But i would like to kill all the common infected around me (with some radius), the above code is sbout killed one specific target (am i right?).
If i want to use it, do i need to get the client id of a common infected? I dont know how to get that......
P.S. I am just a beginner of the sourcemod scripting, so i would realy appreciated if you gus explain it in detail^^
chu1720 is offline
Send a message via MSN to chu1720
dYZER
Member
Join Date: Jan 2010
Location: Germany
Old 07-18-2010 , 04:45   Re: I want to write a Earth Quake effect!!!
Reply With Quote #8

he´s looking like this nova gun http://www.youtube.com/watch?v=brI9v...eature=related 2:14 (hellgate london)
dYZER is offline
chu1720
Senior Member
Join Date: Mar 2010
Location: Hong Kong
Old 07-18-2010 , 11:44   Re: I want to write a Earth Quake effect!!!
Reply With Quote #9

Quote:
Originally Posted by Peoples Army View Post
that doesn't send a death message though , that just shows the damage types to the game, he can use that but then he also still has to send a death message to make sure that some one gets the kill
How can i send the death message?
chu1720 is offline
Send a message via MSN to chu1720
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-18-2010 , 11:57   Re: I want to write a Earth Quake effect!!!
Reply With Quote #10

Quote:
Originally Posted by chu1720 View Post
How can i send the death message?
You don't need to do that. Just use the snippet dirka_dirka posted.

Don't forget to credit the original author if you end up releasing the plugin, I wish people would do that when posting snippets too... Here's the original thread: http://forums.alliedmods.net/showthread.php?t=111684
__________________
plop
p3tsin is offline
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 16:15.


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