Mysql help!
#1

Hello guys, When I compile my MySQL Gamemode it give me this error.

pawn Код:
********.pwn(21508) : error 017: undefined symbol "mysql_escape_string"
This line "21508"

pawn Код:
mysql_escape_string(accountName, tmpName, MainPipeline);
And this all the Script in that line (its a command)

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;
}
At the top of Gamemode there
pawn Код:
#include <a_mysql>
- Thanks for Help +rep!
Reply


Messages In This Thread
Mysql help! - by ewida - 18.01.2014, 16:48
Re: Mysql help! - by Nourdin - 18.01.2014, 16:49
Re: Mysql help! - by Smally - 18.01.2014, 16:54
Re: Mysql help! - by ewida - 18.01.2014, 16:54
Respuesta: Re: Mysql help! - by Stront - 18.01.2014, 16:57
Re: Mysql help! - by ewida - 18.01.2014, 16:58
Re: Mysql help! - by ewida - 18.01.2014, 17:08
Re: Mysql help! - by Smally - 18.01.2014, 18:10

Forum Jump:


Users browsing this thread: 1 Guest(s)