20.08.2010, 17:32
Hi,
I got this function
I want it act like this:
So, is it possible to specify an optional string in the function? Like with integers or floats:
I got this function
pawn Code:
stock PInfoStr(p, varname[], str[])
pawn Code:
stock PInfoStr(p, varname[], str[])
{
if(str[] is specified, ex:'PInfoStr(playerid, "bob", "ohshi")' )
{
SetPVarString(p, varname, str);
return 1;
}
else if(str[] not specified, ex:'PInfoStr(playerid, "bob")' )
{
new tempstr[128];
GetPVarString(p, varname, tempstr, sizeof(tempstr));
return tempstr;
}
}
pawn Code:
SomeFunc(playerid, iwontusethis=1)