Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

TheHiddenHourundefined

TheHiddenHour

@TheHiddenHour
Contributor
About
Posts
55
Topics
1
Groups
1
Followers
6
Following
4

Posts

Recent Best Controversial

  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Duui YT Did you add the rest to onPlayerSpawned()?


  • [Resource] Stat Modification, Checks, Other Structures..
    TheHiddenHourundefined TheHiddenHour

    Nice thread, I wasn't aware of some of these structs.


  • How can I find out the number of players on a team?
    TheHiddenHourundefined TheHiddenHour

    There's probably a built in function to do it but you can write a simple one like this.

    getTeamCount(team) {
    	count = 0;
    	foreach(player in level.players) {
    		if(player.team == team) {
    			count++;
    		}
    	}
    	
    	return count;
    }
    

  • [Release] GSC Dump Searcher
    TheHiddenHourundefined TheHiddenHour

    GSC Dump Search

    This program will search the contents of every GSC file in the defined directory for a specified string and return its usage, path, and line. It is also able to show the origin script with syntax highlighting by double clicking the location cell of the search results.

    Photos

    Main Form

    Main Form

    GSC Peek Form

    GSC Peek Form

    Notes

    You must provide your own decompiled GSC dump. The program looks for a folder named gsc-dump at the root of the program directory and can be changed in config.json.

    All of the toolbar functionality is also missing at the moment.

    Downloads

    GitHub Source
    GitHub Releases
    Full GSC Dump (SP, MP, & ZM scripts)
    Trimmed GSC Dump (Only MP & ZM scripts)

    I did not make these dumps. I came to possess them long ago from people on other forums.


  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Duui YT If you commission me to write it, test it, and ensure that you incorporate it into your project properly then yeah lmao.

    Here's a simple example that should get you started if you know how to script

    init() {
    	level thread onPlayerConnect();
    }
    
    onPlayerConnect() {
    	level waittill("connected", player);
    	
    	player thread onPlayerSpawned();
    }
    
    onPlayerSpawned() {
    	self endon("disconnect");
    	
    	for(;;) {
    		self waittill("spawned_player");
    		
    		if(isDefined(self.savedOrigin) && isDefined(self.savedAngles)) {
    			self moveToSavedLocation();
    		}
    	}
    }
    
    // Set saved location 
    saveLocation() {
    	self.savedOrigin = self.origin;
    	self.savedAngles = self.angles;
    	
    	self iprintln("^1Saved location");
    }
    
    // Move entity to saved location 
    moveToSavedLocation() {
    	self setOrigin(self.savedOrigin);
    	self.angles = self.savedAngles; // Can't remember if there's a function to set an entity's angles 
    	
    	self iprintln("^1Moved to saved location");
    }
    
    // Erase saved location to prevent spawning on it 
    eraseSavedLocation() {
    	self.savedOrigin = undefined;
    	self.savedAngles = undefined;
    	
    	self iprintln("^1Saved location erased");
    }
    

  • Should I work on a new GSC editor?
    TheHiddenHourundefined TheHiddenHour

    Ducxy said in Should I work on a new GSC editor?:

    monaco editor

    I'd actually like to see something more akin to a VS Code plugin rather than an entirely new editor. It'd allow me to continue using my VS Code settings and would probably have a smaller footprint as well 😊 .


  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Vulgar Put this in onPlayerSpawned() after the waittill

    if(isDefined(self.savedOrigin) && isDefined(self.savedAngles)) {
    	self setPlayerAngles(self.savedAngles);
    	self setOrigin(self.savedOrigin);
    }
    

  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Vulgar

    toggleSaveAndLoad() {
    	if(!isDefined(self.saveAndLoad) || !self.saveAndLoad) {
    		self.saveAndLoad = true;
    		self thread saveAndLoad();
    	}
    	else {
    		self.saveAndLoad = false;
    		self notify("endSaveAndLoad");
    	}
    	msg = "Save and Load [" + (self.saveAndLoad) ? "^2ON" : "^1OFF" + "^7]";
    	self iprintln(msg);
    }
    
    saveAndLoad() {
    	self endon("disconnect");
    	self endon("endSaveAndLoad")
    	
    	for(;;) {
    		if(self getStance() == "crouch") {
    			if(self actionSlotTwoButtonPressed()) { // Save location 
    				self.savedOrigin = self.origin;
    				self.savedAngles = self.angles;
    				self iprintln("^5Position saved");
    			}
    			else if(self actionSlotOneButtonPressed()) { // Load location 
    				self setPlayerAngles(self.savedAngles);
    				self setOrigin(self.savedOrigin);
    				self iprintln("^6Position loaded");
    			}
    		}
    		
    		wait .01;
    	}
    }
    

    Untested.


  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Duui YT

    if(isDefined(self.savedOrigin) && isDefined(self.savedAngles))
    		   self setPerk("specialty_fallheight");
    

    🤔

    if( self.status == "Host" || self.status == "Co-Host" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
    		{
    			if (!self.MenuInit)
    			{
    		        self moveToSavedLocation();
    			}
    		}
    

    🤔 🤔 🤔

    Give this a try

    onplayerspawned()
    {
        self endon( "disconnect" );
        level endon( "game_ended" );
    	
        self freezecontrols(false);
        self.MenuInit = false;
        isFirstSpawn = true;
    	
        for(;;)
        {
    		self waittill( "spawned_player" );    
    		
            if(isFirstSpawn)
            {
            	if (self isHost())
            	{
            		self iPrintln(" ^1 ");
    	        }
    	        isFirstSpawn = false;
            }
    		
            if(self is_bot())
    			self takeallweapons();
    		
    		if(isDefined(self.savedOrigin) && isDefined(self.savedAngles))
    		   self moveToSavedLocation();
    	   
    		if( self.status == "Host" || self.status == "Co-Host" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
    		{
    			if (!self.MenuInit)
    			{
    		        // self moveToSavedLocation();
    			}
    		}
        }
    } 
    

  • Respawn on Saved Position Code?
    TheHiddenHourundefined TheHiddenHour

    Duui YT I mean, what you've got already looks like it should work.


  • i need help with this code
    TheHiddenHourundefined TheHiddenHour

    Duui YT

    wait 17;
    self iprintlnbold("^2Crouch and Press [{+actionslot 2}] To Save"); 
    wait 5;
    self iprintlnbold("^6Crouch and Press [{+actionslot 3}] To spawn slide");
    

  • GSC Waitill score / points increases
    TheHiddenHourundefined TheHiddenHour

    Lewis5441 There's a couple ways of checking for score changes but I'm unaware of a notify for it. Here's a simple method though.

    scoreMonitor() {
    	self endon("disconnect");
    	self endon("game_ended");
    	
    	// Setup variables required for monitoring score 
    	currentScore = self.pers["score"];
    	previousScore = currentScore;
    	
    	for(;;) {
    		// Check for score change 
    		currentScore = self.pers["score"];
    		if(currentScore != previousScore) {
    			// Update previous score 
    			previousScore = currentScore;
    			// Insert your code here 
    			self iprintln(self.name + "'s score has changed!");
    		}
    		
    		wait 0.05;
    	}
    }
    

  • Any Help With Ping?
    TheHiddenHourundefined TheHiddenHour

    Deicide I doubt it's accessible through GSC but you could probably do it using a plugin. SV_GetClientPing comes to mind.

    EDIT: Address for SV_GetClientPing is 0x4F1160 if you're interested.


  • How to turn off wall density/make all walls "bangable"
    TheHiddenHourundefined TheHiddenHour

    You need to increase the max values of the penetration DVARs with a plugin.

  • 1 / 1
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate