18.01.2014, 16:48
Hello guys, When I compile my MySQL Gamemode it give me this error.
This line "21508"
And this all the Script in that line (its a command)
At the top of Gamemode there
- Thanks for Help +rep!
pawn Код:
********.pwn(21508) : error 017: undefined symbol "mysql_escape_string"
pawn Код:
mysql_escape_string(accountName, tmpName, MainPipeline);
pawn Код:
CMD:changeuserpin(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
return 1;
}
new string[128], accountName[20], password[64], query[512];
if(sscanf(params, "s[20]s[64]", accountName, password))
return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /changeuserpin [player name] [new pin]");
if(strlen(password) > 4 || !IsNumeric(password))
return SendClientMessageEx(playerid, COLOR_GREY, "The pin must be numbers, and must have 4 digits.");
new passbuffer[129];
WP_Hash(passbuffer, sizeof(passbuffer), password);
format(string, sizeof(string), "Attempting to change %s's pin...", accountName);
SendClientMessageEx(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "AdmCmd: %s's pin was changed by %s.", accountName, GetPlayerNameEx(playerid));
Log("logs/pin.log", string);
SetPVarInt(playerid, "ChangePin", 1);
new tmpName[24];
mysql_escape_string(accountName, tmpName, MainPipeline);
format(query,sizeof(query),"UPDATE `accounts` SET `Pin`='%s' WHERE `Username`='%s' AND `AdminLevel` < 2",passbuffer,tmpName);
mysql_function_query(MainPipeline, query, false, "OnChangeUserPassword", "i", playerid);
SetPVarString(playerid, "OnChangeUserPassword", tmpName);
return 1;
}
pawn Код:
#include <a_mysql>