Raised This Month: $51 Target: $400
 12% 

Solved [L4D] Need help restoring apart of a lost plugins source file.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
monkaS
Junior Member
Join Date: Feb 2021
Old 02-22-2021 , 07:48   [L4D] Need help restoring apart of a lost plugins source file.
Reply With Quote #1

This plugin pretty much needs the source file to be of any use to servers in today's age and to be honest I have very limited knowledge when it comes to code so I hoped coming here I'd get some help. I think the .smx I decompiled was from around late 2019 and I'm fairly certain when it was available to download it originally came with the .sp for reasons I'm hoping you'll see with the attached code below.

Code:
public void:OnPluginStart()
{
	HookEvent("create_panic_event", 41, 1);
	HookEvent("round_start", 33, 1);
	HookEvent("tank_spawn", 25, 1);
	HookEvent("tank_killed", 23, 1);
	HookEvent("player_hurt", 17, 1);
	HookEvent("round_end", 21, 1);
	HookEvent("player_say", 19, 1);
	HookEvent("player_death", 15, 1);
	return 0;
}

public void:PrintMapRecord(bool:forceprint)
{
	new var1;
	if (roundinprogress && forceprint)
	{
		return 0;
	}
	new String:map[128];
	new String:record[1024];
	GetCurrentMap(map, 32);
	if (StrEqual(map, "l4d_hospital02_subway", true))
	{
		record = "360:10.63 - enk, 0pposer, Raptor, Undergo";
	}
	else
	{
		if (StrEqual(map, "l4d_hospital03_sewers", true))
		{
			record = "364:36.67 - Raptor, Scout, Skyheart, Xero";
		}
		if (StrEqual(map, "l4d_hospital04_interior", true))
		{
			record = "319:39.23 - Bloody, Dennis, JusT SLOW, 0pposer";
		}
		if (StrEqual(map, "l4d_vs_hospital05_rooftop", true))
		{
			record = "251:47.87 - 0pposer, Raptor, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_garage01_alleys", true))
		{
			record = "273:57.33 - Jim, Nesisoth, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_garage02_lots", true))
		{
			record = "168:40.43 - Jim, Nesisoth, Scout, Skyheart";
		}
		if (StrEqual(map, "l4d_smalltown02_drainage", true))
		{
			record = "300:13.80 - Dean Winchester, GerryLame, Raptor, Undergo";
		}
		if (StrEqual(map, "l4d_smalltown03_ranchhouse", true))
		{
			record = "290:39.70 - Dean Winchester, Scout, Raptor, Undergo";
		}
		if (StrEqual(map, "l4d_smalltown04_mainstreet", true))
		{
			record = "500:45.77 - Bloody, JusT SLOW, 0pposer, Raptor";
		}
		if (StrEqual(map, "l4d_vs_smalltown05_houseboat", true))
		{
			record = "322:40.80 - Bloody, JusT SLOW, 0pposer, Raptor";
		}
		if (StrEqual(map, "l4d_airport02_offices", true))
		{
			record = "226:48.67 - enk, 0pposer, Raptor, Scout";
		}
		if (StrEqual(map, "l4d_airport03_garage", true))
		{
			record = "201:22.10 - 0pposer, Raptor, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_airport04_terminal", true))
		{
			record = "270:09.60 - Bloody, Davis, JusT SLOW, 0pposer";
		}
		if (StrEqual(map, "l4d_vs_airport05_runway", true))
		{
			record = "215:33.30 - Dean Winchester, Raptor, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_farm02_traintunnel", true))
		{
			record = "286:12.94 - Dean Winchester, 0pposer, Raptor, Scout";
		}
		if (StrEqual(map, "l4d_farm03_bridge", true))
		{
			record = "210:11.80 - 0pposer, Raptor, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_vs_farm05_cornfield", true))
		{
			record = "501:17.20 - 0pposer, Raptor, Scout, Undergo";
		}
		if (StrEqual(map, "l4d_river01_docks", true))
		{
			record = "205:53.13 - Jim, Nesisoth, Scout, Skyheart";
		}
		if (StrEqual(map, "l4d_river03_port", true))
		{
			record = "483:15.73 - Dean Winchester, Tomski, Raptor, 0pposer";
		}
		if (StrEqual(map, "l4d_sv_lighthouse", true))
		{
			record = "269:19.13 - enk, 0pposer, Raptor, Scout";
		}
	}
	PrintToChatAll("\x03Map World Record is %s. GLHF!", record);
	return 0;
}
I just feel like it was meant to be edited, every friend that I have that also runs this plugin on their server has said the same thing, that they don't have the .sp either. This plugin is mega outdated now and it doesn't seem like the original maker is updating it anymore due to me not seeing it provided by him anywhere.

Attached will be the full plugin decompiled I don't know how many errors there are in the full version however the code I mainly care about, there are 12 errors that come up when running it through SM compiler and Spider Compiler, the errors are below.

SourcePawn Compiler 1.10
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2018 AlliedModders LLC

plugin.sp(1) : warning 239: 'void' is an illegal tag; use void as a type
plugin.sp(3) : error 100: function prototypes do not match
plugin.sp(4) : error 100: function prototypes do not match
plugin.sp(5) : error 100: function prototypes do not match
plugin.sp(6) : error 100: function prototypes do not match
plugin.sp(7) : error 100: function prototypes do not match
plugin.sp(8) : error 100: function prototypes do not match
plugin.sp(9) : error 100: function prototypes do not match
plugin.sp(10) : error 100: function prototypes do not match
plugin.sp(11) : error 088: cannot return a value from a void function
plugin.sp(11) : warning 213: tag mismatch
plugin.sp(14) : warning 239: 'void' is an illegal tag; use void as a type
plugin.sp(17) : error 017: undefined symbol "roundinprogress"
plugin.sp(19) : error 088: cannot return a value from a void function
plugin.sp(19) : warning 213: tag mismatch
plugin.sp(108) : error 088: cannot return a value from a void function
plugin.sp(108) : warning 213: tag mismatch
plugin.sp(16) : warning 203: symbol is never used: "var1"
Attached Files
File Type: sp Get Plugin or Get Source (Survivalplus.sp - 21 views - 17.7 KB)

Last edited by monkaS; 02-22-2021 at 12:09.
monkaS is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 02-22-2021 , 09:14   Re: [L4D] Need help restoring apart of a lost plugins source file.
Reply With Quote #2

Is better writing what you want from the plugin than providing the decompiled code, which is really hard to understand.

I see too many hard coded values, from tank hp to survival records.

What you need may have in another plugins in the forum already. (like HP notifier and damage dealt)
__________________
Marttt is offline
monkaS
Junior Member
Join Date: Feb 2021
Old 02-22-2021 , 09:48   Re: [L4D] Need help restoring apart of a lost plugins source file.
Reply With Quote #3

Quote:
Originally Posted by Marttt View Post
Is better writing what you want from the plugin than providing the decompiled code, which is really hard to understand.

I see too many hard coded values, from tank hp to survival records.

What you need may have in another plugins in the forum already. (like HP notifier and damage dealt)
Yeah apologies for being unspecific, so what I mainly want help fixing from the plugin is the chat messages that display on round starts based on what map is being played, considering they're all out of date for the most part and from looking around this is the only plugin that has what I'm looking for, at least from what I know.
monkaS is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 02-22-2021 , 10:38   Re: [L4D] Need help restoring apart of a lost plugins source file.
Reply With Quote #4

Well, I don't see much use in displaying those records but try this plugin attached. (if is what you want)

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
    
name        "Survival Records",
    
author      "Mart",
    
description "",
    
version     "1.0",
    
url         ""
}

public 
void OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
}

public 
void Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    
PrintMapRecord();
}

public 
void PrintMapRecord()
{
    
char map[64];
    
GetCurrentMap(mapsizeof(map));
    
StringToLowerCase(map);

    
char record[250];
    if (
StrEqual(map"l4d_hospital02_subway"))
        
record "360:10.63 - enk, 0pposer, Raptor, Undergo";
    else if (
StrEqual(map"l4d_hospital03_sewers"))
        
record "364:36.67 - Raptor, Scout, Skyheart, Xero";
    else if (
StrEqual(map"l4d_hospital04_interior"))
        
record "319:39.23 - Bloody, Dennis, JusT SLOW, 0pposer";
    else if (
StrEqual(map"l4d_vs_hospital05_rooftop"))
        
record "251:47.87 - 0pposer, Raptor, Scout, Undergo";
    else if (
StrEqual(map"l4d_garage01_alleys"))
        
record "273:57.33 - Jim, Nesisoth, Scout, Undergo";
    else if (
StrEqual(map"l4d_garage02_lots"))
        
record "168:40.43 - Jim, Nesisoth, Scout, Skyheart";
    else if (
StrEqual(map"l4d_smalltown02_drainage"))
        
record "300:13.80 - Dean Winchester, GerryLame, Raptor, Undergo";
    else if (
StrEqual(map"l4d_smalltown03_ranchhouse"))
        
record "290:39.70 - Dean Winchester, Scout, Raptor, Undergo";
    else if (
StrEqual(map"l4d_smalltown04_mainstreet"))
        
record "500:45.77 - Bloody, JusT SLOW, 0pposer, Raptor";
    else if (
StrEqual(map"l4d_vs_smalltown05_houseboat"))
        
record "322:40.80 - Bloody, JusT SLOW, 0pposer, Raptor";
    else if (
StrEqual(map"l4d_airport02_offices"))
        
record "226:48.67 - enk, 0pposer, Raptor, Scout";
    else if (
StrEqual(map"l4d_airport03_garage"))
        
record "201:22.10 - 0pposer, Raptor, Scout, Undergo";
    else if (
StrEqual(map"l4d_airport04_terminal"))
        
record "270:09.60 - Bloody, Davis, JusT SLOW, 0pposer";
    else if (
StrEqual(map"l4d_vs_airport05_runway"))
        
record "215:33.30 - Dean Winchester, Raptor, Scout, Undergo";
    else if (
StrEqual(map"l4d_farm02_traintunnel"))
        
record "286:12.94 - Dean Winchester, 0pposer, Raptor, Scout";
    else if (
StrEqual(map"l4d_farm03_bridge"))
        
record "210:11.80 - 0pposer, Raptor, Scout, Undergo";
    else if (
StrEqual(map"l4d_vs_farm05_cornfield"))
        
record "501:17.20 - 0pposer, Raptor, Scout, Undergo";
    else if (
StrEqual(map"l4d_river01_docks"))
        
record "205:53.13 - Jim, Nesisoth, Scout, Skyheart";
    else if (
StrEqual(map"l4d_river03_port"))
        
record "483:15.73 - Dean Winchester, Tomski, Raptor, 0pposer";
    else if (
StrEqual(map"l4d_sv_lighthouse"))
        
record "269:19.13 - enk, 0pposer, Raptor, Scout";

    if (
record[0] != 0)
        
PrintToChatAll("\x03Map World Record is %s. GLHF!"record);
}

/**
 * Converts the string to lower case.
 *
 * @param input         Input string.
 */
void StringToLowerCase(char[] input)
{
    for (
int i 0strlen(input); i++)
    {
        
input[i] = CharToLower(input[i]);
    }

Attached Files
File Type: sp Get Plugin or Get Source (l4d_survival_records.sp - 42 views - 3.3 KB)
__________________

Last edited by Marttt; 02-22-2021 at 10:42.
Marttt is offline
monkaS
Junior Member
Join Date: Feb 2021
Old 02-22-2021 , 12:08   Re: [L4D] Need help restoring apart of a lost plugins source file.
Reply With Quote #5

Works great thanks for your time.
monkaS is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode