03.10.2011, 20:28
I was wondering if it's possible to make commands in zcmd without sscanf since it's not fixed yet. So I was actually trying to make a command like this
getinfo name password
Here i went so far
The password is from users account
getinfo name password
Here i went so far
pawn Код:
COMMAND:getinfo(playerid, params[])
{
new Query[256], DBResult:Result;
if(sscanf(params, "dz", oname, )) return SendClientMessage(playerid, red, "/getinfo [playername] [password]");
format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s' AND `PASSWORD` = '%s'", DB_Escape(params[0]), DB_Escape(params[1]));
Result = db_query(sDatabase, Query);
if(db_num_rows(Result))
{
//Show stats
}
else
{
SendClientMessage(playerid, "Password does not much or invalid name.");
}
db_free_result(Result);
return 1;
}
The password is from users account