Quote:
Originally Posted by ******
Are you complaining that there are TOO MANY comments? Most people like comments, see something I wrote in the last few minutes:
pawn Код:
hook OnPlayerConnect(playerid) { // -2 means unknown. YSI_g_sPlayerYID[playerid] = -2; broadcast _Player_IsLoggedIn(playerid); if (existproperty(8, YSIM_LOG_IN)) { new yid = getproperty(8, YSIM_LOG_IN); if (yid != -1) { // This DOES NOT use "broadcast" as it's local only. Player_DoLogin(playerid, yid); } deleteproperty(8, YSIM_LOG_IN); } else { // Can do checking in here to see if they just rejoined. //YSI_g_sPlayerYID[playerid] = -1; if (Player_RefreshPossible(ReturnPlayerName(playerid), YSI_g_sPossibleData[playerid]) == e_POSSIBLE_ERROR_NONE) { // The player is registered, default to using the selected language // even though they're not registered. Note that we may need some // bi-lingual text using both this language and the server default // language until we ascertain that this is in fact the player in // question and not just someone with the same name, so that they // stand a greater chance of understanding that this username is // taken and that they may need to leave and re-join (or add in-game // name change so they don't even need to leave and return). Langs_SetPlayerLanguage(playerid, YSI_g_sPossibleData[playerid][E_POSSIBLE_USER_LANG]); } } }
hook OnPlayerDisconnect(playerid, reason) { if (YSI_g_sPlayerYID[playerid] != -1) { // DO NOT broadcast this in case it's just because of one script being // unloaded, not the player actually leaving (and thus do everything in // different scripts separately). Player_DoLogout(playerid, YSI_g_sPlayerYID[playerid]); } YSI_g_sPlayerYID[playerid] = -2; }
And I didn't even bother with function-header comments on these ones:
pawn Код:
/*----------------------------------------------------------------------------*\ Function: Player_RemoveEntry Params: name[] - Item to remove. Return: - Notes: Wrapper for Player_AddToBuffer for removing data. \*----------------------------------------------------------------------------*/
stock Player_RemoveEntry(name[]) { INI_RemoveEntry(YSI_g_sPlayerWriteFile, name); }
In both cases the ratio of literate lines of code to descriptive lines of comments are about 1:1 (don't know if this is fluke or not).
|
yes but your script you show is more tidier than his ... its very well structed i mean as a dome not as a script..