Difference between revisions of "User talk:Battle Bott"

From Valve Developer Community
Jump to: navigation, search
Line 15: Line 15:
 
:end;<br/>
 
:end;<br/>
 
end;<br/>
 
end;<br/>
--Block of variables that need to be defined
+
--Block of variables that need to be defined<br/>
local vecpos = _PlayerGetShootPos( Owner );
+
local vecpos = _PlayerGetShootPos( Owner );<br/>
local plyang = _PlayerGetShootAng( Owner );
+
local plyang = _PlayerGetShootAng( Owner );<br/>
_TraceLine( vecpos, plyang, 10000, Owner );
+
_TraceLine( vecpos, plyang, 10000, Owner );<br/>
local hitpos = _TraceEndPos();
+
local hitpos = _TraceEndPos();<br/>
local surfaceang = _TraceGetSurfaceNormal();
+
local surfaceang = _TraceGetSurfaceNormal();<br/>
local plyright = _EntGetRightVector( Owner );     
+
local plyright = _EntGetRightVector( Owner );<br/>    
local plyang = _PlayerGetShootAng(Owner)
+
local plyang = _PlayerGetShootAng(Owner)<br/>
local vecpos = _PlayerGetShootPos(Owner)
+
local vecpos = _PlayerGetShootPos(Owner)<br/>
local ang2 = vecMul( plyang, vector3( 50, 50, 50 ) )
+
local ang2 = vecMul( plyang, vector3( 50, 50, 50 ) )<br/>
local ang3 = vecAdd( ang2, vector3( 0, 0, -10 ) )
+
local ang3 = vecAdd( ang2, vector3( 0, 0, -10 ) )<br/>
local endpos = vecAdd( _PlayerGetShootPos(Owner), ang3 )
+
local endpos = vecAdd( _PlayerGetShootPos(Owner), ang3 )<br/>
local muzzlepos =  vecAdd( endpos, vecMul( plyright, vector3(10,10,0)))
+
local muzzlepos =  vecAdd( endpos, vecMul( plyright, vector3(10,10,0)))<br/>
--End block
+
--End block<br/>

Revision as of 15:45, 2 June 2006

function eventPlayerSay ( Owner, strText, bTeam )

if string.find(strText, "nade") then
local vVelocity;
local grenade = _EntCreate("grenade_ar2");
local pos = _EntGetPos (Owner)
_EntSetKeyValue(grenade, "damage", "60");
_EntSetPos(grenade, pos);
_EntSetPos(grenade, _PlayerGetShootAng(Owner));
_EntSetOwner(grenade, Owner);
vVelocity = vecMul(_PlayerGetShootAng(Owner), 1500);
_EntSetVelocity(grenade, vVelocity);
_EntSpawn(grenade);
else
return strText;
end;

end;
--Block of variables that need to be defined
local vecpos = _PlayerGetShootPos( Owner );
local plyang = _PlayerGetShootAng( Owner );
_TraceLine( vecpos, plyang, 10000, Owner );
local hitpos = _TraceEndPos();
local surfaceang = _TraceGetSurfaceNormal();
local plyright = _EntGetRightVector( Owner );
local plyang = _PlayerGetShootAng(Owner)
local vecpos = _PlayerGetShootPos(Owner)
local ang2 = vecMul( plyang, vector3( 50, 50, 50 ) )
local ang3 = vecAdd( ang2, vector3( 0, 0, -10 ) )
local endpos = vecAdd( _PlayerGetShootPos(Owner), ang3 )
local muzzlepos = vecAdd( endpos, vecMul( plyright, vector3(10,10,0)))
--End block