hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.15. 20:57



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-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ő


Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Nem fordítja le
HozzászólásElküldve: 2015.05.11. 21:46 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.08.24. 18:28
Hozzászólások: 584
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 120 alkalommal
Helló! :hi:

Az lenne az én problémám, hogy amióta beleírtam egy MySQL mentést a pluginomba, nem tudom sehol lefordítani, de még módosítani és menteni se!
Ez lenne a mentés:
SMA Forráskód: [ Mindet kijelol ]
  1. public MySql_Init()
  2. {
  3. g_SqlTuple = SQL_MakeDbTuple(Host,User,Pass,Db)
  4.  
  5. new ErrorCode,Handle:SqlConnection = SQL_Connect(g_SqlTuple,ErrorCode,g_Error,charsmax(g_Error))
  6. if(SqlConnection == Empty_Handle)
  7. set_fail_state(g_Error)
  8.  
  9. new Handle:Queries
  10. Queries = SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS AvaFrame (steamid varchar(32) PRIMARY KEY,\
  11. PlayerLevel INT(11),\
  12. PlayerXP INT(11),\
  13. PlayerClass INT(11),\
  14. Vas INT(11),\
  15. Polimer INT(11),\
  16. Aram INT(11),\
  17. Otvozet INT(11),\
  18. Karbon INT(11),\
  19. Floxgem INT(11),\
  20. Blessium INT(11),\
  21. Kontrol INT(11),\
  22. Energia INT(11),\
  23. Szenzor INT(11),\
  24. Bloxy INT(11),\
  25. Li INT(11),\
  26. LiT INT(11),\
  27. Al INT(11),\
  28. AlT INT(11),\
  29. Fig INT(11),\
  30. FigT INT(11),\
  31. Gop INT(11),\
  32. GopT INT(11),\
  33. Pun INT(11),\
  34. PunT INT(11),\
  35. Vee INT(11),\
  36. VeeT INT(11),\
  37. Assa INT(11),\
  38. AssaT INT(11),\
  39. Rea INT(11),\
  40. ReaT INT(11),\
  41. Fr INT(11),\
  42. FrT INT(11),\
  43. Hoo INT(11),\
  44. HooT INT(11),\
  45. Els INT(11))")
  46.  
  47. if(!SQL_Execute(Queries))
  48. {
  49. SQL_QueryError(Queries,g_Error,charsmax(g_Error))
  50. set_fail_state(g_Error)
  51.  
  52. }
  53.  
  54. SQL_FreeHandle(Queries)
  55.  
  56. SQL_FreeHandle(SqlConnection)
  57. }
  58.  
  59. public plugin_end()
  60. {
  61. SQL_FreeHandle(g_SqlTuple)
  62. }
  63.  
  64. public Load_MySql(id)
  65. {
  66. new szSteamId[32], szTemp[512]
  67. get_user_authid(id, szSteamId, charsmax(szSteamId))
  68.  
  69. new Data[1]
  70. Data[0] = id
  71.  
  72. //we will now select from the table `tutorial` where the steamid match
  73. format(szTemp,charsmax(szTemp),"SELECT * FROM `AvaFrame` WHERE (`AvaFrame`.`steamid` = '%s')", szSteamId)
  74. SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
  75. }
  76.  
  77. public register_client(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
  78. {
  79. if(FailState == TQUERY_CONNECT_FAILED)
  80. {
  81. log_amx("Load - Could not connect to SQL database. [%d] %s", Errcode, Error)
  82. }
  83. else if(FailState == TQUERY_QUERY_FAILED)
  84. {
  85. log_amx("Load Query failed. [%d] %s", Errcode, Error)
  86. }
  87.  
  88. new id
  89. id = Data[0]
  90.  
  91. if(SQL_NumResults(Query) < 1)
  92. {
  93.  
  94. new szSteamId[32]
  95. get_user_authid(id, szSteamId, charsmax(szSteamId))
  96.  
  97. if (equal(szSteamId,"ID_PENDING"))
  98. return PLUGIN_HANDLED
  99.  
  100. new szTemp[512]
  101.  
  102.  
  103. format(szTemp,charsmax(szTemp),"INSERT INTO `AvaFrame` ( `steamid` ,\
  104. `PlayerLevel`,\
  105. `PlayerXP`,\
  106. `PlayerClass`,\
  107. `Vas`,\
  108. `Polimer`,\
  109. `Aram`,\
  110. `Otvozet`,\
  111. `Karbon`,\
  112. `Floxgem`,\
  113. `Blessium`,\
  114. `Kontrol`,\
  115. `Energia`,\
  116. `Szenzor`,\
  117. `Bloxy`,\
  118. `Li`,\
  119. `LiT`,\
  120. `Al`,\
  121. `AlT`,\
  122. `Fig`,\
  123. `FigT`,\
  124. `Gop`,\
  125. `GopT`,\
  126. `Pun`,\
  127. `PunT`,\
  128. `Vee`,\
  129. `VeeT`,\
  130. `Assa`,\
  131. `AssaT`,\
  132. `Rea`,\
  133. `ReaT`,\
  134. `Fr`,\
  135. `FrT`,\
  136. `Hoo`,\
  137. `HooT`,\
  138. `Els`)VALUES ('%s','0');",szSteamId)
  139. SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
  140. }
  141. else
  142. {
  143.  
  144. PlayerLevel[id] = SQL_ReadResult(Query, 1)
  145. PlayerXP[id] = SQL_ReadResult(Query, 2)
  146. PlayerClass[id] = SQL_ReadResult(Query, 3)
  147. vaserc[id] = SQL_ReadResult(Query, 4)
  148. polimer_szal[id] = SQL_ReadResult(Query, 5)
  149. aramkorok[id] = SQL_ReadResult(Query, 6)
  150. otvozet[id] = SQL_ReadResult(Query, 7)
  151. karbon_szal[id] = SQL_ReadResult(Query, 8)
  152. floxgem[id] = SQL_ReadResult(Query, 9)
  153. blessium[id] = SQL_ReadResult(Query, 10)
  154. kontrol_panel[id] = SQL_ReadResult(Query, 11)
  155. energia_cella[id] = SQL_ReadResult(Query, 12)
  156. szenzor[id] = SQL_ReadResult(Query, 13)
  157. bloxy[id] = SQL_ReadResult(Query, 14)
  158. lien[id] = SQL_ReadResult(Query, 15)
  159. lienterv[id] = SQL_ReadResult(Query, 16)
  160. alien[id] = SQL_ReadResult(Query, 17)
  161. alienterv[id] = SQL_ReadResult(Query, 18)
  162. fighter[id] = SQL_ReadResult(Query, 19)
  163. fighterterv[id] = SQL_ReadResult(Query, 20)
  164. gopnik[id] = SQL_ReadResult(Query, 21)
  165. gopnikterv[id] = SQL_ReadResult(Query, 22)
  166. punisher[id] = SQL_ReadResult(Query, 23)
  167. punisherterv[id] = SQL_ReadResult(Query, 24)
  168. vee[id] = SQL_ReadResult(Query, 25)
  169. veeterv[id] = SQL_ReadResult(Query, 26)
  170. assassin[id] = SQL_ReadResult(Query, 27)
  171. assassinterv[id] = SQL_ReadResult(Query, 28)
  172. reaper[id] = SQL_ReadResult(Query, 29)
  173. reaperterv[id] = SQL_ReadResult(Query, 30)
  174. frost[id] = SQL_ReadResult(Query, 31)
  175. frostterv[id] = SQL_ReadResult(Query, 32)
  176. hooz[id] = SQL_ReadResult(Query, 33)
  177. hoozterv[id] = SQL_ReadResult(Query, 34)
  178. elsocsati[id] = SQL_ReadResult(Query, 35)
  179. }
  180.  
  181. return PLUGIN_HANDLED
  182. }
  183.  
  184. public Save_MySql(id)
  185. {
  186. new szSteamId[32], szTemp[512]
  187. get_user_authid(id, szSteamId, charsmax(szSteamId))
  188.  
  189. // Here we will update the user hes information in the database where the steamid matches.
  190. format(szTemp,charsmax(szTemp),"UPDATE `AvaFrame` SET `PlayerLevel` = '%i',\
  191. `PlayerXP` = '%i',\
  192. `PlayerClass` = '%i',\
  193. `Vas` = '%i',\
  194. `Polimer` = '%i',\
  195. `Aram` = '%i',\
  196. `Otvozet` = '%i',\
  197. `Karbon` = '%i',\
  198. `Floxgem` = '%i',\
  199. `Blessium` = '%i',\
  200. `Kontrol` = '%i',\
  201. `Energia` = '%i',\
  202. `Szenzor` = '%i',\
  203. `Bloxy` = '%i',\
  204. `Li` = '%i',\
  205. `LiT` = '%i',\
  206. `Al` = '%i',\
  207. `AlT` = '%i',\
  208. `Fig` = '%i',\
  209. `FigT` = '%i',\
  210. `Gop` = '%i',\
  211. `GopT` = '%i',\
  212. `Pun` = '%i',\
  213. `PunT` = '%i',\
  214. `Vee` = '%i',\
  215. `VeeT` = '%i',\
  216. `Assa` = '%i',\
  217. `AssaT` = '%i',\
  218. `Rea` = '%i',\
  219. `ReaT` = '%i',\
  220. `Fr` = '%i',\
  221. `FrT` = '%i',\
  222. `Hoo` = '%i',\
  223. `HooT` = '%i',\
  224. `Els` = '%i'\
  225. WHERE `AvaFrame`.`steamid` = '%s';",PlayerLevel[id], PlayerXP[id], PlayerClass[id], vaserc[id], polimer_szal[id], aramkorok[id], otvozet[id], karbon_szal[id], floxgem[id], blessium[id], kontrol_panel[id], energia_cella[id], szenzor[id], bloxy[id], lien[id], lienterv[id], alien[id], alienterv[id], fighter[id], fighterterv[id], gopnik[id], gopnikterv[id], punisher[id], punisherterv[id], vee[id], veeterv[id], assassin[id], assassinterv[id], reaper[id], reaperterv[id], frost[id], frostterv[id], hooz[id], hoozterv[id], elsocsati[id], szSteamId)
  226. SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
  227. }


A "\"-ek nélkül sem fordul le, csak ugyebár nem tudok menteni, ezért így maradt...


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Nem fordítja le
HozzászólásElküldve: 2015.05.11. 22:59 
Offline
Őskövület
Avatar

Csatlakozott: 2012.02.27. 09:42
Hozzászólások: 2588
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 418 alkalommal
Elméletileg működik :D küldj teljes forráskódot és átnézem neked. Jöhet privátban is :D

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Nem fordítja le
HozzászólásElküldve: 2015.05.13. 17:16 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.08.24. 18:28
Hozzászólások: 584
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 120 alkalommal
Közben rájöttem a hibára. Túl sok adatot akartam egy táblába menteni (szám szerint 36-ot).
Megpróbáltam két táblába menteni, de nem nagyok sikerült... :D Létrehozza őket, de a mentés már nem jó (ebből kifolyólag a betöltést nem tudom, jó-e).
Valaki lenne oly kedves, és megnézné nekem?

SMA Forráskód: [ Mindet kijelol ]
  1. public MySql_Init()
  2. {
  3. g_SqlTuple = SQL_MakeDbTuple(Host,User,Pass,Db)
  4.  
  5. new ErrorCode,Handle:SqlConnection = SQL_Connect(g_SqlTuple,ErrorCode,g_Error,charsmax(g_Error))
  6. if(SqlConnection == Empty_Handle)
  7. set_fail_state(g_Error)
  8.  
  9. new Handle:Queries
  10. Queries = SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS Alapanyag (steamid varchar(32) PRIMARY KEY,\
  11. PlayerLevel INT(11),\
  12. PlayerXP INT(11),\
  13. PlayerClass INT(11),\
  14. Vas INT(11),\
  15. Polimer INT(11),\
  16. Aram INT(11),\
  17. Otvozet INT(11),\
  18. Karbon INT(11),\
  19. Floxgem INT(11),\
  20. Blessium INT(11),\
  21. Kontrol INT(11),\
  22. Energia INT(11),\
  23. Szenzor INT(11),\
  24. Bloxy INT(11))")
  25.  
  26. new Handle:Queriess
  27. Queriess = SQL_PrepareQuery(SqlConnection,"CREATE TABLE IF NOT EXISTS Avatar (steamid varchar(32) PRIMARY KEY,\
  28. Li INT(11),\
  29. LiT INT(11),\
  30. Al INT(11),\
  31. AlT INT(11),\
  32. Fig INT(11),\
  33. FigT INT(11),\
  34. Gop INT(11),\
  35. GopT INT(11),\
  36. Pun INT(11),\
  37. PunT INT(11),\
  38. Vee INT(11),\
  39. VeeT INT(11),\
  40. Assa INT(11),\
  41. AssaT INT(11),\
  42. Rea INT(11),\
  43. ReaT INT(11),\
  44. Fr INT(11),\
  45. FrT INT(11),\
  46. Hoo INT(11),\
  47. HooT INT(11),\
  48. Els INT(11))")
  49.  
  50. if(!SQL_Execute(Queries))
  51. {
  52. SQL_QueryError(Queries,g_Error,charsmax(g_Error))
  53. set_fail_state(g_Error)
  54.  
  55. }
  56.  
  57. if(!SQL_Execute(Queriess))
  58. {
  59. SQL_QueryError(Queriess,g_Error,charsmax(g_Error))
  60. set_fail_state(g_Error)
  61.  
  62. }
  63.  
  64. SQL_FreeHandle(Queries)
  65. SQL_FreeHandle(Queriess)
  66.  
  67. SQL_FreeHandle(SqlConnection)
  68. }
  69.  
  70. public plugin_end()
  71. {
  72. SQL_FreeHandle(g_SqlTuple)
  73. }
  74.  
  75. public Load_MySql(id)
  76. {
  77. new szSteamId[32], szTemp[512]
  78. get_user_authid(id, szSteamId, charsmax(szSteamId))
  79.  
  80. new Data[1]
  81. Data[0] = id
  82.  
  83. //we will now select from the table `tutorial` where the steamid match
  84. format(szTemp,charsmax(szTemp),"SELECT * FROM `Alapanyag` WHERE (`Alapanyag`.`steamid` = '%s')", szSteamId)
  85. format(szTemp,charsmax(szTemp),"SELECT * FROM `Avatar` WHERE (`Avatar`.`steamid` = '%s')", szSteamId)
  86. SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
  87. }
  88.  
  89. public register_client(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
  90. {
  91. if(FailState == TQUERY_CONNECT_FAILED)
  92. {
  93. log_amx("Load - Could not connect to SQL database. [%d] %s", Errcode, Error)
  94. }
  95. else if(FailState == TQUERY_QUERY_FAILED)
  96. {
  97. log_amx("Load Query failed. [%d] %s", Errcode, Error)
  98. }
  99.  
  100. new id
  101. id = Data[0]
  102.  
  103. if(SQL_NumResults(Query) < 1)
  104. {
  105.  
  106. new szSteamId[32]
  107. get_user_authid(id, szSteamId, charsmax(szSteamId))
  108.  
  109. if (equal(szSteamId,"ID_PENDING"))
  110. return PLUGIN_HANDLED
  111.  
  112. new szTemp[512]
  113.  
  114.  
  115. format(szTemp,charsmax(szTemp),"INSERT INTO `Alapanyag` ( `steamid` ,\
  116. `PlayerLevel`,\
  117. `PlayerXP`,\
  118. `PlayerClass`,\
  119. `Vas`,\
  120. `Polimer`,\
  121. `Aram`,\
  122. `Otvozet`,\
  123. `Karbon`,\
  124. `Floxgem`,\
  125. `Blessium`,\
  126. `Kontrol`,\
  127. `Energia`,\
  128. `Szenzor`,\
  129. `Bloxy`)VALUES ('%s','0');",szSteamId)
  130.  
  131. format(szTemp,charsmax(szTemp),"INSERT INTO `Avatar` ( `steamid` ,\
  132. `Li`,\
  133. `LiT`,\
  134. `Al`,\
  135. `AlT`,\
  136. `Fig`,\
  137. `FigT`,\
  138. `Gop`,\
  139. `GopT`,\
  140. `Pun`,\
  141. `PunT`,\
  142. `Vee`,\
  143. `VeeT`,\
  144. `Assa`,\
  145. `AssaT`,\
  146. `Rea`,\
  147. `ReaT`,\
  148. `Fr`,\
  149. `FrT`,\
  150. `Hoo`,\
  151. `HooT`,\
  152. `Els`)VALUES ('%s','0');",szSteamId)
  153. SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
  154. }
  155. else
  156. {
  157.  
  158. PlayerLevel[id] = SQL_ReadResult(Query, 1)
  159. PlayerXP[id] = SQL_ReadResult(Query, 2)
  160. PlayerClass[id] = SQL_ReadResult(Query, 3)
  161. vaserc[id] = SQL_ReadResult(Query, 4)
  162. polimer_szal[id] = SQL_ReadResult(Query, 5)
  163. aramkorok[id] = SQL_ReadResult(Query, 6)
  164. otvozet[id] = SQL_ReadResult(Query, 7)
  165. karbon_szal[id] = SQL_ReadResult(Query, 8)
  166. floxgem[id] = SQL_ReadResult(Query, 9)
  167. blessium[id] = SQL_ReadResult(Query, 10)
  168. kontrol_panel[id] = SQL_ReadResult(Query, 11)
  169. energia_cella[id] = SQL_ReadResult(Query, 12)
  170. szenzor[id] = SQL_ReadResult(Query, 13)
  171. bloxy[id] = SQL_ReadResult(Query, 14)
  172. lien[id] = SQL_ReadResult(Query, 1)
  173. lienterv[id] = SQL_ReadResult(Query, 2)
  174. alien[id] = SQL_ReadResult(Query, 3)
  175. alienterv[id] = SQL_ReadResult(Query, 4)
  176. fighter[id] = SQL_ReadResult(Query, 5)
  177. fighterterv[id] = SQL_ReadResult(Query, 6)
  178. gopnik[id] = SQL_ReadResult(Query, 7)
  179. gopnikterv[id] = SQL_ReadResult(Query, 8)
  180. punisher[id] = SQL_ReadResult(Query, 9)
  181. punisherterv[id] = SQL_ReadResult(Query, 10)
  182. vee[id] = SQL_ReadResult(Query, 11)
  183. veeterv[id] = SQL_ReadResult(Query, 12)
  184. assassin[id] = SQL_ReadResult(Query, 13)
  185. assassinterv[id] = SQL_ReadResult(Query, 14)
  186. reaper[id] = SQL_ReadResult(Query, 15)
  187. reaperterv[id] = SQL_ReadResult(Query, 16)
  188. frost[id] = SQL_ReadResult(Query, 17)
  189. frostterv[id] = SQL_ReadResult(Query, 18)
  190. hooz[id] = SQL_ReadResult(Query, 19)
  191. hoozterv[id] = SQL_ReadResult(Query, 20)
  192. elsocsati[id] = SQL_ReadResult(Query, 21)
  193. }
  194.  
  195. return PLUGIN_HANDLED
  196. }
  197.  
  198. public Save_MySql(id)
  199. {
  200. new szSteamId[32], szTemp[512]
  201. get_user_authid(id, szSteamId, charsmax(szSteamId))
  202.  
  203. // Here we will update the user hes information in the database where the steamid matches.
  204. format(szTemp,charsmax(szTemp),"UPDATE `Alapanyag` SET `PlayerLevel` = '%i',\
  205. `PlayerXP` = '%i',\
  206. `PlayerClass` = '%i',\
  207. `Vas` = '%i',\
  208. `Polimer` = '%i',\
  209. `Aram` = '%i',\
  210. `Otvozet` = '%i',\
  211. `Karbon` = '%i',\
  212. `Floxgem` = '%i',\
  213. `Blessium` = '%i',\
  214. `Kontrol` = '%i',\
  215. `Energia` = '%i',\
  216. `Szenzor` = '%i',\
  217. `Bloxy` = '%i',\
  218. WHERE `AvaFrame`.`steamid` = '%s';",PlayerLevel[id],
  219. PlayerXP[id],
  220. PlayerClass[id],
  221. vaserc[id],
  222. polimer_szal[id],
  223. aramkorok[id],
  224. otvozet[id],
  225. karbon_szal[id],
  226. floxgem[id],
  227. blessium[id],
  228. kontrol_panel[id],
  229. energia_cella[id],
  230. szenzor[id],
  231. bloxy[id], szSteamId)
  232. format(szTemp,charsmax(szTemp),"UPDATE `Alapanyag` SET `Li` = '%i',\
  233. `LiT` = '%i',\
  234. `Al` = '%i',\
  235. `AlT` = '%i',\
  236. `Fig` = '%i',\
  237. `FigT` = '%i',\
  238. `Gop` = '%i',\
  239. `GopT` = '%i',\
  240. `Pun` = '%i',\
  241. `PunT` = '%i',\
  242. `Vee` = '%i',\
  243. `VeeT` = '%i',\
  244. `Assa` = '%i',\
  245. `AssaT` = '%i',\
  246. `Rea` = '%i',\
  247. `ReaT` = '%i',\
  248. `Fr` = '%i',\
  249. `FrT` = '%i',\
  250. `Hoo` = '%i',\
  251. `HooT` = '%i',\
  252. `Els` = '%i'\
  253. WHERE `AvaFrame`.`steamid` = '%s';",lien[id],
  254. lienterv[id],
  255. alien[id],
  256. alienterv[id],
  257. fighter[id],
  258. fighterterv[id],
  259. gopnik[id],
  260. gopnikterv[id],
  261. punisher[id],
  262. punisherterv[id],
  263. vee[id],
  264. veeterv[id],
  265. assassin[id],
  266. assassinterv[id],
  267. reaper[id],
  268. reaperterv[id],
  269. frost[id],
  270. frostterv[id],
  271. hooz[id],
  272. hoozterv[id],
  273. elsocsati[id], szSteamId)
  274. SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
  275. }


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 3 hozzászólás ] 


Ki van itt

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


Nyithatsz új témákat ebben a fórumban.
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