I'm abit confused about the description about this native,
I am using this like VFormat but then for a native, can some1 tell me what the vallues should be or explain a lil better with this example:
Current Description:
Code:
FormatNativeString
Syntax:
native FormatNativeString(out_param,
fmt_param,
vararg_param,
out_len,
&written=0,
String:out_string[]="",
const String:fmt_string[]="");
Usage:
out_param Output parameter number to write to. If 0, out_string is used.
fmt_param Format parameter number. If 0, fmt_string is used.
vararg_param First variable parameter number.
out_len Output string buffer maximum length (always required).
written Optionally stores the number of bytes written.
out_string Output string buffer to use if out_param is not used.
fmt_string Format string to use if fmt_param is not used.
Notes:
Formats a string using parameters from a native.
Return:
SP_ERROR_NONE on success, anything else on failure.
PHP Code:
// _PrintToChat(client, String:Msg[]="", Any:...)
public Native__PrintToChat(Handle:plugin, NumParams)
{
new client = GetNativeCell(1);
new String:szMessage[256];
GetNativeString(2, szMessage, sizeof(szMessage));
new String:szFinalMsg[256];
out_param : The initial string in the native (in above example as Msg[]="" or parameter 2 (printtochat) (and parameter 1 in printtochatall)?
fmt_param : Where to format the message to, if String not provided in native, use 0 to assign my own string to write it into?
vararg_param : Where the Any:... parameter is in the native (in above example as parameter 3)?
out_len : Maxlen of final formatted msg?
I figured it out eventually, but now i got a diffrent problem, check post below
__________________
Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
After testing a few things out, i did get it so you can ignore above message, but now that this works, i occasionally see my plugin printing out this: 1.5.0-dev+3822 while i never programmed to do this, i doesnt always show this in full (took screenshots) i was wondering if anyone knows why its doing this or what i can do to fix this.
this while i am using:
SourceMod 1.5.4-dev+4036, by AlliedModders LLC
screenshots
very strange scenario :s
EDIT:
Lol ok found the problem, the fmt_param was off by 1 to much, works like it should now
The correct use:
PHP Code:
//_PrintToChat(client, String:Msg[]="", Any:...); public Native__PrintToChat(Handle:plugin, NumParams) { new client = GetNativeCell(1); new String:szMessage[256]; GetNativeString(2, szMessage, sizeof(szMessage)); new String:szFinalMsg[256];
// _PrintToChatAll(Msg[]="", SkipClient=0, Any:...) public Native__PrintToChatAll(Handle:plugin, NumParams) { new String:szMessage[256]; GetNativeString(1, szMessage, sizeof(szMessage)); new skipAclient = GetNativeCell(2); new String:szFinalMsg[256];