23.08.2009, 22:30
That's because pass is a variable, it needs to be a string.
Also I've taken the liberty of re-writing this for you in dcmd/sscanf, I think it's alot easier/cleaner.
You need dcmd and sscanf, which are popular functions all over the forums
Also I've taken the liberty of re-writing this for you in dcmd/sscanf, I think it's alot easier/cleaner.
pawn Код:
dcmd_login(playerid,params[])
{
new password[20];
if(sscanf(params,"s",password)) SendClientMessage(playerid,red,"Usage: /login <password>");
else
{
new
query[128],
name[24];
GetPlayerName(playerid,name,sizeof(name));
mysql_escape_string(password,password);
format(query,sizeof(query),"SELECT id FROM `players` WHERE Nombre = '%s' AND Password = '%s'",name,password);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
//And you can continue on here yourself ;)
