HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include < amxmodx >
  2. #include < engine >
  3. #include < fakemeta >
  4. #include < colorchat >
  5.  
  6. #define ADMIN_LEVEL ADMIN_MAP
  7.  
  8. new gConfigFile[ 128 ];
  9.  
  10. new Float:gLightMinY[ 3 ] = { -8.0, -8.0, -8.0 };
  11. new Float:gLightMaxY[ 3 ] = { 8.0, 8.0, 8.0 };
  12.  
  13. new light_properites[ 33 ][ 4 ]; // 0=Radius 1=Red 2=Green 3=Blue
  14. new editing_value[ 33 ];
  15.  
  16. new const gszModel[] = "sprites/lightmaker/lightmaker.spr";
  17. new const gszFolder[] = "addons/amxmodx/data/lights";
  18. new const gszLightClassName[] = "lightmaker";
  19. new const gszPrefix[] = ""; // Usage: "[Lampa Mod] ";
  20. new const gszVersion[] = "1.7";
  21.  
  22. public plugin_init( )
  23. {
  24. register_plugin( "Light Maker", gszVersion, "Juice" );
  25. register_clcmd( "say /light", "CmdLightMenu" );
  26.  
  27. register_forward( FM_Think, "fwdLightThink" );
  28.  
  29. register_cvar( "lightmaker_version", gszVersion, FCVAR_SERVER | FCVAR_SPONLY );
  30.  
  31. register_menucmd( register_menuid("LightMenu"), 1023, "handleLightMenu" );
  32. register_menucmd( register_menuid("OptionsMenu"), 1023, "handleOptionsMenu" );
  33. register_menucmd( register_menuid("ColorMenu"), 1023, "handleColorMenu" );
  34. register_menucmd( register_menuid("TemplatesMenu"), 1023, "handleTemplatesMenu" );
  35. }
  36.  
  37. public plugin_precache( )
  38. precache_model( gszModel );
  39.  
  40. public client_putinserver( id )
  41. {
  42. editing_value[id] = 10;
  43. light_properites[id][0] = 30;
  44. light_properites[id][1] = 255;
  45. light_properites[id][2] = 255;
  46. light_properites[id][3] = 255;
  47. }
  48.  
  49. public client_disconnect( id )
  50. {
  51. editing_value[id] = 0;
  52. light_properites[id][0] = 0;
  53. light_properites[id][1] = 0;
  54. light_properites[id][2] = 0;
  55. light_properites[id][3] = 0;
  56. }
  57.  
  58. public plugin_cfg( )
  59. {
  60. new szMapName[ 32 ];
  61. get_mapname( szMapName, 31 );
  62. strtolower( szMapName );
  63.  
  64. formatex( gConfigFile, 127, gszFolder );
  65.  
  66. if( !dir_exists( gConfigFile ) )
  67. {
  68. mkdir( gConfigFile );
  69. format( gConfigFile, 127, "%s/%s.txt", gConfigFile, szMapName );
  70. return;
  71. }
  72.  
  73. format( gConfigFile, 127, "%s/%s.txt", gConfigFile, szMapName );
  74.  
  75. if( !file_exists( gConfigFile ) )
  76. return;
  77.  
  78. LoadLights(0);
  79. }
  80.  
  81. public DeleteLight( id )
  82. {
  83. new Float:vOrigin[ 3 ], szClassName[ 12 ], iEntity = -1, iDeleted;
  84. entity_get_vector( id, EV_VEC_origin, vOrigin );
  85.  
  86. while( ( iEntity = find_ent_in_sphere( iEntity, vOrigin, 100.0 ) ) > 0 )
  87. {
  88. entity_get_string( iEntity, EV_SZ_classname, szClassName, 11 );
  89.  
  90. if( equal( szClassName, gszLightClassName ) )
  91. {
  92. remove_entity( iEntity );
  93. iDeleted++;
  94. }
  95. }
  96. if( iDeleted == 0 )
  97. {
  98. ColorChat( id, GREEN, "%s^x01Ha torolni szeretnel lampat akkor a kozelebe kell menny!", gszPrefix );
  99. }
  100. }
  101.  
  102. public CmdLightMenu( id )
  103. {
  104. ShowLightMenu( id );
  105. return PLUGIN_HANDLED;
  106. }
  107.  
  108. public ShowLightMenu(id)
  109. {
  110. new MenuBody[512], szColor[3], access[3], len, keys;
  111. access = (get_user_flags(id) & ADMIN_LEVEL ? "\w" : "\d");
  112. formatex(szColor, 3, access)
  113.  
  114. len = format(MenuBody, 511, "\y%sLampa Menu \r[Vilagito Tav: \y%i\r] - \yBy Juice", gszPrefix, light_properites[id][0]);
  115. len += format(MenuBody[len], 511-len, "^n\r1. %sVilagito Tav +", szColor);
  116. len += format(MenuBody[len], 511-len, "^n\r2. %sLampa Keszitese", szColor);
  117. len += format(MenuBody[len], 511-len, "^n\r3. %sVilagito Tav -", szColor);
  118. len += format(MenuBody[len], 511-len, "^n\r4. %sLampa Torlese^n", szColor);
  119. len += format(MenuBody[len], 511-len, "^n\r5. \wSzin Szekciok \r[P: \y%i \r| Z: \y%i \r| K: \y%i\r]^n", light_properites[id][1], light_properites[id][2],light_properites[id][3]);
  120. len += format(MenuBody[len], 511-len, "^n\r6. %sFalon Atjaras KI/BE", szColor);
  121. len += format(MenuBody[len], 511-len, "^n\r7. %sIsten Mod KI/BE^n",szColor);
  122. len += format(MenuBody[len], 511-len, "^n\r9. \wBeallitasok^n");
  123. len += format(MenuBody[len], 511-len, "^n\r0. \wKilepes");
  124.  
  125. keys = ( 1<<4 | 1<<8 | 1<<9 );
  126.  
  127. if( get_user_flags(id) & ADMIN_LEVEL )
  128. keys |= ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<5 | 1<<6 );
  129.  
  130. show_menu(id, keys, MenuBody, -1, "LightMenu");
  131. }
  132.  
  133. public ShowOptionsMenu(id)
  134. {
  135. new MenuBody[512], szColor[3], access[3], len, keys;
  136. access = (get_user_flags(id) & ADMIN_LEVEL ? "\w" : "\d");
  137. formatex(szColor, 3, access)
  138.  
  139. len = format(MenuBody, 511, "\y%sLampa Beallitasok", gszPrefix);
  140. len += format(MenuBody[len], 511-len, "^n\r1. %sLampak Betoltese", szColor);
  141. len += format(MenuBody[len], 511-len, "^n\r2. %sOsszes Lampa Torlese", szColor);
  142. len += format(MenuBody[len], 511-len, "^n\r3. %sLampak Mentese", szColor);
  143. len += format(MenuBody[len], 511-len, "^n\r4. %sSzerkesztesi Ertek: \y%i^n", szColor, editing_value[id]);
  144. len += format(MenuBody[len], 511-len, "^n\r6. %sFalon Atjaras KI/BE", szColor);
  145. len += format(MenuBody[len], 511-len, "^n\r7. %sIsten Mod KI/BE^n", szColor);
  146. len += format(MenuBody[len], 511-len, "^n\r0. \wVissza a fomenube");
  147.  
  148. keys = ( 1<<9 );
  149.  
  150. if(get_user_flags(id) & ADMIN_LEVEL)
  151. keys |= ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<5 | 1<<6 );
  152.  
  153. show_menu(id, keys, MenuBody, -1, "OptionsMenu");
  154. }
  155.  
  156. public ShowColorMenu( id )
  157. {
  158. new MenuBody[512], szColor[3], access[3], len, keys;
  159. access = (get_user_flags(id) & ADMIN_LEVEL ? "\w" : "\d");
  160. formatex(szColor, 3, access)
  161.  
  162. len = format(MenuBody, 511, "\y%sSzin keszito Menu^n\r[P: \y%i \r| Z: \y%i \r| K: \y%i\r]", gszPrefix, light_properites[id][1], light_properites[id][2],light_properites[id][3]);
  163. len += format(MenuBody[len], 511-len, "^n\r1. %sPiros +", szColor);
  164. len += format(MenuBody[len], 511-len, "^n\r2. %sPiros -", szColor);
  165. len += format(MenuBody[len], 511-len, "^n\r3. %sZold +", szColor);
  166. len += format(MenuBody[len], 511-len, "^n\r4. %sZold -", szColor);
  167. len += format(MenuBody[len], 511-len, "^n\r5. %sKek +", szColor);
  168. len += format(MenuBody[len], 511-len, "^n\r6. %sKek -^n", szColor);
  169. len += format(MenuBody[len], 511-len, "^n\r9. \wMar Kesz Szinek Valasztasa^n");
  170. len += format(MenuBody[len], 511-len, "^n\r0. \wVissza");
  171.  
  172. keys = ( 1<<8 | 1<<9 );
  173.  
  174. if(get_user_flags(id) & ADMIN_LEVEL)
  175. keys |= ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 );
  176.  
  177. show_menu( id, keys, MenuBody, -1, "ColorMenu" );
  178. }
  179.  
  180. public ShowTemplatesMenu( id )
  181. {
  182. new MenuBody[512], szColor[3], access[3], len, keys;
  183. access = (get_user_flags(id) & ADMIN_LEVEL ? "\w" : "\d");
  184. formatex(szColor, 3, access)
  185.  
  186. len = format(MenuBody, 511, "\y%sValassz Egy Szint:", gszPrefix);
  187. len += format(MenuBody[len], 511-len, "^n\r1. %sFeher", szColor);
  188. len += format(MenuBody[len], 511-len, "^n\r2. %sPiros", szColor);
  189. len += format(MenuBody[len], 511-len, "^n\r3. %sZold", szColor);
  190. len += format(MenuBody[len], 511-len, "^n\r4. %sKek", szColor);
  191. len += format(MenuBody[len], 511-len, "^n\r5. %sAqua (Tenger Kek)", szColor);
  192. len += format(MenuBody[len], 511-len, "^n\r6. %sSarga", szColor);
  193. len += format(MenuBody[len], 511-len, "^n\r7. %sNarancs", szColor);
  194. len += format(MenuBody[len], 511-len, "^n\r8. %sRozsaszin^n", szColor);
  195. len += format(MenuBody[len], 511-len, "^n\r0. \wVissza");
  196.  
  197. keys = ( 1<<9 );
  198.  
  199. if(get_user_flags(id) & ADMIN_LEVEL)
  200. keys |= ( 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 );
  201.  
  202. show_menu( id, keys, MenuBody, -1, "TemplatesMenu" );
  203. }
  204.  
  205. public handleLightMenu( id, key )
  206. {
  207. new szName[33];
  208. get_user_name(id, szName, 32);
  209. switch(key + 1)
  210. {
  211. case 1:
  212. {
  213. light_properites[id][0] += editing_value[id];
  214. if(light_properites[id][0] > 40)
  215. {
  216. light_properites[id][0] = 40;
  217. }
  218. ShowLightMenu( id );
  219. }
  220. case 2:
  221. {
  222. CreateLightAiming( id );
  223. ShowLightMenu( id );
  224. }
  225. case 3:
  226. {
  227. light_properites[id][0] -= editing_value[id];
  228. if(light_properites[id][0] <= 0)
  229. {
  230. light_properites[id][0] = 5;
  231. }
  232. ShowLightMenu( id );
  233. }
  234. case 4:
  235. {
  236. DeleteLight(id);
  237. ShowLightMenu(id);
  238. }
  239. case 5:
  240. {
  241. ShowColorMenu(id);
  242. }
  243. case 6:
  244. {
  245. SwitchNoclip(id);
  246. ShowLightMenu(id);
  247. }
  248. case 7:
  249. {
  250. SwitchGodMode(id);
  251. ShowLightMenu(id);
  252. }
  253. case 9:
  254. {
  255. ShowOptionsMenu(id);
  256. }
  257. }
  258. }
  259.  
  260. public handleOptionsMenu(id, key)
  261. {
  262. switch (key + 1)
  263. {
  264. case 1:
  265. {
  266. LoadLights(id);
  267. ShowOptionsMenu(id);
  268. }
  269. case 2:
  270. {
  271. DeleteAllLights(id);
  272. ShowOptionsMenu(id);
  273. }
  274. case 3:
  275. {
  276. SaveLights(id);
  277. ShowOptionsMenu(id);
  278. }
  279. case 4:
  280. {
  281. editing_value[id] += 5;
  282. if(editing_value[id] == 6)
  283. {
  284. editing_value[id] = 5;
  285. }
  286. else if(editing_value[id] > 50)
  287. {
  288. editing_value[id] = 1;
  289. }
  290. ShowOptionsMenu(id);
  291. }
  292. case 6:
  293. {
  294. SwitchNoclip(id);
  295. ShowOptionsMenu(id);
  296. }
  297. case 7:
  298. {
  299. SwitchGodMode(id);
  300. ShowOptionsMenu(id);
  301. }
  302. case 10:
  303. {
  304. ShowLightMenu(id);
  305. }
  306. }
  307. }
  308.  
  309. public handleColorMenu(id, key)
  310. {
  311. switch (key + 1)
  312. {
  313. case 1:
  314. {
  315. light_properites[id][1] += editing_value[id];
  316. if(light_properites[id][1] > 255)
  317. {
  318. light_properites[id][1] = 255;
  319.  
  320. }
  321. ShowColorMenu(id);
  322. }
  323. case 2:
  324. {
  325. light_properites[id][1] -= editing_value[id];
  326. if(light_properites[id][1] < 0)
  327. {
  328. light_properites[id][1] = 0;
  329. }
  330. ShowColorMenu(id);
  331. }
  332. case 3:
  333. {
  334. light_properites[id][2] += editing_value[id];
  335. if(light_properites[id][2] > 255)
  336. {
  337. light_properites[id][2] = 255;
  338. }
  339. ShowColorMenu(id);
  340. }
  341. case 4:
  342. {
  343. light_properites[id][2] -= editing_value[id];
  344. if(light_properites[id][2] < 0)
  345. {
  346. light_properites[id][2] = 0;
  347. }
  348. ShowColorMenu(id);
  349. }
  350. case 5:
  351. {
  352. light_properites[id][3] += editing_value[id];
  353. if(light_properites[id][3] > 255)
  354. {
  355. light_properites[id][3] = 255;
  356. }
  357. ShowColorMenu(id);
  358. }
  359. case 6:
  360. {
  361. light_properites[id][3] -= editing_value[id];
  362. if(light_properites[id][3] < 0)
  363. {
  364. light_properites[id][3] = 0;
  365. }
  366. ShowColorMenu(id);
  367. }
  368. case 9:
  369. {
  370. ShowTemplatesMenu(id);
  371. }
  372. case 10:
  373. {
  374. ShowLightMenu(id);
  375. }
  376. }
  377. }
  378.  
  379. public handleTemplatesMenu(id, key)
  380. {
  381. switch (key + 1)
  382. {
  383. case 1:
  384. {
  385. light_properites[id][1] = 255;
  386. light_properites[id][2] = 255;
  387. light_properites[id][3] = 255;
  388. ShowLightMenu(id);
  389. }
  390. case 2:
  391. {
  392.  
  393. light_properites[id][1] = 255;
  394. light_properites[id][2] = 0;
  395. light_properites[id][3] = 0;
  396. ShowLightMenu(id);
  397. }
  398. case 3:
  399. {
  400.  
  401. light_properites[id][1] = 0;
  402. light_properites[id][2] = 255;
  403. light_properites[id][3] = 0;
  404. ShowLightMenu(id);
  405. }
  406. case 4:
  407. {
  408.  
  409. light_properites[id][1] = 0;
  410. light_properites[id][2] = 0;
  411. light_properites[id][3] = 255;
  412. ShowLightMenu(id);
  413. }
  414. case 5:
  415. {
  416. light_properites[id][1] = 0;
  417. light_properites[id][2] = 205;
  418. light_properites[id][3] = 210;
  419. ShowLightMenu(id);
  420. }
  421. case 6:
  422. {
  423. light_properites[id][1] = 255;
  424. light_properites[id][2] = 255;
  425. light_properites[id][3] = 0;
  426. ShowLightMenu(id);
  427. }
  428. case 7:
  429. {
  430.  
  431. light_properites[id][1] = 255;
  432. light_properites[id][2] = 140;
  433. light_properites[id][3] = 0;
  434. ShowLightMenu(id);
  435. }
  436. case 8:
  437. {
  438.  
  439. light_properites[id][1] = 240;
  440. light_properites[id][2] = 20;
  441. light_properites[id][3] = 140;
  442. ShowLightMenu(id);
  443. }
  444. case 10:
  445. {
  446. ShowLightMenu(id);
  447. }
  448. }
  449. }
  450.  
  451. CreateLightAiming( id )
  452. {
  453. new origin[ 3 ], Float:vOrigin[ 3 ];
  454. new Float:flCrosshairPitch = get_pdata_float( id, 506 ) // m_flCrosshairPitch = 506;
  455. get_user_origin( id, origin, 3 );
  456. IVecFVec( origin, vOrigin );
  457. if(0.0 <= flCrosshairPitch <= 100.0)
  458. {
  459. vOrigin[ 2 ] -= gLightMaxY[ 2 ];
  460. }
  461. else vOrigin[ 2 ] += gLightMaxY[ 2 ];
  462.  
  463. new iRadius = light_properites[id][0];
  464. new iR = light_properites[id][1];
  465. new iG = light_properites[id][2];
  466. new iB = light_properites[id][3];
  467.  
  468. CreateLight( vOrigin, iRadius, iR, iG, iB );
  469. }
  470.  
  471. CreateLight( Float:vOrigin[ 3 ], iRadius, iR, iG, iB )
  472. {
  473. new iEntity = create_entity( "info_target" );
  474.  
  475. if( is_valid_ent( iEntity ) )
  476. {
  477. entity_set_string( iEntity, EV_SZ_classname, gszLightClassName );
  478. entity_set_int( iEntity, EV_INT_solid, SOLID_NOT );
  479. entity_set_int( iEntity, EV_INT_movetype, MOVETYPE_NONE );
  480. entity_set_model( iEntity, gszModel );
  481.  
  482. new Float:vSizeMin[ 3 ];
  483. new Float:vSizeMax[ 3 ];
  484. new Float:vAngles[ 3 ];
  485. vSizeMin = gLightMinY;
  486. vSizeMax = gLightMaxY;
  487. vAngles[ 0 ] = 90.0;
  488. vAngles[ 2 ] = 90.0;
  489. new szRadius[ 4 ], szR[ 4 ], szG[ 4 ], szB[ 4 ];
  490. new Float:RGB[ 3 ];
  491.  
  492. format( szRadius, 3, "%i", iRadius );
  493. format( szR, 3, "%i", iR );
  494. format( szG, 3, "%i", iG );
  495. format( szB, 3, "%i", iB );
  496.  
  497. entity_set_string( iEntity, EV_SZ_noise, szRadius );
  498. entity_set_string( iEntity, EV_SZ_noise1, szR );
  499. entity_set_string( iEntity, EV_SZ_noise2, szG );
  500. entity_set_string( iEntity, EV_SZ_noise3, szB );
  501.  
  502. RGB[ 0 ] = str_to_float( szR );
  503. RGB[ 1 ] = str_to_float( szG );
  504. RGB[ 2 ] = str_to_float( szB );
  505.  
  506. entity_set_size( iEntity, vSizeMin, vSizeMax );
  507.  
  508. entity_set_vector( iEntity, EV_VEC_rendercolor, RGB );
  509.  
  510. entity_set_float( iEntity, EV_FL_scale, 0.25 );
  511. entity_set_float( iEntity, EV_FL_nextthink, get_gametime() + 0.1 );
  512. entity_set_origin( iEntity, vOrigin );
  513.  
  514. return iEntity;
  515. }
  516. return 0;
  517. }
  518.  
  519. SaveLights( id )
  520. {
  521. if( file_exists( gConfigFile ) )
  522. delete_file( gConfigFile );
  523.  
  524. new iFile = fopen( gConfigFile, "wt" );
  525.  
  526. if( !iFile ) return;
  527.  
  528. new Float:vOrigin[ 3 ], iEntity, lightCount;
  529.  
  530. while( ( iEntity = find_ent_by_class( iEntity, gszLightClassName ) ) > 0 )
  531. {
  532. entity_get_vector( iEntity, EV_VEC_origin, vOrigin );
  533.  
  534. new szRadius[ 4 ], szR[ 4 ], szG[ 4 ], szB[ 4 ];
  535.  
  536. entity_get_string( iEntity, EV_SZ_noise, szRadius, 3 );
  537. entity_get_string( iEntity, EV_SZ_noise1, szR, 3 );
  538. entity_get_string( iEntity, EV_SZ_noise2, szG, 3 );
  539. entity_get_string( iEntity, EV_SZ_noise3, szB, 3 );
  540.  
  541. fprintf( iFile, "%f %f %f %s %s %s %s^n", vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ], szRadius, szR, szG, szB );
  542. ++lightCount;
  543. }
  544. new szName[ 33 ];
  545. get_user_name( id, szName, 32 );
  546. ColorChat( 0, GREEN, "%s^x03%s^x01 mentett^x03 %i^x01 lampat%s! Megmenthetsz:^x04 %i", gszPrefix, szName, lightCount, (lightCount == 1 ? "" : "s"), entity_count() );
  547.  
  548. fclose( iFile );
  549. }
  550.  
  551. LoadLights( id )
  552. {
  553. new bool:PrintMessage;
  554. PrintMessage = (id == 0 ? false : true);
  555.  
  556. new iFile = fopen( gConfigFile, "rt" );
  557.  
  558. if( !iFile ) return;
  559.  
  560. new iEntity = -1;
  561. while( ( iEntity = find_ent_by_class( iEntity, gszLightClassName ) ) )
  562. remove_entity( iEntity );
  563.  
  564. new Float:vOrigin[ 3 ], x[ 16 ], y[ 16 ], z[ 16 ], szData[ sizeof( x ) + sizeof( y ) + sizeof( z ) + 3 ];
  565. new szRadius[ 4 ], szR[ 4 ], szG[ 4 ], szB[ 4 ];
  566. new iRadius, iR, iG, iB;
  567. new lightCount;
  568. while( !feof( iFile ) )
  569. {
  570. fgets( iFile, szData, charsmax( szData ) );
  571. trim( szData );
  572.  
  573. if( !szData[ 0 ] ) continue;
  574.  
  575. parse( szData, x, 15, y, 15, z, 15, szRadius, 3, szR, 3, szG, 3, szB, 3 );
  576. vOrigin[ 0 ] = str_to_float( x );
  577. vOrigin[ 1 ] = str_to_float( y );
  578. vOrigin[ 2 ] = str_to_float( z );
  579. iRadius = str_to_num( szRadius );
  580. iR = str_to_num( szR );
  581. iG = str_to_num( szG );
  582. iB = str_to_num( szB );
  583. CreateLight( vOrigin, iRadius, iR, iG, iB );
  584. ++lightCount;
  585. }
  586. if( PrintMessage && lightCount > 0 )
  587. {
  588. new szName[ 33 ];
  589. get_user_name( id, szName, 32 );
  590. ColorChat( 0, GREEN, "%s^x03%s^x01 betoltott^x03 %i^x01 lampat%s! Osszesen Betoltheto Meg:^x04 %i", gszPrefix, szName, lightCount, (lightCount == 1 ? "" : "s"), entity_count() );
  591. }
  592. fclose( iFile );
  593. }
  594.  
  595. DeleteAllLights( id )
  596. {
  597. new iDeleted, iEntity = -1, szName[ 33 ];
  598. get_user_name( id, szName, 32 );
  599. while( ( iEntity = find_ent_by_class( iEntity, gszLightClassName ) ) )
  600. {
  601. remove_entity( iEntity );
  602. iDeleted++;
  603. ColorChat( 0, RED, "^x04%s^x03%s^x01 torolte^x03 az osszes lampat^x01 a palyarol! Lampa:^x04 %i", gszPrefix, szName, iDeleted );
  604. }
  605. }
  606.  
  607. SwitchNoclip( id )
  608. {
  609. new szName[ 33 ];
  610. get_user_name( id, szName, 32 );
  611. set_pev( id, pev_movetype, pev(id, pev_movetype) == MOVETYPE_NOCLIP ? MOVETYPE_WALK : MOVETYPE_NOCLIP );
  612. ColorChat(0, RED, "^x04%s^x03%s^x01 %skapcsolta]^x01 a Falont Atjarast maganak", gszPrefix, szName, pev(id, pev_movetype) == MOVETYPE_NOCLIP ? "^x04[be" : "^x03[ki");
  613. }
  614.  
  615. SwitchGodMode( id )
  616. {
  617. new szName[ 33 ];
  618. get_user_name( id, szName, 32 );
  619. set_pev( id, pev_takedamage, pev(id, pev_takedamage) == 0.0 ? 2.0 : 0.0 );
  620. ColorChat(0, RED, "^x04%s^x03%s^x01 %skapcsolta]^x01 az Isten Modot maganak", gszPrefix, szName, pev(id, pev_takedamage) == 0.0 ? "^x04[ki" : "^x03[be");
  621. }
  622.  
  623. public fwdLightThink( iEntity )
  624. {
  625. if( !pev_valid( iEntity ) ) return FMRES_IGNORED;
  626. static szClassname[ 32 ];
  627. pev( iEntity, pev_classname, szClassname, 31 );
  628.  
  629. if( equal( szClassname, gszLightClassName ) )
  630. {
  631. new Float:vOrigin[ 3 ];
  632. pev( iEntity, pev_origin, vOrigin );
  633.  
  634. new szRadius[ 4 ], szR[ 4 ], szG[ 4 ], szB[ 4 ];
  635.  
  636. pev( iEntity, pev_noise, szRadius, 3 );
  637. pev( iEntity, pev_noise1, szR, 3 );
  638. pev( iEntity, pev_noise2, szG, 3 );
  639. pev( iEntity, pev_noise3, szB, 3 );
  640.  
  641. new iRadius = str_to_num( szRadius );
  642. new iR = str_to_num( szR );
  643. new iG = str_to_num( szG );
  644. new iB = str_to_num( szB );
  645.  
  646. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  647. write_byte(TE_DLIGHT);
  648. engfunc(EngFunc_WriteCoord, vOrigin[0]);
  649. engfunc(EngFunc_WriteCoord, vOrigin[1]);
  650. engfunc(EngFunc_WriteCoord, vOrigin[2]);
  651. write_byte(iRadius); // radius in 10's
  652. write_byte(iR); // R
  653. write_byte(iG); // G
  654. write_byte(iB); // B
  655. write_byte(3); // life
  656. write_byte(0); // decay rate
  657. message_end();
  658.  
  659. set_pev( iEntity, pev_nextthink, get_gametime() + 0.1 );
  660. }
  661. return FMRES_IGNORED;
  662. }
  663. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  664. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
  665. */
  666.