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

[TUT] SourcePawn Scripting - Tips, Basics to Advanced


Post New Thread Reply   
 
Thread Tools Display Modes
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 12-03-2020 , 13:59   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #41

Addition for "3. Connect to Server" section.

Recently, they updated something in security, and a method for running client via left4dead2.exe (with arguments) in the same machine with a server is no more working.

Instead, here is a walkaround to run the app directly from steam.exe.
I'm attaching the full code of .bat script (to run server + join simultaneously):

Spoiler


For other games, change appID 550 by your game's Id from steam.inf file, and GAME_ALIAS value with an appropriate game name alias.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 01-10-2021 at 10:29.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-10-2021 , 14:38   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #42

Published Russian translation of the article, with some additions:

Spoiler
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Uncle Jessie
Member
Join Date: May 2016
Location: Mind Prison
Old 04-04-2021 , 04:52   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #43

Something like this is useful too
Using this script instead of the random start map plugins

Spoiler
Uncle Jessie is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-09-2021 , 08:43   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #44

Half-Life Position, Velocity, and Angles (for n00bs)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Mystik Spiral
Senior Member
Join Date: Oct 2020
Location: Orlando, FL
Old 07-05-2021 , 16:11   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #45

On the first page, in section...

...and subheading...

Code:
SourcePawn specific editors
...please consider adding a link for...

Code:
SPCode - fork of SPEdit which aims to fix issues and add some small features
__________________
Mystik Spiral is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 07-06-2021 , 05:05   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #46

Done. Thanks.
__________________
Silvers is offline
little_froy
Senior Member
Join Date: May 2021
Old 08-19-2021 , 09:44   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #47

strcmp() provides less readable and worse compatibility compared to StrContains()
little_froy is online now
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 08-19-2021 , 14:17   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #48

You can also mention the "stringize" operator (inherited from Pawn) which converts arguments to packed strings in a macro.
I don't find it that useful but still here's an example:
Code:
// Note that spaces inside parentheses count too!!! STRINGIZE( abc123 ) = " abc123 "
#define STRINGIZE(%0) #%0

ConVar myplugin_enabled; // typical toggle convar

Action ServerCmd_DoStuff(int args) {
	if ( !myplugin_enabled.BoolValue ) {
		PrintToServer( "Plugin is disabled! " ... STRINGIZE(myplugin_enabled) ... " = 0" ); // "Plugin is disabled! myplugin_enabled = 0"
		return Plugin_Handled;
	}

	// ...

	return Plugin_Handled;
}
__________________
MAGNAT2645 is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-20-2021 , 10:00   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #49

Quote:
Originally Posted by little_froy View Post
strcmp() provides less readable and worse compatibility compared to StrContains()
What kind of compatibility are you talking about?
These functions have different meanings.

MAGNAT2645, interesting ability, but IMHO, useless sample =) Can't find where it could be useful. The same can be written by manual string enquoting.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 08-20-2021 at 10:03.
Dragokas is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 08-20-2021 , 10:38   Re: [TUT] SourcePawn Scripting - Tips, Basics to Advanced
Reply With Quote #50

Quote:
Originally Posted by little_froy View Post
strcmp() provides less readable and worse compatibility compared to StrContains()
Judging by the context of how "strcmp" is referenced in the main post, I would assume that you think "StrContains" is more "readable" and has better "compatibility" when it comes to comparing two strings, which is completely false and irrelevant to the purpose of "strcmp"/"StrEqual". The "StrContains" function checks if a string contains a substring, whereas "strcmp"/"StrEqual" compares two strings to determine if they are equal. Just because a string may contain a substring that starts at index 0, doesn't mean that the string is equal to the substring.
__________________
Psyk0tik is offline
Reply


Thread Tools
Display Modes

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 07:02.


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