w00dy I don't remember which ones in particular, I think perk_bulletPenetrationMultiplier
?
TheHiddenHour
Posts
-
How to turn off wall density/make all walls "bangable" -
How to turn off wall density/make all walls "bangable"You need to increase the max values of the penetration DVARs with a plugin.
-
Any Help With Ping?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
is0x4F1160
if you're interested. -
Hi, i need help to learnThere's no definitive guide or tutorial but there's a few floating around.
This is a good starter: Call of Duty 5: Scripting Syntax And Grammar
Here's a video if it's more your style: CoD 5/CoD BO3 Custom Scripting: #1 - Introduction to GSC Game Script
Google "call of duty gsc" and you'll find a few resources.
-
GSC Waitill score / points increasesLewis5441 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; } }
-
Using r_xxxx dvars through a GSC file?@Dev-Ultimateman Can you show the code you've already tried? You'd generally do something like
setDvar("r_skyTransition", "1");
ininit()
. -
Seeking A DeveloperAn open source prop hunt gamemode already exists but I can develop another if commissioned.
-
How can I find out the number of players on a team?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; }
-
i need help with this codewait 17; self iprintlnbold("^2Crouch and Press [{+actionslot 2}] To Save"); wait 5; self iprintlnbold("^6Crouch and Press [{+actionslot 3}] To spawn slide");
-
Respawn on Saved Position Code?Duui YT I mean, what you've got already looks like it should work.
-
Respawn on Saved Position Code? -
Respawn on Saved Position Code?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(); } } } }
-
can i set a timed messagesYou can thread a function containing a
for(;;)
loop and await
statement.timedMessage() { level endon("game_ended"); for(;;) { allClientsPrint("This is a message printed to all players."); wait 45; } }
Call the function like
level thread timedMessage();
ininit()
. -
Respawn on Saved Position Code?Duui YT Did you add the rest to
onPlayerSpawned()
? -
Respawn on Saved Position Code?Duui YT Show me what you've got so far.
-
[Resource] Stat Modification, Checks, Other Structures..Nice thread, I wasn't aware of some of these structs.
-
Respawn on Saved Position Code?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"); }
-
Respawn on Saved Position Code?Duui YT Wouldn't doubt it, I write most of this when I'm sleep deprived lmao.
-
Respawn on Saved Position Code?Vulgar Put this in
onPlayerSpawned()
after thewaittill
if(isDefined(self.savedOrigin) && isDefined(self.savedAngles)) { self setPlayerAngles(self.savedAngles); self setOrigin(self.savedOrigin); }
-
Removing MMS & Target Finder Attachments [Bo2]@Vexbane
Putlevel.givecustomloadout = ::givecustomloadout;
in yourinit()
function.Then paste this function somewhere in your script:
givecustomloadout() { weap = self getCurrentWeapon(); // Get the player's current weapon if(weaponHasAttachment(weap, "mms") || weaponHasAttachment(weap, "rangefinder")) { // Weapon has mms or target finder repl_weap = ""; // Ready a replacement weapon string tokens = strTok(weap, "+"); // Tokenize the current weapon string for(i = 0; i < tokens.size; i++) { // Iterate over every token token = tokens[i]; if(i == 0) { // The first token should always be the weapon name repl_weap += token; // Add weapon name to replacement string } else { // Current token is not the weapon name if(token != "mms" && token != "rangefinder") { // Token is not the mms or rangefinder attachment repl_weap += "+" + token; // Add attachment to replacement string } } } self takeWeapon(weap); // Take weapon with restricted attachment self giveWeapon(repl_weap); // Give replacement weapon if(weap == self.primaryLoadoutWeapon) { // If the weapon taken was the player's primary self switchToWeapon(repl_weap); // Switch to the replacement weapon } } }
I tested it very quickly and it seemed to work well. Let me know if you have any issues with it.