hlmod.hu
https://hlmod.hu/

random spawnolás nem jó
https://hlmod.hu/viewtopic.php?f=9&t=21278
Oldal: 1 / 1

Szerző:  alfaanero [ 2015.06.29. 21:24 ]
Hozzászólás témája:  random spawnolás nem jó

SMA Forráskód: [ Mindet kijelol ]
  1. public fw_Spawn(id)
  2. {
  3. if(is_user_alive(id))
  4. {
  5. cs_set_user_money(id, 0, 0);
  6. strip_user_weapons(id);
  7. give_item(id, "weapon_knife");
  8. if(status[id])
  9. {
  10. new rand1, rand2;
  11.  
  12. do rand1=random_num(0,17);
  13. while(elozo1[id]==rand1);
  14.  
  15. do rand2=random_num(0,5)+18;
  16. while(elozo2[id]==rand2);
  17.  
  18. elozo1[id]=rand1;
  19. elozo2[id]=rand2;
  20. //
  21. new inifile[192], map[32]
  22. get_mapname(map, 31)
  23. formatex(inifile, charsmax(inifile), "addons/amxmodx/configs/csdm/%s.spawns.cfg", map)
  24. new Float:origin[3]
  25. new elsopoz[8], masodikpoz[8], harmadikpoz[8]
  26. new lines = file_size(inifile, 1)
  27. if(lines > 0)
  28. {
  29. new randomLine = random(lines);
  30. new lineBuffer[256], len;
  31. read_file(inifile, randomLine, lineBuffer, charsmax(lineBuffer), len);
  32. parse(lineBuffer, elsopoz, 7, masodikpoz, 7, harmadikpoz, 7)
  33.  
  34. origin[0] = str_to_float(elsopoz)
  35. origin[1] = str_to_float(masodikpoz)
  36. origin[2] = str_to_float(harmadikpoz)
  37. }
  38. //
  39. new szin[3], szinleker[32][3]
  40. parse(szinek[random(sizeof(szinek))], szinleker[0], 31, szinleker[1], 31, szinleker[2], 31)
  41. szin[0] = str_to_num(szinleker[0])
  42. szin[1] = str_to_num(szinleker[1])
  43. szin[2] = str_to_num(szinleker[2])
  44. vedelem[id] = true
  45. set_user_rendering(id, kRenderFxGlowShell, szin[0], szin[1], szin[2], kRenderNormal, 25)
  46. remove_task(id)
  47. set_task(IDO, "vedelemki", id)
  48. }


Ez így miért nem random helyen spawnoltatt le?

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