hlmod.hu
https://hlmod.hu/

Mentés
https://hlmod.hu/viewtopic.php?f=9&t=24195
Oldal: 1 / 1

Szerző:  |E|xTazYyyy^.~ [ 2016.03.04. 22:25 ]
Hozzászólás témája:  Mentés

Sziasztok.
Ez igy miért nem ment?
  1. new awp1[33], awp2[33], awp3[33], awp4[33], awp5[33]
  2. new awp6[33], awp7[33], awp8[33], awp9[33]
  3. new szint[33]
  4. new oles[33]
  5.  
  6. public client_putinserver(id) betoltes(id)
  7. public client_disconnect(id) mentes(id)
  8.  
  9. public mentes(id){
  10.    new auth[35]
  11.    get_user_authid(id,auth, sizeof(auth)-1)
  12.    
  13.    new mentes2[512]
  14.    format(mentes2, 511, "%i %i %i %i %i %i %i %i %i  ",awp1[id],awp2[id],awp3[id],awp4[id],awp5[id],awp6[id],awp7[id],awp8[id],awp9[id])
  15.    
  16.    fvault_set_data("cuccok", auth, mentes2)
  17. }
  18. public betoltes(id)
  19. {
  20.    new auth[35]
  21.    get_user_authid(id, auth, sizeof(auth)-1) //Lekerjuk a steamid-t
  22.    
  23.    new mentes3[512]
  24.    // 9 Darab %i betu van,mert 9 awp skin talalhato,szoval ha jon a 10. akkor irj hozza plusz egy  %i-t
  25.    format(mentes3, 511, "%i %i %i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id])
  26.    
  27.    if(fvault_get_data("cuccok", auth, mentes3, 63))
  28.    {
  29.       //Ne awp10-et adj a kovetkezonek,hanem ugyan ugy wp10-et
  30.       new oleske[33],szintecske[33],wp1[33],wp2[33],wp3[33],wp4[33],wp5[33],wp6[33],wp7[33],wp8[33],wp9[33] //wp10 stb...
  31.       parse(mentes3,wp1,31,wp2,31,wp3,31,wp4,31,wp5,31,wp6,31,wp7,31,wp8,31,wp9,31); // wp9,31 es a tobbi majd...
  32.       //Lekerjuk a fajl tartalmat es odaadjuk neki a skineket,ha megszerezte
  33.       oles[id] = str_to_num(oleske)
  34.       szint[id] = str_to_num(szintecske)
  35.       awp1[id] = str_to_num(wp1)
  36.       awp2[id] = str_to_num(wp2)
  37.       awp3[id] = str_to_num(wp3)
  38.       awp4[id] = str_to_num(wp4)
  39.       awp5[id] = str_to_num(wp5)
  40.       awp6[id] = str_to_num(wp6)
  41.       awp7[id] = str_to_num(wp7)
  42.       awp8[id] = str_to_num(wp8)
  43.       awp9[id] = str_to_num(wp9)
  44.      
  45.    }
  46.    else //Ha nem talalt mentes a steamid-en:
  47.    {
  48.       awp1[id] =0
  49.       awp2[id] =0
  50.       awp3[id] =0
  51.       awp4[id] =0
  52.       awp5[id] =0
  53.       awp6[id] =0
  54.       awp7[id] =0
  55.       awp8[id] =0
  56.       awp9[id] =0
  57.    }
  58. }

Szerző:  Pardon [ 2016.03.04. 22:34 ]
Hozzászólás témája:  Re: Mentés

  1. format(mentes3, 511, "%i %i %i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id])


-->
  1. format(mentes3, 511, "%i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id])

Szerző:  Akosch:. [ 2016.03.05. 19:17 ]
Hozzászólás témája:  Re: Mentés

  1. format(mentes3, 511, "%i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id])

->
  1. formatex( mentes3, charsmax( mentes3 ), "%i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id] )


Kerüljük a bűvös számok használatát, ha lehetséges + ha nem másolsz vissza, akkor gyorsabb a formatex a formatnál.
+ még jobb ha a névben számozás helyett 2 dimenziós tömböt használsz ( könnyen végig tudsz menni rajtuk egy ciklussal stb... )

Szerző:  |E|xTazYyyy^.~ [ 2016.03.06. 13:21 ]
Hozzászólás témája:  Re: Mentés

Akosch:. írta:
  1. format(mentes3, 511, "%i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id])

->
  1. formatex( mentes3, charsmax( mentes3 ), "%i %i %i %i %i %i %i %i %i" ,szint[id],oles[id],awp1[id], awp2[id], awp3[id], awp4[id], awp5[id], awp6[id], awp7[id], awp8[id], awp9[id] )


Kerüljük a bűvös számok használatát, ha lehetséges + ha nem másolsz vissza, akkor gyorsabb a formatex a formatnál.
+ még jobb ha a névben számozás helyett 2 dimenziós tömböt használsz ( könnyen végig tudsz menni rajtuk egy ciklussal stb... )



Igyse jó a mentés sajnos.

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/