ItsMods
One Player execute - All Players gets a new Weapon. How can i do this? - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: One Player execute - All Players gets a new Weapon. How can i do this? (/Thread-One-Player-execute-All-Players-gets-a-new-Weapon-How-can-i-do-this.html)



One Player execute - All Players gets a new Weapon. How can i do this? - gumpo03 - 10-27-2011

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 Wink


RE: One Player execute - All Players gets a new Weapon. How can i do this? - zxz0O0 - 10-27-2011

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"); }



RE: One Player execute - All Players gets a new Weapon. How can i do this? - gumpo03 - 10-27-2011

(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?


RE: One Player execute - All Players gets a new Weapon. How can i do this? - JariZ - 10-27-2011

all players have the weapon -.-
it's just the name of the variable
please take some basic lessons before asking questions like this


RE: One Player execute - All Players gets a new Weapon. How can i do this? - gumpo03 - 10-27-2011

(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 Wink
_____________________________________________________________

Is it posible to give a player an Weapon, if the weaponname is in a variable?
like
Code:
self giveWeapon ("level.weapon", 0, false);



RE: One Player execute - All Players gets a new Weapon. How can i do this? - zxz0O0 - 10-27-2011

(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 Wink
_____________________________________________________________

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);