MySQL Setname
#1

Problem: When I use the setname, samp-server.exe stops working, and it doesn't work.

What I'm trying to do: Set the players name in-game, change the current name of player in the user database to the new name.


pawn Код:
CMD:setname(playerid, params[])
{
    if(GetPlayerLevel(playerid) >= 3)
    {
        new target, newname[128];
        if(sscanf(params, "us[128]", target, newname)) return SendClientMessage(playerid, -1, ""DARKRED"USAGE: /setname [playername] [newname]");
        if(strlen(newname) < 4)
        {
            SendClientMessage(playerid,-1,""DARKRED"Please enter a username GREATER than 3 characters.");
            return 1;
        }
        SetPlayerName(target, newname);
        new query[200];
        format(query, sizeof(query), "UPDATE `users` SET `Name` = '%s' WHERE `Name` = '%s'", newname, target);
        mysql_function_query(cHandle, query, false, "", "s", target);
        SendClientMessageEx(playerid, -1, ""GREEN"You have edited %s's name. New Password: %s", target, newname);
    }
    else return NotAllowed(playerid);
    return 1;
}
}
I think the problem is with
pawn Код:
mysql_function_query(cHandle, query, false, "", "s", target);
Reply


Messages In This Thread
MySQL Setname - by Affan - 21.06.2014, 06:14
Re: MySQL Setname - by RenovanZ - 21.06.2014, 06:20
Re: MySQL Setname - by Affan - 21.06.2014, 06:22
Re: MySQL Setname - by DobbysGamertag - 21.06.2014, 08:56
Re: MySQL Setname - by Patrick - 21.06.2014, 08:59
Re: MySQL Setname - by Konstantinos - 21.06.2014, 09:31

Forum Jump:


Users browsing this thread: 1 Guest(s)