0 registered members (),
1,280
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
guns
#414612
01/05/13 19:40
01/05/13 19:40
|
Joined: Apr 2012
Posts: 106
GaniX
OP
Member
|
OP
Member
Joined: Apr 2012
Posts: 106
|
Traductor hello, someone please tell me how could I make a code to slect guns only the available, in a fps basic , and if should not have guns do not show any weapons. The following code corresponds to one of the weapons.
ENTITY * gun =
{
type = "pistol2.mdl";
view = camera; / / this is visible in the view called 'camera'
flags2 = OVERLAY | SHOW;
x = 1;
y = -6;
z = -2;
}
animate_gun function ()
{
shoot var, var gun_percent = 1;
while (gun! = NULL)
{
if (mouse_left)
shoot = 1;
while (shoot == 1) {
ent_animate (gun, "shot", gun_percent, ANM_CYCLE);/ / if mouse left token = 1 if signal == 1 percentage + + if animation animation == Percent ... signal = 0 if signal == 1 else not encourage encourage
gun_percent + = 9 * time_step;
if (gun_percent <50)
{
cartucho.alpha = 0;
cartucho.flags2 | = INVISIBLE | TRANSLUCENT;
cartucho.tilt = 0;
cartucho.y = -6;
cartucho.z = -2;
cartucho.x = 30;
cartucho.pan = 0;
else {}
cartucho.flags2 | = SHOW;
cartucho.pan + = (2 + random (20)) * time_step;
cartucho.tilt + = (2 + random (20)) * time_step;
cartucho.y-= (1.7 + random (1)) * time_step;
cartucho.z + = (1.7 + random (1)) * time_step;
}
if (gun_percent> 99) {shoot = 0; gun_percent = 0; ent_create ("coltshell.mdl" vector (gun.x + random (20), gun.y-10, gun.z) caida_cartucho);}
wait (1);
}
wait (1);
}
}
player_code action ()
{
...
animate_gun ();
}
There are some simple and generic way to do so without carrying a lot of code? thanks
Last edited by GaniX; 01/05/13 19:43.
|
|
|
Re: guns
[Re: rayp]
#414620
01/05/13 20:31
01/05/13 20:31
|
Joined: Apr 2005
Posts: 653 Germany
Det
User
|
User
Joined: Apr 2005
Posts: 653
Germany
|
Antother way are the Templates with Gun Actions.
Wissen ist macht. Nichts wissen macht auch nichts.
A7.86
|
|
|
Re: guns
[Re: Det]
#414627
01/05/13 23:24
01/05/13 23:24
|
Joined: Apr 2012
Posts: 106
GaniX
OP
Member
|
OP
Member
Joined: Apr 2012
Posts: 106
|
|
|
|
Re: guns
[Re: rayp]
#414845
01/08/13 23:46
01/08/13 23:46
|
Joined: Apr 2012
Posts: 106
GaniX
OP
Member
|
OP
Member
Joined: Apr 2012
Posts: 106
|
i ask if there are any way to make more general the code to change the weapons, no edit one by one(ammo,position,etc).
Last edited by GaniX; 01/09/13 00:01.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|