This command takes quite long to get to params..
#3

No, this is the only command it does it for... Also, Can you tell me how I can search for part of a name from something like this:

Example if I searched "Grant" How could I get EVERY result from that with "Grant"?
pawn Код:
CMD:findnumber(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    if(Phonebook[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You do not have a phonebook, you can buy one from a store.");
    new player[24],string[128], query[256];
    if(sscanf(params, "s[24]",player)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /findnumber [player name]");
   
   
    format(query, sizeof(query), "SELECT `Number` FROM `accounts` WHERE `PlayerName` = '%s'", player);
    mysql_query(query); // No query line
    mysql_store_result(); // "Error nothing to store"
    new rows = mysql_num_rows();
    new msnum = mysql_fetch_int();
    if(rows > 0)
        {
            format(string, sizeof(string), "%s - %d", player, msnum);
            SendClientMessage(playerid, COLOUR_WHITE, string);
        }
    if(rows == 0)
        {
            SendClientMessage(playerid, COLOUR_GREY, "There was no numbers found with that name.");
        }
        mysql_free_result();
    return 1;
}
Reply


Messages In This Thread
This command takes quite long to get to params.. - by Dokins - 02.03.2012, 22:42
Re: This command takes quite long to get to params.. - by Scenario - 02.03.2012, 23:23
Re: This command takes quite long to get to params.. - by Dokins - 02.03.2012, 23:28
Re: This command takes quite long to get to params.. - by Jefff - 02.03.2012, 23:32
Re: This command takes quite long to get to params.. - by Dokins - 02.03.2012, 23:35
Re: This command takes quite long to get to params.. - by Jefff - 02.03.2012, 23:37
Re: This command takes quite long to get to params.. - by Dokins - 02.03.2012, 23:40

Forum Jump:


Users browsing this thread: 4 Guest(s)