Posts: 61
Threads: 18
Joined: Jul 2011
Reputation:
1
10-27-2011, 11:55
(This post was last modified: 10-27-2011, 12:04 by gumpo03.)
Hi,
i search an commandto give all players a weapon like famas_mp, but only ONE player is executing the Command.
Like: 1 Player use the command, so all players become immediately a new Weapon not on spawn, IMMEDIATELY.
Is this possible?
as example with something like
Code: all giveWeapon ("famas_mp", 0, false);
?
I hope, you can help me
Sorry for bad English -> *GERMAN*
Posts: 1,323
Threads: 24
Joined: Nov 2010
Reputation:
91
10-27-2011, 12:14
(This post was last modified: 10-27-2011, 12:17 by zxz0O0.)
PHP Code: for(zxz=0;zxz<level.players.size;zxz++) { level.players[zxz] giveWeapon ("famas_mp", 0, false); level.players[zxz] iPrintLnBold("zxz is the best"); }
Posts: 61
Threads: 18
Joined: Jul 2011
Reputation:
1
(10-27-2011, 12:14)zxz0O0 Wrote: PHP Code: for(zxz=0;zxz<level.players.size;zxz++) { level.players[zxz] giveWeapon ("famas_mp", 0, false); level.players[zxz] iPrintLnBold("zxz is the best"); }
And now, all Players have a famas?
or only player zxz?
Sorry for bad English -> *GERMAN*
Posts: 5,320
Threads: 300
Joined: Feb 2011
Reputation:
149
10-27-2011, 12:27
(This post was last modified: 10-27-2011, 12:27 by JariZ.)
all players have the weapon -.-
it's just the name of the variable
please take some basic lessons before asking questions like this
Posts: 61
Threads: 18
Joined: Jul 2011
Reputation:
1
10-27-2011, 13:00
(This post was last modified: 10-27-2011, 13:13 by gumpo03.)
(10-27-2011, 12:27)jariz Wrote: all players have the weapon -.-
it's just the name of the variable
please take some basic lessons before asking questions like this sorry, but the
Code: level.players[zxz] iPrintLnBold("zxz is the best");
has confused me, because i think, he would send all players, whos Weapon is Changed a Massage like "*Playername* is the best".
I've senn only now, the name of the poster of code is zxz
_____________________________________________________________
Is it posible to give a player an Weapon, if the weaponname is in a variable?
like
Code: self giveWeapon ("level.weapon", 0, false);
Sorry for bad English -> *GERMAN*
Posts: 1,323
Threads: 24
Joined: Nov 2010
Reputation:
91
(10-27-2011, 13:00)gumpo03 Wrote: (10-27-2011, 12:27)jariz Wrote: all players have the weapon -.-
it's just the name of the variable
please take some basic lessons before asking questions like this sorry, but the
Code: level.players[zxz] iPrintLnBold("zxz is the best");
has confused me, because i think, he would send all players, whos Weapon is Changed a Massage like "*Playername* is the best".
I've senn only now, the name of the poster of code is zxz
_____________________________________________________________
Is it posible to give a player an Weapon, if the weaponname is in a variable?
like
Code: self giveWeapon ("level.weapon", 0, false);
Yes, my code will give everyone the famas and display the message "zxz is the best". You can delete the line with the message. And yes, you can use variables, but variables are without ". If you write something with "", it's a text string.
Like this:
PHP Code: level.weapon = "put weapon name here"; self giveWeapon (level.weapon, 0, false);
|