15.10.2016, 02:05
hey guys i did this cmd but i want to show me only houses from players who didn't connect for 5 mins i will make it for 1 month but to test it only 5 mins
why isn't working?
Код HTML:
CMD:houselist(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
if(!IsManager(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
new aim[1500], tstring[100];
format(tstring, sizeof(tstring),"{FFFFFF}Lista caselor cumparate");
new memid = 0;
gQuery[0] = (EOS);
mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `Name`,`HouseKey`,`LastLogin` FROM `players` WHERE `HouseKey` > 0 ORDER BY `HouseKey` DESC LIMIT 100");
new Cache:result = mysql_query (handle, gQuery);
new iResult[64];
new test[32], query[32], test1[32], houseOwnerLastOn;
new coordsstring[250] = "Name\tCheia de la casa\tLast Login\n";
for ( new i, j = cache_get_row_count ( ); i != j; ++i )
{
cache_get_field_content(i, "Name", iResult); format(query, 32, iResult);
format(Selected[memid][snume],32, query);
cache_get_field_content(i, "HouseKey", iResult); format(test, 32, iResult);
houseOwnerLastOn = cache_get_field_content(i, "LastLogin", iResult); format(test1, 32, iResult);
if((gettime()-houseOwnerLastOn) >= 300)
{
new id = GetPlayerID(Selected[memid][snume]);
if(id != INVALID_PLAYER_ID)
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\tOnline\n", query, test);
strcat(aim, gString);
}
else
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\t%s\n", query, test, test1);
strcat(aim, gString);
}
memid ++;
}
}
cache_delete(result);
strins(aim, coordsstring, 0);
ShowPlayerDialog(playerid,3363566,DIALOG_STYLE_TABLIST_HEADERS,tstring,aim,"Alege","Iesi");
return 1;
}

