How to use zcmd without sscanf
#1

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

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
Reply


Messages In This Thread
How to use zcmd without sscanf - by CrazyLess - 03.10.2011, 20:28
Re: How to use zcmd without sscanf - by CyNiC - 03.10.2011, 20:57
Re: How to use zcmd without sscanf - by Scenario - 03.10.2011, 21:32
Re : How to use zcmd without sscanf - by Naruto_Emilio - 03.10.2011, 22:36
Re: How to use zcmd without sscanf - by DRIFT_HUNTER - 03.10.2011, 22:44
Re: How to use zcmd without sscanf - by Surferdude - 04.10.2011, 00:28

Forum Jump:


Users browsing this thread: 1 Guest(s)