10.09.2012, 07:26
Lorenc_,
Can you please explain this part :
I am new to scripting i just want to know why are you looping ? Why don't you just use :
And also Do i need the DB_Escape stock :
Is it necessary ?
Can you please explain this part :
pawn Code:
public OnFilterScriptExit()
{
for(new i; i != MAX_PLAYERS; i++) OnPlayerDisconnect(i, 1);
db_close(Database);
return 1;
}
pawn Code:
db_close(Database);
pawn Code:
stock DB_Escape(text[])
{
new
ret[80 * 2],
ch,
i,
j;
while ((ch = text[i++]) && j < sizeof (ret))
{
if (ch == '\'')
{
if (j < sizeof (ret) - 2)
{
ret[j++] = '\'';
ret[j++] = '\'';
}
}
else if (j < sizeof (ret))
{
ret[j++] = ch;
}
else
{
j++;
}
}
ret[sizeof (ret) - 1] = '\0';
return ret;
}