hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.06.23. 21:12



Jelenlévő felhasználók

Jelenleg 367 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 366 vendég

A legtöbb felhasználó (2761 fő) 2025.01.09. 20:06-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Lezárt fórum A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Ebben mi a hiba? Nem fordítsa le
HozzászólásElküldve:2015.10.28. 14:54 
Offline
GFX-Designer
Avatar

Csatlakozott:2015.03.12. 15:06
Hozzászólások:624
Megköszönt másnak: 199 alkalommal
Megköszönték neki: 78 alkalommal
Sziasztok,
Próbáltam ezt az SMA-t lefordítani AMXX-re, de error-t dob a 88 sorban.. :? Mi lehet a gond??

SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod X
  2. * NextMap Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. * originally developed by OLO
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software Foundation,
  22. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. * In addition, as a special exception, the author gives permission to
  25. * link the code of this program with the Half-Life Game Engine ("HL
  26. * Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. * L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. * respects for all of the code used other than the HL Engine and MODs
  29. * from Valve. If you modify this file, you may extend this exception
  30. * to your version of the file, but you are not obligated to do so. If
  31. * you do not wish to do so, delete this exception statement from your
  32. * version.
  33. */
  34.  
  35. #include <amxmodx>
  36.  
  37. // WARNING: If you comment this line make sure
  38. // that in your mapcycle file maps don't repeat.
  39. // However the same map in a row is still valid.
  40. #define OBEY_MAPCYCLE
  41.  
  42. new g_nextMap[32]
  43. new g_mapCycle[32]
  44. new g_pos
  45.  
  46. public plugin_init()
  47. {
  48. register_plugin("NextMap", AMXX_VERSION_STR, "AMXX Dev Team")
  49. register_dictionary("nextmap.txt")
  50. register_event("30", "changeMap", "a")
  51. register_clcmd("say nextmap", "sayNextMap", 0, "- displays nextmap")
  52. register_clcmd("say currentmap", "sayCurrentMap", 0, "- display current map")
  53. register_clcmd("say ff", "sayFFStatus", 0, "- display friendly fire status")
  54. register_cvar("amx_nextmap", "", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
  55.  
  56. new szString[32], szString2[32], szString3[8]
  57.  
  58. get_localinfo("lastmapcycle", szString, 31)
  59. parse(szString, szString2, 31, szString3, 7)
  60. g_pos = str_to_num(szString3)
  61. get_cvar_string("mapcyclefile", g_mapCycle, 31)
  62.  
  63. if (!equal(g_mapCycle, szString2))
  64. g_pos = 0 // mapcyclefile has been changed - go from first
  65.  
  66. readMapCycle(g_mapCycle, g_nextMap, 31)
  67. set_cvar_string("amx_nextmap", g_nextMap)
  68. format(szString3, 31, "%s %d", g_mapCycle, g_pos) // save lastmapcycle settings
  69. set_localinfo("lastmapcycle", szString3)
  70. }
  71.  
  72. getNextMapName(szArg[], iMax)
  73. {
  74. new len = get_cvar_string("amx_nextmap", szArg, iMax)
  75.  
  76. if (ValidMap(szArg)) return len
  77. len = copy(szArg, iMax, g_nextMap)
  78. set_cvar_string("amx_nextmap", g_nextMap)
  79.  
  80. return len
  81. }
  82.  
  83. public sayNextMap()
  84. {
  85. new name[32]
  86.  
  87. getNextMapName(name, 31)
  88. print_color(0, print_chat, "%L %s", LANG_PLAYER, "NEXT_MAP", name)
  89. }
  90.  
  91. public sayCurrentMap()
  92. {
  93. new mapname[32]
  94.  
  95. get_mapname(mapname, 31)
  96. print_color(0, print_chat, "%L: %s", LANG_PLAYER, "PLAYED_MAP", mapname)
  97. }
  98.  
  99. public sayFFStatus()
  100. {
  101. print_color(0, print_chat, "%L: %L", LANG_PLAYER, "FRIEND_FIRE", LANG_PLAYER, get_cvar_num("mp_friendlyfire") ? "ON" : "OFF")
  102. }
  103.  
  104. public delayedChange(param[])
  105. {
  106. set_cvar_float("mp_chattime", get_cvar_float("mp_chattime") - 2.0)
  107. server_cmd("changelevel %s", param)
  108. }
  109.  
  110. public changeMap()
  111. {
  112. new string[32]
  113. new Float:chattime = get_cvar_float("mp_chattime")
  114.  
  115. set_cvar_float("mp_chattime", chattime + 2.0) // make sure mp_chattime is long
  116. new len = getNextMapName(string, 31) + 1
  117. set_task(chattime, "delayedChange", 0, string, len) // change with 1.5 sec. delay
  118. }
  119.  
  120. new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")"
  121.  
  122. stock bool:ValidMap(mapname[])
  123. {
  124. if ( is_map_valid(mapname) )
  125. {
  126. return true;
  127. }
  128. // If the is_map_valid check failed, check the end of the string
  129. new len = strlen(mapname) - 4;
  130.  
  131. // The mapname was too short to possibly house the .bsp extension
  132. if (len < 0)
  133. {
  134. return false;
  135. }
  136. if ( equali(mapname[len], ".bsp") )
  137. {
  138. // If the ending was .bsp, then cut it off.
  139. // the string is byref'ed, so this copies back to the loaded text.
  140. mapname[len] = '^0';
  141.  
  142. // recheck
  143. if ( is_map_valid(mapname) )
  144. {
  145. return true;
  146. }
  147. }
  148.  
  149. return false;
  150. }
  151.  
  152. #if defined OBEY_MAPCYCLE
  153. readMapCycle(szFileName[], szNext[], iNext)
  154. {
  155. new b, i = 0, iMaps = 0
  156. new szBuffer[32], szFirst[32]
  157.  
  158. if (file_exists(szFileName))
  159. {
  160. while (read_file(szFileName, i++, szBuffer, 31, b))
  161. {
  162. if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
  163.  
  164. if (!iMaps)
  165. copy(szFirst, 31, szBuffer)
  166.  
  167. if (++iMaps > g_pos)
  168. {
  169. copy(szNext, iNext, szBuffer)
  170. g_pos = iMaps
  171. return
  172. }
  173. }
  174. }
  175.  
  176. if (!iMaps)
  177. {
  178. log_amx(g_warning, szFileName)
  179. get_mapname(szFirst, 31)
  180. }
  181.  
  182. copy(szNext, iNext, szFirst)
  183. g_pos = 1
  184. }
  185.  
  186. #else
  187.  
  188. readMapCycle(szFileName[], szNext[], iNext)
  189. {
  190. new b, i = 0, iMaps = 0
  191. new szBuffer[32], szFirst[32], szCurrent[32]
  192.  
  193. get_mapname(szCurrent, 31)
  194.  
  195. new a = g_pos
  196.  
  197. if (file_exists(szFileName))
  198. {
  199. while (read_file(szFileName, i++, szBuffer, 31, b))
  200. {
  201. if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue
  202.  
  203. if (!iMaps)
  204. {
  205. iMaps = 1
  206. copy(szFirst, 31, szBuffer)
  207. }
  208.  
  209. if (iMaps == 1)
  210. {
  211. if (equali(szCurrent, szBuffer))
  212. {
  213. if (a-- == 0)
  214. iMaps = 2
  215. }
  216. } else {
  217. if (equali(szCurrent, szBuffer))
  218. ++g_pos
  219. else
  220. g_pos = 0
  221.  
  222. copy(szNext, iNext, szBuffer)
  223. return
  224. }
  225. }
  226. }
  227.  
  228. if (!iMaps)
  229. {
  230. log_amx(g_warning, szFileName)
  231. copy(szNext, iNext, szCurrent)
  232. }
  233. else
  234. copy(szNext, iNext, szFirst)
  235.  
  236. g_pos = 0
  237. }
  238. #endif
  239.  
  240. stock print_color(const id, const input[], any:...)
  241. {
  242. new count = 1, players[32]
  243. static msg[191]
  244. vformat(msg, 190, input, 3)
  245.  
  246. replace_all(msg, 190, "!g", "^4")
  247. replace_all(msg, 190, "!y", "^1")
  248. replace_all(msg, 190, "!t", "^3")
  249.  
  250. if (id) players[0] = id; else get_players(players, count, "ch")
  251. {
  252. for (new i = 0; i < count; i++)
  253. {
  254. if (is_user_connected(players[i]))
  255. {
  256. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
  257. write_byte(players[i])
  258. write_string(msg)
  259. message_end()
  260. }
  261. }
  262. }
  263. return PLUGIN_HANDLED
  264. }
  265.  

_________________
„Nem azért felejtünk el játszani, mert megöregszünk, hanem attól öregszünk meg, hogy elfelejtünk játszani.”

-MAXHACKED Website-
-HERViD Website-
► Spoiler mutatása


Hozzászólás jelentése
Vissza a tetejére
   
 
 Hozzászólás témája: Re: Ebben mi a hiba? Nem fordítsa le
HozzászólásElküldve:2015.10.28. 15:17 
Offline
Tiszteletbeli
Avatar

Csatlakozott:2014.09.08. 22:21
Hozzászólások:3014
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 555 alkalommal
A rossz témanyitás, kuka

print_color-nál nincs print_chat rész

_________________
GitHub - mforce


Hozzászólás jelentése
Vissza a tetejére
   
 
Hozzászólások megjelenítése: Rendezés 
Lezárt fórum A témát lezárták, nem szerkesztheted a hozzászólásaid, és nem küldhetsz új hozzászólást.  [2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 5 vendég


Nem nyithatsz témákat ebben a fórumban.
Nem válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole