D:\SA-MP\New Gamemode MySQL\gamemodes\NSRP.pwn(265) : warning 203: symbol is never used: "pass" D:\SA-MP\New Gamemode MySQL\gamemodes\NSRP.pwn(265) : warning 203: symbol is never used: "salt" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 2264 bytes Code size: 21540 bytes Data size: 359816 bytes Stack/heap size: 16384 bytes; estimated max. usage=264 cells (1056 bytes) Total requirements: 400004 bytes 2 Warnings.
stock CreateAccount(playerid, salt[], pass[129])
stock CreateAccount(playerid, salt[], pass[129])
{
format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Salt, Contraseсa) VALUES (\'%s\', \'%s\', \'%s\')",
returnName(playerid),
PlayerInfo[playerid][pSalt],
PlayerInfo[playerid][pPass]
);
mysql_function_query(ConexionMySQL, Query, false, "OnAccountCreate", "d", playerid);
}
case DIALOG_REGISTRO:
{
if(!response || !strlen(inputtext))
{
Kick(playerid);
}
if(strlen(inputtext) >= MAX_PASS_LENGTH)
{
return SendClientMessage(playerid, -1, "SERVER: Password must not be more than 40 characters"),
format(szDialog, sizeof(szDialog), "Bienvenido(a) %s!\nIngresa una contraseсa para registrarte en el servidor.\n\nContraseсa:", ReturnNameEx(playerid)),
ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_INPUT ,"NS:RP - Registro",szDialog,"Registrar","Salir");
}
new
Salt[30],
hash[129];
randomString(Salt, 30);
format(hash, sizeof(hash), "%s%s", Salt, inputtext);
WP_Hash(hash, sizeof(hash), hash);
CreateAccount(playerid, Salt, hash);
format(hash, sizeof(hash), "SERVER: Welcome %s", ReturnNameEx(playerid));
SendClientMessage(playerid, -1, hash);
PlayerInfo[playerid][pSkin] = NEWB_SKIN;
ToggleMainMenu(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]);
SetPlayerSkin(playerid, NEWB_SKIN);
}
}
#pragma dynamic 150000
Buscб 'new pass' y 'new salt'. Cuando los encuetres, borralos.
Luego, abajo de los includes agregб: pawn Код:
|
stock CreateAccount(playerid, salt[], pass[129])
{
format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Salt, Contraseсa) VALUES (\'%s\', \'%s\', \'%s\')",
returnName(playerid),
PlayerInfo[playerid][pSalt],
PlayerInfo[playerid][pPass]
);
mysql_function_query(ConexionMySQL, Query, false, "OnAccountCreate", "d", playerid);
}
stock CreateAccount(playerid, salt[], pass[129])
{
strmid(PlayerInfo[playerid][pSalt], salt, 0, 30);
strmid(PlayerInfo[playerid][pPass], pass, 0, 129);
format(Query, sizeof(Query), "INSERT INTO `usuarios` (Nombre, Salt, Contraseсa) VALUES (\'%s\', \'%s\', \'%s\')",
returnName(playerid),
PlayerInfo[playerid][pSalt],
PlayerInfo[playerid][pPass]
);
mysql_function_query(ConexionMySQL, Query, false, "OnAccountCreate", "d", playerid);
}
Fнjate que no estas usando las variables del stock
pawn Код:
Puedes reemplazar las variables con el nombre de los argumentos y/o en caso de que las necesites almacenar en las variables de PlayerInfo puedes asignarlas en el mismo stock, si es que no las has asignado antes. Ejemplo: pawn Код:
|