progressbar include

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • progressbar include

    Hey,
    ich wollte das progress2 include einfügen, jedoch bekomme ich 3 Warnings

    Quellcode

    1. warning 231: state specification on forward declaration is ignored
    2. warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
    3. warning 203: symbol is never used: "_progress2_renderBar"
    Das "is never used" erklärt sich ja von selbst, aber mit dem ersten Warning kann ich nichts anfangen, das kommt in der Zeile wo "OnGameModeExit" beginnt.
    Das zweite Warning kommt unter sscanf in Zeile 171: pastebin.com/kJDRkkbJ
  • Mit sscanf versuche es mal so

    Spoiler anzeigen

    PAWN-Quellcode

    1. stock sscanf(string[], format[], {Float,_}:...)
    2. {
    3. #if defined isnull
    4. if (isnull(string))
    5. #else
    6. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
    7. #endif
    8. {
    9. return format[0];
    10. }
    11. new
    12. formatPos = 0,
    13. stringPos = 0,
    14. paramPos = 2,
    15. paramCount = numargs(),
    16. delim = ' ';
    17. while (string[stringPos] && string[stringPos] <= ' ')
    18. {
    19. stringPos++;
    20. }
    21. while (paramPos < paramCount && string[stringPos])
    22. {
    23. switch (format[formatPos++])
    24. {
    25. case '\0':
    26. {
    27. return 0;
    28. }
    29. case 'i', 'd':
    30. {
    31. new
    32. neg = 1,
    33. num = 0,
    34. ch = string[stringPos];
    35. if (ch == '-')
    36. {
    37. neg = -1;
    38. ch = string[++stringPos];
    39. }
    40. do
    41. {
    42. stringPos++;
    43. if ('0' <= ch <= '9')
    44. {
    45. num = (num * 10) + (ch - '0');
    46. }
    47. else
    48. {
    49. return -1;
    50. }
    51. }
    52. while ((ch = string[stringPos]) > ' ' && ch != delim);
    53. setarg(paramPos, 0, num * neg);
    54. }
    55. case 'h', 'x':
    56. {
    57. new
    58. num = 0,
    59. ch = string[stringPos];
    60. do
    61. {
    62. stringPos++;
    63. switch (ch)
    64. {
    65. case 'x', 'X':
    66. {
    67. num = 0;
    68. continue;
    69. }
    70. case '0' .. '9':
    71. {
    72. num = (num << 4) | (ch - '0');
    73. }
    74. case 'a' .. 'f':
    75. {
    76. num = (num << 4) | (ch - ('a' - 10));
    77. }
    78. case 'A' .. 'F':
    79. {
    80. num = (num << 4) | (ch - ('A' - 10));
    81. }
    82. default:
    83. {
    84. return -1;
    85. }
    86. }
    87. }
    88. while ((ch = string[stringPos]) > ' ' && ch != delim);
    89. setarg(paramPos, 0, num);
    90. }
    91. case 'c':
    92. {
    93. setarg(paramPos, 0, string[stringPos++]);
    94. }
    95. case 'f':
    96. {
    97. new
    98. end = stringPos - 1,
    99. ch;
    100. while ((ch = string[++end]) && ch != delim) {}
    101. string[end] = '\0';
    102. setarg(paramPos,0,_:floatstr(string[stringPos]));
    103. string[end] = ch;
    104. stringPos = end;
    105. }
    106. case 'p':
    107. {
    108. delim = format[formatPos++];
    109. continue;
    110. }
    111. case '\'':
    112. {
    113. new
    114. end = formatPos - 1,
    115. ch;
    116. while ((ch = format[++end]) && ch != '\'') {}
    117. if (!ch)
    118. {
    119. return -1;
    120. }
    121. format[end] = '\0';
    122. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
    123. {
    124. if (format[end + 1])
    125. {
    126. return -1;
    127. }
    128. return 0;
    129. }
    130. format[end] = '\'';
    131. stringPos = ch + (end - formatPos);
    132. formatPos = end + 1;
    133. }
    134. case 'u':
    135. {
    136. new
    137. end = stringPos - 1,
    138. id = 0,
    139. bool:num = true,
    140. ch;
    141. while ((ch = string[++end]) && ch != delim)
    142. {
    143. if (num)
    144. {
    145. if ('0' <= ch <= '9')
    146. {
    147. id = (id * 10) + (ch - '0');
    148. }
    149. else
    150. {
    151. num = false;
    152. }
    153. }
    154. }
    155. if (num && IsPlayerConnected(id))
    156. {
    157. setarg(paramPos, 0, id);
    158. }
    159. else
    160. {
    161. #if !defined foreach
    162. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
    163. #define __SSCANF_FOREACH__
    164. #endif
    165. string[end] = '\0';
    166. num = false;
    167. new
    168. name[MAX_PLAYER_NAME];
    169. id = end - stringPos;
    170. foreach (Player, playerid)
    171. {
    172. GetPlayerName(playerid, name, sizeof (name));
    173. if (!strcmp(name, string[stringPos], true, id))
    174. {
    175. setarg(paramPos, 0, playerid);
    176. num = true;
    177. break;
    178. }
    179. }
    180. if (!num)
    181. {
    182. setarg(paramPos, 0, INVALID_PLAYER_ID);
    183. }
    184. string[end] = ch;
    185. #if defined __SSCANF_FOREACH__
    186. #undef foreach
    187. #undef __SSCANF_FOREACH__
    188. #endif
    189. }
    190. stringPos = end;
    191. }
    192. case 's', 'z':
    193. {
    194. new
    195. i = 0,
    196. ch;
    197. if (format[formatPos])
    198. {
    199. while ((ch = string[stringPos++]) && ch != delim)
    200. {
    201. setarg(paramPos, i++, ch);
    202. }
    203. if (!i)
    204. {
    205. return -1;
    206. }
    207. }
    208. else
    209. {
    210. while ((ch = string[stringPos++]))
    211. {
    212. setarg(paramPos, i++, ch);
    213. }
    214. }
    215. stringPos--;
    216. setarg(paramPos, i, '\0');
    217. }
    218. default:
    219. {
    220. continue;
    221. }
    222. }
    223. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
    224. {
    225. stringPos++;
    226. }
    227. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
    228. {
    229. stringPos++;
    230. }
    231. paramPos++;
    232. }
    233. do
    234. {
    235. if ((delim = format[formatPos++]) > ' ')
    236. {
    237. if (delim == '\'')
    238. {
    239. while ((delim = format[formatPos++]) && delim != '\'') {}
    240. }
    241. else if (delim != 'z')
    242. {
    243. return delim;
    244. }
    245. }
    246. }
    247. while (delim > ' ');
    248. return 0;
    249. }
    Alles anzeigen
  • Jadeclon schrieb:

    Hier die Include pastebin.com/rwRMcwsw
    Zeile 333:
    Das könntest du, um die eine Warnung los zu werden, hierzu ändern:

    PAWN-Quellcode

    1. stock _progress2_renderBar(playerid, barid)


    Die zweite Warnung (59461) scheint woanders her zu kommen.

    Jadeclon schrieb:

    pastebin.com/zdD3b7Nr (Siehe Zeile 37.)
    Ändere die Zeile 37 zu:

    PAWN-Quellcode

    1. foreach (new playerid : Player)


    Gegebenenfalls steht dort noch irgendwo "new playerid", dann müsste das entfernt werden. Oder du versuchst es hier ohne das new.

    PAWN-Quellcode

    1. foreach (playerid : Player)

  • @Jeffry
    Warnings sind jetzt alle weg, aber der Gamemode lädt nicht mehr...

    PAWN-Quellcode

    1. [12:43:16] Script[gamemodes/T2R.amx]: Run time error 19: "File or function is not found"
    2. [12:43:16] Number of vehicle models: 0
    3. [12:43:45] [connection] 127.0.0.1:58548 requests connection cookie.
    4. [12:43:46] [connection] incoming connection: 127.0.0.1:58548 id: 0
    5. [12:43:46] [join] Jadeclon has joined the server (0:127.0.0.1)
    6. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    7. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    8. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    9. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    10. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    11. [12:43:52] [sampgdk:error] Too many callback arguments (at most 32 allowed)
    12. [12:43:52] [part] Jadeclon has left the server (0:1)
    Alles anzeigen
  • @Jeffry

    Quellcode

    1. [16:02:53] [debug] Run time error 4: "Array index out of bounds"
    2. [16:02:53] [debug] Attempted to read/write array element at index 1000 in array of size 1000
    3. [16:02:53] [debug] AMX backtrace:
    4. [16:02:53] [debug] #0 0029921c in public TachoTimer () in T2R.amx
    TachoTimer ist wie der Name schon sagt n Timer, der jede Sekunde ausgeführt wird.