Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
guns #414612
01/05/13 19:40
01/05/13 19:40
Joined: Apr 2012
Posts: 106
G
GaniX Offline OP
Member
GaniX  Offline OP
Member
G

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.
Code:
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: GaniX] #414614
01/05/13 19:57
01/05/13 19:57
Joined: Jul 2008
Posts: 2,110
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,110
Germany


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: guns [Re: rayp] #414620
01/05/13 20:31
01/05/13 20:31
Joined: Apr 2005
Posts: 653
Germany
D
Det Offline
User
Det  Offline
User
D

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
G
GaniX Offline OP
Member
GaniX  Offline OP
Member
G

Joined: Apr 2012
Posts: 106
ok thanks i take a look

Re: guns [Re: GaniX] #414696
01/06/13 19:44
01/06/13 19:44
Joined: Apr 2012
Posts: 106
G
GaniX Offline OP
Member
GaniX  Offline OP
Member
G

Joined: Apr 2012
Posts: 106
rayp in our coade to change the weapons , the weapons must edit one by one ?
is other way to make more general that?

Re: guns [Re: GaniX] #414719
01/07/13 05:42
01/07/13 05:42
Joined: Jul 2008
Posts: 2,110
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,110
Germany
I dont understand the question sorry.

If its still up to select only weapons u got, take a look into _init_gun1. A var can solve this problem fex

Code:
var collected_weapon_1 = 0;

..
void Use_Gun1(){
   if (!collected_weapon_1) return;
   ..
}

..
void Take_Gun1(){
   collected_weapon_1 = 1;
   ..
}


Last edited by rayp; 01/07/13 05:43.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: guns [Re: rayp] #414845
01/08/13 23:46
01/08/13 23:46
Joined: Apr 2012
Posts: 106
G
GaniX Offline OP
Member
GaniX  Offline OP
Member
G

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.

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1