API documentation fix for some .inc files (#489)
* Fixed param information * Removed whitespace that prevented the API to generate client_disconnected information * Fixed documentation. * Update lang.inc * Documentation fix (g/s)et_user_hitzones() functions weren't generating properly in the API due to a whitespace in front of the comment blocks. @return for give item() was missing. * Whitespace prevented API documentation from generating * Update lang.inc
This commit is contained in:
@@ -26,23 +26,27 @@ enum
|
||||
timeunit_weeks,
|
||||
};
|
||||
|
||||
// seconds are in each time unit
|
||||
/* Seconds in each time unit */
|
||||
#define SECONDS_IN_MINUTE 60
|
||||
#define SECONDS_IN_HOUR 3600
|
||||
#define SECONDS_IN_DAY 86400
|
||||
#define SECONDS_IN_WEEK 604800
|
||||
|
||||
/* Stock by Brad */
|
||||
/**
|
||||
* Stock by Brad.
|
||||
*
|
||||
* @note You must add register_dictionary("time.txt") in plugin_init()
|
||||
*
|
||||
* @param id The player whose language the length should be translated to
|
||||
* @param unitCnt The number of time units you want translated into verbose text
|
||||
* @param type The type of unit (i.e. seconds, minutes, hours, days, weeks) that you are passing in
|
||||
* @param output The variable you want the verbose text to be placed in
|
||||
* @param outputLen The length of the output variable
|
||||
*
|
||||
* @noreturn
|
||||
*/
|
||||
stock get_time_length(id, unitCnt, type, output[], outputLen)
|
||||
{
|
||||
// IMPORTANT: You must add register_dictionary("time.txt") in plugin_init()
|
||||
|
||||
// id: The player whose language the length should be translated to (or 0 for server language).
|
||||
// unitCnt: The number of time units you want translated into verbose text.
|
||||
// type: The type of unit (i.e. seconds, minutes, hours, days, weeks) that you are passing in.
|
||||
// output: The variable you want the verbose text to be placed in.
|
||||
// outputLen: The length of the output variable.
|
||||
|
||||
if (unitCnt > 0)
|
||||
{
|
||||
// determine the number of each time unit there are
|
||||
@@ -74,23 +78,23 @@ stock get_time_length(id, unitCnt, type, output[], outputLen)
|
||||
new timeElement[5][33];
|
||||
|
||||
if (weekCnt > 0)
|
||||
format(timeElement[++maxElementIdx], 32, "%i %L", weekCnt, id, (weekCnt == 1) ? "TIME_ELEMENT_WEEK" : "TIME_ELEMENT_WEEKS");
|
||||
format(timeElement[++maxElementIdx], charsmax(timeElement[]), "%i %L", weekCnt, id, (weekCnt == 1) ? "TIME_ELEMENT_WEEK" : "TIME_ELEMENT_WEEKS");
|
||||
if (dayCnt > 0)
|
||||
format(timeElement[++maxElementIdx], 32, "%i %L", dayCnt, id, (dayCnt == 1) ? "TIME_ELEMENT_DAY" : "TIME_ELEMENT_DAYS");
|
||||
format(timeElement[++maxElementIdx], charsmax(timeElement[]), "%i %L", dayCnt, id, (dayCnt == 1) ? "TIME_ELEMENT_DAY" : "TIME_ELEMENT_DAYS");
|
||||
if (hourCnt > 0)
|
||||
format(timeElement[++maxElementIdx], 32, "%i %L", hourCnt, id, (hourCnt == 1) ? "TIME_ELEMENT_HOUR" : "TIME_ELEMENT_HOURS");
|
||||
format(timeElement[++maxElementIdx], charsmax(timeElement[]), "%i %L", hourCnt, id, (hourCnt == 1) ? "TIME_ELEMENT_HOUR" : "TIME_ELEMENT_HOURS");
|
||||
if (minuteCnt > 0)
|
||||
format(timeElement[++maxElementIdx], 32, "%i %L", minuteCnt, id, (minuteCnt == 1) ? "TIME_ELEMENT_MINUTE" : "TIME_ELEMENT_MINUTES");
|
||||
format(timeElement[++maxElementIdx], charsmax(timeElement[]), "%i %L", minuteCnt, id, (minuteCnt == 1) ? "TIME_ELEMENT_MINUTE" : "TIME_ELEMENT_MINUTES");
|
||||
if (secondCnt > 0)
|
||||
format(timeElement[++maxElementIdx], 32, "%i %L", secondCnt, id, (secondCnt == 1) ? "TIME_ELEMENT_SECOND" : "TIME_ELEMENT_SECONDS");
|
||||
format(timeElement[++maxElementIdx], charsmax(timeElement[]), "%i %L", secondCnt, id, (secondCnt == 1) ? "TIME_ELEMENT_SECOND" : "TIME_ELEMENT_SECONDS");
|
||||
|
||||
switch(maxElementIdx)
|
||||
{
|
||||
case 0: format(output, outputLen, "%s", timeElement[0]);
|
||||
case 1: format(output, outputLen, "%s %L %s", timeElement[0], id, "TIME_ELEMENT_AND", timeElement[1]);
|
||||
case 2: format(output, outputLen, "%s, %s %L %s", timeElement[0], timeElement[1], id, "TIME_ELEMENT_AND", timeElement[2]);
|
||||
case 3: format(output, outputLen, "%s, %s, %s %L %s", timeElement[0], timeElement[1], timeElement[2], id, "TIME_ELEMENT_AND", timeElement[3]);
|
||||
case 4: format(output, outputLen, "%s, %s, %s, %s %L %s", timeElement[0], timeElement[1], timeElement[2], timeElement[3], id, "TIME_ELEMENT_AND", timeElement[4]);
|
||||
case 0: formatex(output, outputLen, "%s", timeElement[0]);
|
||||
case 1: formatex(output, outputLen, "%s %L %s", timeElement[0], id, "TIME_ELEMENT_AND", timeElement[1]);
|
||||
case 2: formatex(output, outputLen, "%s, %s %L %s", timeElement[0], timeElement[1], id, "TIME_ELEMENT_AND", timeElement[2]);
|
||||
case 3: formatex(output, outputLen, "%s, %s, %s %L %s", timeElement[0], timeElement[1], timeElement[2], id, "TIME_ELEMENT_AND", timeElement[3]);
|
||||
case 4: formatex(output, outputLen, "%s, %s, %s, %s %L %s", timeElement[0], timeElement[1], timeElement[2], timeElement[3], id, "TIME_ELEMENT_AND", timeElement[4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user