Hide VFormat() for SourcePawn 2 plugins.
VFormat() does not work in the v2 VM. Instead, there is a new "spread" operator, so regular Format or FormatEx will work instead.
This commit is contained in:
@@ -226,7 +226,11 @@ stock void PrintToConsoleAll(const char[] format, any ...)
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
SetGlobalTransTarget(i);
|
||||
#if defined __sourcepawn2
|
||||
FormatEx(buffer, sizeof(buffer), format, ...);
|
||||
#else
|
||||
VFormat(buffer, sizeof(buffer), format, 2);
|
||||
#endif
|
||||
PrintToConsole(i, "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,7 +391,11 @@ stock void PrintToChatAll(const char[] format, any ...)
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
SetGlobalTransTarget(i);
|
||||
#if defined __sourcepawn2
|
||||
FormatEx(buffer, sizeof(buffer), format, ...);
|
||||
#else
|
||||
VFormat(buffer, sizeof(buffer), format, 2);
|
||||
#endif
|
||||
PrintToChat(i, "%s", buffer);
|
||||
}
|
||||
}
|
||||
@@ -422,7 +426,11 @@ stock void PrintCenterTextAll(const char[] format, any ...)
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
SetGlobalTransTarget(i);
|
||||
#if defined __sourcepawn2
|
||||
FormatEx(buffer, sizeof(buffer), format, ...);
|
||||
#else
|
||||
VFormat(buffer, sizeof(buffer), format, 2);
|
||||
#endif
|
||||
PrintCenterText(i, "%s", buffer);
|
||||
}
|
||||
}
|
||||
@@ -453,7 +461,11 @@ stock void PrintHintTextToAll(const char[] format, any ...)
|
||||
if (IsClientInGame(i))
|
||||
{
|
||||
SetGlobalTransTarget(i);
|
||||
#if defined __sourcepawn2
|
||||
FormatEx(buffer, sizeof(buffer), format, ...);
|
||||
#else
|
||||
VFormat(buffer, sizeof(buffer), format, 2);
|
||||
#endif
|
||||
PrintHintText(i, "%s", buffer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ native int Format(char[] buffer, int maxlength, const char[] format, any ...);
|
||||
*/
|
||||
native int FormatEx(char[] buffer, int maxlength, const char[] format, any ...);
|
||||
|
||||
#if !defined __sourcepawn2
|
||||
/**
|
||||
* Formats a string according to the SourceMod format rules (see documentation).
|
||||
* @note This is the same as Format(), except it grabs parameters from a
|
||||
@@ -181,6 +182,7 @@ native int FormatEx(char[] buffer, int maxlength, const char[] format, any ...);
|
||||
* @error Invalid argument index.
|
||||
*/
|
||||
native int VFormat(char[] buffer, int maxlength, const char[] format, int varpos);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Converts a string to an integer.
|
||||
|
||||
Reference in New Issue
Block a user