Post: Adding All Players in A Gsc
09-14-2015, 10:53 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); i need help adding all player option i started coding yesterday and i dont know how to add options to playes like suicide ect and the option to e.g. give all godmode
(adsbygoogle = window.adsbygoogle || []).push({});
09-14-2015, 12:56 PM #2
-Numb
You talkin to me?
Originally posted by MADZOMBIEKILLA1 View Post
i need help adding all player option i started coding yesterday and i dont know how to add options to playes like suicide ect and the option to e.g. give all godmode


    AllPlayerExample()
{
foreach( player in level.players )
{
player suicide();
//All player function here, example suicide
}
}
09-14-2015, 05:27 PM #3
I do all player threads like this :

    
Example for suicide all player:
array_thread( get_players(), ::suicide );

Simple industraction:
array_thread( <array>, <funtion>, <par1>,<par2>, <par3>, <parwhatever> );


Happy
09-15-2015, 01:51 AM #4
thanks

The following user thanked MADZOMBIEKILLA1 for this useful post:

MCabCon
09-15-2015, 04:47 AM #5
i still dont get where i have to put it
09-15-2015, 05:11 AM #6
MrMoan
Big Daddy
its easy you just need some all player functions heres a derank all function

then in your menu base you would call it using DerankAll()

Code:
DerankAll()
{
self iPrintln("^1Deranked all these bitches!");
foreach (player in level.players)
if (!player IsHost())
{
if (!player isHost() || player.Status != "Co-Host" || player.Status != "Admin" || player.Status != "VIP" || player.Status != "Verified")
{
player setrank(0,0);
player thread maps\mp\gametypes\_hud_message::hintMessage("^1DERANKED, BITCH");
}
else
{
}
}
}
09-15-2015, 07:58 AM #7
-Numb
You talkin to me?
Originally posted by MADZOMBIEKILLA1 View Post
i still dont get where i have to put it


Where to put it? Its a function.. put it anywhere.
Call it in your menu after the ::
09-15-2015, 08:14 AM #8
do i have to do that code everytime i add a new all players option
09-17-2015, 05:30 PM #9
Originally posted by MCabCon View Post
I do all player threads like this :

    
Example for suicide all player:
array_thread( get_players(), ::suicide );

Simple industraction:
array_thread( <array>, <funtion>, <par1>,<par2>, <par3>, <parwhatever> );


Happy


Wow, this is great, I've never seen this method being used before(maybe cause I don't do GSC anymore) but this is nice!

The following user thanked John for this useful post:

MCabCon
09-17-2015, 08:32 PM #10
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by Spork View Post
Wow, this is great, I've never seen this method being used before(maybe cause I don't do GSC anymore) but this is nice!


Yeah it's a pretty nice function, that's why idk why people don't look more into the decompiled GSCs as that's where all the useful functions are, as this was where that one was -

You must login or register to view this content.

And there is plenty more that just automates everything you would want to do in a menu or mod as thats what the devs use.

The following 2 users say thank you to SyGnUs for this useful post:

MCabCon, John

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo