PAWN String_Manipulation.pdf
#1

I have 1 question, why in that pdf in string.inc we have strformat(dest[], size=sizeof dest,
bool: pack=false, const format[], . . .)

but in our string.inc // Downloaded from server file, we dont have it.

(( I wont hear about format() ))

Can i use strformat when i add it to sa-mp string.inc ?

string.inc [SA-MP]
Код:
/* String functions
 *
 * © Copyright 2005, ITB CompuPhase
 * This file is provided as is (no warranties).
 */
#if defined _string_included
  #endinput
#endif
#define _string_included
#pragma library String

native strlen(const string[]);
native strpack(dest[], const source[], maxlength=sizeof dest);
native strunpack(dest[], const source[], maxlength=sizeof dest);
native strcat(dest[], const source[], maxlength=sizeof dest);

native strmid(dest[], const source[], start, end, maxlength=sizeof dest);
native bool: strins(string[], const substr[], pos, maxlength=sizeof string);
native bool: strdel(string[], start, end);

native strcmp(const string1[], const string2[], bool:ignorecase=false, length=cellmax);
native strfind(const string[], const sub[], bool:ignorecase=false, pos=0);

native strval(const string[]);
native valstr(dest[], value, bool:pack=false);
native bool: ispacked(const string[]);

native uudecode(dest[], const source[], maxlength=sizeof dest);
native uuencode(dest[], const source[], numbytes, maxlength=sizeof dest);
native memcpy(dest[], const source[], index=0, numbytes, maxlength=sizeof dest);
string.inc[Original PAWN]
Код:
/* String functions
 *
 * © Copyright 2005-2011, ITB CompuPhase
 * This file is provided as is (no warranties).
 */
#pragma library String

native strlen(const string[]);
native strpack(dest[], const source[], maxlength=sizeof dest);
native strunpack(dest[], const source[], maxlength=sizeof dest);
native strcopy(dest[], const source[], maxlength=sizeof dest);
native strcat(dest[], const source[], maxlength=sizeof dest);

native strmid(dest[], const source[], start=0, end=cellmax, maxlength=sizeof dest);
native bool: strins(string[], const substr[], index, maxlength=sizeof string);
native bool: strdel(string[], start, end);

native strcmp(const string1[], const string2[], bool:ignorecase=false, length=cellmax);
native strfind(const string[], const sub[], bool:ignorecase=false, index=0);

native strval(const string[], index=0);
native valstr(dest[], value, bool:pack=true);
native bool: ispacked(const string[]);

native strformat(dest[], size=sizeof dest, bool:pack=true, const format[], {Fixed,Float,_}:...);

native uudecode(dest[], const source[], maxlength=sizeof dest);
native uuencode(dest[], const source[], numbytes, maxlength=sizeof dest);
native memcpy(dest[], const source[], index=0, numbytes, maxlength=sizeof dest);

stock bool: strequal(const string1[], const string2[], bool:ignorecase=false, length=cellmax)
    return strcmp(string1, string2, ignorecase, length) == 0;
Reply
#2

I believe SA-MP's been using the same libraries since its inception somewhere around 2005. As you can see from the copyright line, that file seems be updated in 2011.

It is unlikely that you'll get those functions to work by adding the native because they aren't implemented in the SA-MP server. Maybe it's possibly to acquire the source somewhere and to build it as a plugin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)