14.05.2017, 07:42
PHP код:
CMD:setpass(playerid, params[])
{
if(pData[playerid][Admin] >= 9)
{
new accname[MAX_PLAYER_NAME+2], newpass[60], str[128];
if(sscanf(params, "s[24]s[60]", accname, newpass))
{
SendClientMessage(playerid, COLOR_ORANGE, "USAGE : /setpass [Account Name] [New Password]");
return SendClientMessage(playerid, orange, "Function : Will set a new password for the account specified as 'playername'");
}
if(strlen(accname) > 24 || strlen(accname) < 0) return SendClientMessage(playerid, red, "ERROR : Account name out of bounds! (Character limit : 0-24)");
if(strlen(newpass) > 60 || strlen(newpass) < 0) return SendClientMessage(playerid, red, "ERROR : Password input out of bounds! (Character limit : 0-60)");
new query[200];
format(query, 256, "SELECT `username` FROM `players` WHERE `username` = '%s'", accname);
mysql_query(query);
mysql_store_result();
if(cache_num_rows() > 0)
{
format(str, sizeof(str), "You've successfully set '%s' as password for the account : '%s'", newpass, accname);
SendClientMessage(playerid, COLOR_GREEN, str);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
format(query, sizeof(query), "UPDATE `playerdata` SET password=SHA1('%s') WHERE user='%s'", newpass, accname);
mysql_query(query);
}
else if(cache_num_rows() <= 0)
{
format(str, sizeof(str), "ERROR : The account named '%s' does not exist on the database!", accname);
SendClientMessage(playerid, red, str); }
mysql_free_result();
}
else return SendClientMessage(playerid, COLOR_YELLOW, "Sorry, Only +level 9 can use this command.");
return 1;
}
Код:
D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12681) : error 035: argument type mismatch (argument 1) D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12682) : error 017: undefined symbol "mysql_store_result" D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12689) : error 035: argument type mismatch (argument 1) D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn(12695) : error 017: undefined symbol "mysql_free_result"