Check is the user already own it
#2

You can do it using cache_get_row_count read the wiki, here's an example

pawn Код:
CMD:yourcommand(playerid, params[])
{
    new query[160+MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];

    GetPlayerName(playerid, name, sizeof(name));
    mysql_format(handle, query, sizeof(query), "SELECT * FROM `Storage_tents` WHERE `OwnerName` = '%s'", name);
    mysql_tquery(handle, query, "CheckStorageTent", "i", playerid);
    return 1;
}
forward CheckStorageTent(playerid);
public CheckStorageTent(playerid)
{
    if(cache_get_row_count(handle) == 5)
    {
        return SendClientMessage(playerid, -1, "You own 5 tents already!");
    }
    else
    {
        //show player the dialog and the rest of your code here
    }
    return 1;
}
Reply


Messages In This Thread
Check is the user already own it - by DarkMythHunter - 12.01.2019, 05:11
Re: Check is the user already own it - by d3Pedro - 12.01.2019, 05:39
Re: Check is the user already own it - by DarkMythHunter - 12.01.2019, 05:55

Forum Jump:


Users browsing this thread: 1 Guest(s)