Entrance save
#4

Something like this:

pawn Код:
CMD:lastentered(playerid,params[])
{
    new faction = PlayerInfo[playerid][pFaction];
    if(faction != LSPD) return SCM(playerid, COLOR_SALMON, "Invalid faction.");
    format(query, sizeof(query), "SELECT name, timedate FROM biz_visits ORDER BY id DESC LIMIT 5");
    mysql_function_query(dbHandle, query, true, "OnQueryFinished", "d", playerid);
}

forward OnQueryFinished(playerid);
public OnQueryFinished(playerid)
{
    new rows, fields, name[MAX_PLAYER_NAME], date[16];
    cache_get_data(rows, fields);
    SCM(playerid, COLOR_SALMON, "_________Entered people:_________");
    for(new p = 0; p < rows; p++)
    {
        cache_get_field_content(p, "name", name);
        cache_get_field_content(p, "timedate", date);
        format(string, sizeof(string), "%d. %s entered at %s.", p+1, name, date);
        SCM(playerid, COLOR_WHITE, string);
    }
    return 1;
}
Reply


Messages In This Thread
Entrance save - by Darnell - 14.07.2013, 08:43
Respuesta: Entrance save - by Xabi - 14.07.2013, 09:19
Re: Entrance save - by Darnell - 14.07.2013, 11:27
Respuesta: Entrance save - by Xabi - 14.07.2013, 11:33
Re: Entrance save - by Darnell - 14.07.2013, 11:37

Forum Jump:


Users browsing this thread: 2 Guest(s)