27.06.2016, 17:07
Hello.
i have a command where someone can use /help to ask a question, it stores it in the database, and i want a list with unanswered questions.
I made a code, but it doesn't load anything.
Can someone tell me what i did wrong?
Thanks.
i have a command where someone can use /help to ask a question, it stores it in the database, and i want a list with unanswered questions.
I made a code, but it doesn't load anything.
Can someone tell me what i did wrong?
Thanks.
PHP код:
COMMAND:helplist(playerid, params[])
{
new query[420];
if(!Player[playerid][Admin] && !Player[playerid][Helper]) return SendClientError(playerid,"You are not authorized to use this command");
for(new i=1; i<100; i++)
{
format(query,sizeof(query),"SELECT * FROM helplist WHERE ID='%s' AND active='1'",i);
mysql_tquery(connection,query,"helpList","ud",playerid,i);
}
return 1;
}
forward helpList(playerid,helpid);
public helpList(playerid,helpid)
{
new string[420],temp_sentby[35],temp_wat[420];
cache_get_field_content(helpid, "sentby", temp_sentby);
cache_get_field_content(helpid, "wat", temp_wat);
format(string,sizeof(string),"{FFFFFF}[{6f757d}Help ID%d{FFFFFF}] {6f757d}%s{FFFFFF}: '{6f757d}%s{FFFFFF}'",helpid,temp_sentby,temp_wat);
SendClientMessage(playerid,-1,string);
return 1;
}