View Single Post
alexip121093
Senior Member
Join Date: Dec 2009
Location: Hong Kong
Old 08-13-2011 , 12:25   Re: [L4D & L4D2] Intelligent Machine Gun
Reply With Quote #9

Quote:
Originally Posted by panxiaohai View Post
Thank you for your guidance.
The beginning of the idea is create a weapon auto attack inftects, the weapon is on your shoulder, like predators in movie, but I find no appropriate model to use, and my hammar tool do not work.
Attachment 90525
Attack range and damage type are written directly in code , not yet make convars.

Another question to ask, the code below do not work in l4d1, the bullet track start from pos but not end with endpos, "info_particle_target" even do not exsit.
Code:
ShowTrack(  Float:pos[3], Float:endpos[3] )
{  
     decl String:temp[32];        
    new target =0;
    if(L4D2Version)target=CreateEntityByName("info_particle_target");
    else target=CreateEntityByName("info_target"); 
    Format(temp, 32, "cptarget%d", target);
    DispatchKeyValue(target, "targetname", temp);    
    TeleportEntity(target, endpos, NULL_VECTOR, NULL_VECTOR); 
    ActivateEntity(target); 
 
    new particle = CreateEntityByName("info_particle_system");
    if(L4D2Version)    DispatchKeyValue(particle, "effect_name", PARTICLE_WEAPON_TRACER2);
    else DispatchKeyValue(particle, "effect_name", PARTICLE_WEAPON_TRACER);
    DispatchKeyValue(particle, "cpoint1", temp);
    DispatchSpawn(particle);
    ActivateEntity(particle); 
    TeleportEntity(particle, pos, NULL_VECTOR, NULL_VECTOR);
    AcceptEntityInput(particle, "start");    
    CreateTimer(0.01, DeleteParticletargets, target, TIMER_FLAG_NO_MAPCHANGE);
    CreateTimer(0.01, DeleteParticles, particle, TIMER_FLAG_NO_MAPCHANGE);
}
yeah info_particle_target only exist in l4d2
I think for l4d1 you should use the same method as before to create the gun fire
__________________
alexip121093 is offline
Send a message via MSN to alexip121093