View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-10-2021 , 17:45   Re: #define directive parameter inside a string
Reply With Quote #4

Surely, it requires you casting or format specifier.

Hack:

PHP Code:
#define SQL_STATEMENT_NOT_EXPIRED(%1) FormatInline("DurationMinutes != 0 AND TimestampGiven + 60 * DurationMinutes < %i", %1)

char[] FormatInline(const char[] formatany ...)
{
    static 
char buffer[1024];
    
VFormat(buffersizeof(buffer), format2);
    return 
buffer;
}

public 
void OnPluginStart()
{
    
PrintToServer(SQL_STATEMENT_NOT_EXPIRED(GetTime()));

__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline