hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.14. 10:25



Jelenlévő felhasználók

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

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: csomag
HozzászólásElküldve: 2015.04.14. 22:15 
Offline
Fanatikus

Csatlakozott: 2015.03.25. 18:06
Hozzászólások: 179
Megköszönt másnak: 43 alkalommal
Megköszönték neki: 6 alkalommal
Valaki segitene aba hogy megolok egy embert akor holtesten lesz egy csomag es fel veszem es talnak bene egy m4 et es hogy azt mentse el a felszerelesek be


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: csomag
HozzászólásElküldve: 2015.04.18. 17:28 
Offline
Jómunkásember
Avatar

Csatlakozott: 2015.04.18. 17:14
Hozzászólások: 454
Megköszönt másnak: 48 alkalommal
Megköszönték neki: 32 alkalommal
Hali! Régen ezt használtam a szerveremen. csak átírod a cuccokat és már tudod is arra amire akarod. KIINDULÁS:
SMA Forráskód: [ Mindet kijelol ]
  1. #include < amxmodx >
  2. #include < cstrike >
  3. #include < fakemeta >
  4. #include < engine >
  5. #include < fun >
  6. #include < xs >
  7.  
  8.  
  9. #pragma semicolon 1
  10.  
  11. #define PLUGIN "Knife ajandekok"
  12. #define VERSION "0.7.3"
  13.  
  14. #define ACCESS ADMIN_CVAR
  15.  
  16.  
  17. enum Color
  18. {
  19. NORMAL = 1, // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
  20. GREEN, // Culoare Verde.
  21. TEAM_COLOR, // Culoare Rosu, Albastru, Gri.
  22. GREY, // Culoarea Gri.
  23. RED, // Culoarea Rosu.
  24. BLUE, // Culoarea Albastru.
  25. };
  26.  
  27. new TeamName[ ][ ] =
  28. {
  29. "",
  30. "TERRORIST",
  31. "CT",
  32. "SPECTATOR"
  33. };
  34.  
  35. enum
  36. {
  37.  
  38. GIFT_HP,
  39. GIFT_AP,
  40. GIFT_HP_AP,
  41. GIFT_MONEY,
  42. GIFT_HE,
  43. BADGIFT_MONEY,
  44. BADGIFT_WEAPONS,
  45. BADGIFT_SLAP
  46.  
  47. }
  48.  
  49. new const g_szFmuGiftsModels[ 4 ][ ] =
  50. {
  51.  
  52. "models/tojas7.mdl",
  53. "models/tojas5.mdl",
  54. "models/tojas4.mdl",
  55. "models/tojas6.mdl"
  56.  
  57. };
  58.  
  59. new const g_iFmuGiftsColors[ 4 ][ 3 ] =
  60. {
  61. { 0, 255, 255 },
  62. { 0, 255, 125 },
  63. { 255, 125, 65 },
  64. { 255, 255, 255 }
  65. };
  66.  
  67. new const FMU_TAG[ ] = "[Ajandekok]";
  68. new const g_szGiftClassName[ ] = "FurienGift_byAskhanar";
  69.  
  70. // Nu modifica !!
  71. new Float:fMaxs[ 3 ] = { 14.0, 14.0, 35.0 };
  72. new Float:fMins[ 3 ] = { -14.0, -14.0, 0.0 };
  73. // Nu modifica !!
  74.  
  75. new gCvarGiftHP;
  76. new gCvarGiftAP;
  77. new gCvarGiftMoney;
  78. new gCvarGiftChance;
  79.  
  80.  
  81. public plugin_precache( )
  82. for( new i = 0; i < 7; i++ )
  83. precache_model( g_szFmuGiftsModels[ i ] );
  84.  
  85.  
  86. public plugin_init( )
  87. {
  88.  
  89. register_plugin( PLUGIN, VERSION, "Askhanar" );
  90.  
  91. gCvarGiftHP = register_cvar( "fmu_gifts_hp", "5" );
  92. gCvarGiftAP = register_cvar( "fmu_gifts_ap", "5" );
  93. gCvarGiftMoney = register_cvar( "fmu_gifts_money", "5500" );
  94. gCvarGiftChance = register_cvar( "fmu_gifts_chance", "75" );
  95.  
  96. register_event( "DeathMsg", "EventDeathMsg", "a" );
  97.  
  98. register_event( "HLTV", "DeleteAllGifts", "a", "1=0", "2=0" );
  99. register_event( "TextMsg", "DeleteAllGifts", "a", "2=#Game_will_restart_in" );
  100.  
  101. register_clcmd( "add_gift", "ClCmdAddGift" );
  102. register_clcmd( "delete_gift", "ClCmdDeleteGift" );
  103.  
  104. // Oprita.. ( cand omori ultimu jucator, pica cadoul dar e sters de chemarea eventului.. ).
  105. //register_logevent( "DeleteAllGifts", 2, "0=World triggered", "1=Round_Draw", "1=Round_End" );
  106.  
  107. register_touch( g_szGiftClassName, "player", "FwdPlayerTouchGift" );
  108.  
  109.  
  110. }
  111.  
  112. public ClCmdAddGift( id )
  113. {
  114. if( !(get_user_flags( id ) & ACCESS ) )
  115. {
  116. ColorChat( id, RED, "^x04%s^x03 TE^x01 Hozzaferhetsz ehhez a parancshoz.!", FMU_TAG );
  117. return PLUGIN_HANDLED;
  118. }
  119.  
  120. new Float:fAimOrigin[ 3 ];
  121. fm_get_aimorigin( id, fAimOrigin );
  122.  
  123. if( ( engfunc( EngFunc_PointContents, fAimOrigin ) != CONTENTS_SKY )
  124. && ( engfunc( EngFunc_PointContents, fAimOrigin ) != CONTENTS_SOLID ) )
  125. {
  126.  
  127. new iParm[ 3 ];
  128.  
  129. new iUserOrigin[ 3 ];
  130. FVecIVec( fAimOrigin, iUserOrigin );
  131.  
  132. iParm[ 0 ] = iUserOrigin[ 0 ];
  133. iParm[ 1 ] = iUserOrigin[ 1 ];
  134. iParm[ 2 ] = iUserOrigin[ 2 ];
  135.  
  136. set_task( 0.1, "CreateGift", _, iParm, 3 );
  137. ColorChat( id, RED, "^x04%s^x01 Egy ajandek sikeresen letrehozva!", FMU_TAG );
  138.  
  139. }
  140. else
  141. {
  142. ColorChat( id, RED, "^x04%s^x03 Ez a helyseg ervenytelen. !", FMU_TAG );
  143. }
  144.  
  145. return PLUGIN_CONTINUE;
  146.  
  147. }
  148.  
  149.  
  150. public ClCmdDeleteGift( id )
  151. {
  152.  
  153. if( !(get_user_flags( id ) & ACCESS ) )
  154. {
  155. ColorChat( id, RED, "^x04%s^x03 Neked^x01van hozzaferesed ehez a parancshoz !", FMU_TAG );
  156. return PLUGIN_HANDLED;
  157. }
  158.  
  159. new iEnt, iBody;
  160. get_user_aiming( id, iEnt, iBody );
  161.  
  162. if( pev_valid( iEnt ) )
  163. {
  164.  
  165. static szClassname[ 32 ];
  166. entity_get_string( iEnt, EV_SZ_classname, szClassname, sizeof ( szClassname ) - 1 );
  167.  
  168. if( !strcmp( szClassname, g_szGiftClassName, 1 ) )
  169. {
  170. remove_entity( iEnt );
  171. ColorChat( id, RED, "^x04%s^x01 Megegyszer kitoroltel egy ajandekot.!", FMU_TAG );
  172. }
  173. else
  174. {
  175. ColorChat( id, RED, "^x04%s^x01 Kell nezz egy uj ajandekot,hogy ki tudjad torolni.!", FMU_TAG );
  176. }
  177. }
  178.  
  179. return PLUGIN_CONTINUE;
  180.  
  181. }
  182.  
  183. public EventDeathMsg( )
  184. {
  185.  
  186. new iKiller = read_data( 1 );
  187. new iVictim = read_data( 2 );
  188.  
  189. if( iVictim != iKiller )
  190. {
  191.  
  192. static iRandomChance;
  193. iRandomChance = random_num( 1, 100 );
  194.  
  195. static iChance;
  196. iChance = get_pcvar_num( gCvarGiftChance );
  197.  
  198. if( iRandomChance <= iChance )
  199. {
  200. new iParm[ 3 ];
  201.  
  202. new Float:fUserOrigin[ 3 ], iUserOrigin[ 3 ];
  203. pev(iVictim, pev_origin, fUserOrigin );
  204. FVecIVec( fUserOrigin, iUserOrigin );
  205.  
  206. iParm[ 0 ] = iUserOrigin[ 0 ];
  207. iParm[ 1 ] = iUserOrigin[ 1 ];
  208. iParm[ 2 ] = iUserOrigin[ 2 ];
  209.  
  210. set_task( 0.7, "CreateGift", _, iParm, 3 );
  211. }
  212.  
  213. }
  214.  
  215.  
  216.  
  217.  
  218. return 0;
  219. }
  220.  
  221. public CreateGift( iParm[ ] )
  222. {
  223. new iOrigin[ 3 ], Float:fOrigin[ 3 ];
  224.  
  225.  
  226. iOrigin[ 0 ] = iParm[ 0 ];
  227. iOrigin[ 1 ] = iParm[ 1 ];
  228. iOrigin[ 2 ] = iParm[ 2 ];
  229. IVecFVec( iOrigin, fOrigin );
  230.  
  231. new iEnt = create_entity( "info_target" );
  232. if ( !is_valid_ent(iEnt) ) return 0;
  233.  
  234. new iRandom = random_num( 0, 6 );
  235.  
  236. entity_set_string( iEnt, EV_SZ_classname, g_szGiftClassName );
  237. entity_set_origin( iEnt, fOrigin );
  238. entity_set_model( iEnt, g_szFmuGiftsModels[ iRandom ] );
  239. entity_set_int( iEnt, EV_INT_movetype, MOVETYPE_NONE );
  240. entity_set_int( iEnt, EV_INT_solid, SOLID_BBOX );
  241. entity_set_size( iEnt, fMins, fMaxs );
  242.  
  243. set_rendering( iEnt,
  244. kRenderFxGlowShell,
  245. g_iFmuGiftsColors[ iRandom ][ 0 ],
  246. g_iFmuGiftsColors[ iRandom ][ 1 ],
  247. g_iFmuGiftsColors[ iRandom ][ 2 ],
  248. kRenderNormal,
  249. 255 );
  250.  
  251. drop_to_floor( iEnt );
  252.  
  253. new Float:fVelocity[ 3 ];
  254. fVelocity[ 0 ] = ( random_float( 0.0, 256.0 ) - 128.0 );
  255. fVelocity[ 1 ] = ( random_float( 0.0, 256.0 ) - 128.0 );
  256. fVelocity[ 2 ] = ( random_float( 0.0, 300.0 ) + 75.0 );
  257.  
  258. entity_set_vector( iEnt, EV_VEC_velocity, fVelocity );
  259.  
  260. return 0;
  261. }
  262.  
  263. public DeleteAllGifts( )
  264. {
  265. new iFoundEntity;
  266.  
  267. while ( ( iFoundEntity = find_ent_by_class( iFoundEntity, g_szGiftClassName ) ) != 0 )
  268. {
  269. engfunc( EngFunc_RemoveEntity, iFoundEntity );
  270. }
  271.  
  272. }
  273.  
  274. public FwdPlayerTouchGift( const iEnt, const id )
  275. {
  276.  
  277. if( is_valid_ent( iEnt ) && is_user_alive( id ) )
  278. {
  279.  
  280. static iRandomChance;
  281. iRandomChance = random_num( 1, 100 );
  282. if( iRandomChance <= 90 )
  283. {
  284. new iRandomGift = random_num( GIFT_HP, GIFT_HE );
  285. while( iRandomGift == GIFT_HE && user_has_weapon( id, CSW_HEGRENADE ) )
  286. iRandomGift = random_num( GIFT_HP, GIFT_HE );
  287.  
  288. GivePlayerGift( id, iRandomGift );
  289. }
  290. else
  291. {
  292. new iRandomGift = random_num( BADGIFT_MONEY, BADGIFT_SLAP );
  293. while( iRandomGift == BADGIFT_MONEY && cs_get_user_money( id ) == 0 )
  294. iRandomGift = random_num( BADGIFT_MONEY, BADGIFT_SLAP );
  295.  
  296. GivePlayerGift( id, iRandomGift );
  297. }
  298.  
  299. remove_entity( iEnt );
  300.  
  301. }
  302.  
  303. return 0;
  304. }
  305.  
  306. public GivePlayerGift( id, const iGiftType )
  307. {
  308.  
  309. switch( iGiftType )
  310. {
  311.  
  312. case GIFT_HP:
  313. {
  314. set_user_health( id, get_user_health( id ) + get_pcvar_num( gCvarGiftHP ) );
  315. ColorChat( id, RED, "^x04%s^x01 Gratulalok Kaptal ^x03 %i HP^x01!", FMU_TAG, get_pcvar_num( gCvarGiftHP ) );
  316.  
  317. }
  318. case GIFT_AP:
  319. {
  320. set_user_armor( id, get_user_armor( id ) + get_pcvar_num( gCvarGiftAP ) );
  321. ColorChat( id, RED, "^x04%s^x01 Gratulalok Kaptal ^x03 %i Armor^x01!", FMU_TAG, get_pcvar_num( gCvarGiftAP ) );
  322.  
  323. }
  324. case GIFT_HP_AP:
  325. {
  326. static iHP;
  327. iHP = get_pcvar_num( gCvarGiftHP );
  328. static iAP;
  329. iAP = get_pcvar_num( gCvarGiftAP );
  330. set_user_health( id, get_user_health( id ) + iHP );
  331. set_user_armor( id, get_user_armor( id ) + iAP );
  332.  
  333. ColorChat( id, RED, "^x04%s^x01 Gratulalok Kaptal^x03 %i HP^x01 si^x03 %i Armor^x01!", FMU_TAG, iHP, iAP );
  334. }
  335. case GIFT_MONEY:
  336. {
  337. cs_set_user_money( id, clamp( cs_get_user_money( id ) + get_pcvar_num( gCvarGiftMoney ), 0, 16000 ) );
  338. ColorChat( id, RED, "^x04%s^x01 Gratulalok Kaptal^x03 %i$^x01!", FMU_TAG, get_pcvar_num( gCvarGiftMoney ) );
  339. }
  340. case GIFT_HE:
  341. {
  342.  
  343. give_item( id, "weapon_hegrenade" );
  344. ColorChat( id, RED, "^x04%s^x01 Gratulalok kaptal^x03 1 darab HE-granatot^x01!", FMU_TAG );
  345.  
  346. }
  347.  
  348. case BADGIFT_MONEY:
  349. {
  350. cs_set_user_money( id, 0 );
  351. ColorChat( id, RED, "^x04%s^x03 Te^x01 nagyon jo^x03 vagy^x01!", FMU_TAG );
  352. ColorChat( id, RED, "^x04%s^x01 Elveszett a penzed!", FMU_TAG );
  353. }
  354. case BADGIFT_WEAPONS:
  355. {
  356. strip_user_weapons( id );
  357. give_item( id, "weapon_knife" );
  358. ColorChat( id, RED, "^x04%s^x03 Te^x01 Te nagyon jo^x03 vagy^x01!", FMU_TAG );
  359. ColorChat( id, RED, "^x04%s^x01 Az osszes fegyvert lefoglaltak!", FMU_TAG );
  360. }
  361. case BADGIFT_SLAP:
  362. {
  363. set_task( 0.1, "PunchUser", id );
  364. set_task( 0.2, "PunchUser", id );
  365. set_task( 0.3, "PunchUser", id );
  366.  
  367. ColorChat( id, RED, "^x04%s^x03 Te^x01 nagyon jo^x03 vagy^x01!", FMU_TAG );
  368. ColorChat( id, RED, "^x04%s^x01 Kaptal egy nagy^x03 3^x01 pofont!", FMU_TAG );
  369. }
  370. }
  371. }
  372.  
  373. public PunchUser( id )
  374. {
  375. if( !is_user_connected( id ) )
  376. return 1;
  377.  
  378. new Float:fRandomAngles[ 3 ];
  379. for(new i = 0; i < 3; i++)
  380. fRandomAngles[ i ] = random_float( 100.0, 150.0 );
  381.  
  382. entity_set_vector(id, EV_VEC_punchangle, fRandomAngles );
  383. user_slap( id, random_num( 1, 5 ) );
  384.  
  385. return 0;
  386. }
  387.  
  388. stock fm_get_aimorigin( id, Float:origin[ 3 ] )
  389. {
  390. new Float:start[ 3 ], Float:view_ofs[ 3 ];
  391.  
  392. pev( id, pev_origin, start );
  393. pev( id, pev_view_ofs, view_ofs );
  394. xs_vec_add( start, view_ofs, start );
  395.  
  396. new Float:dest[ 3 ];
  397.  
  398. pev( id, pev_v_angle, dest );
  399. engfunc( EngFunc_MakeVectors, dest );
  400.  
  401. global_get( glb_v_forward, dest );
  402. xs_vec_mul_scalar( dest, 9999.0, dest );
  403. xs_vec_add( start, dest, dest );
  404.  
  405. engfunc( EngFunc_TraceLine, start, dest, 0, id, 0 );
  406. get_tr2( 0, TR_vecEndPos, origin );
  407.  
  408. return 1;
  409. }
  410.  
  411.  
  412. ColorChat( id, Color:iType, const msg[ ], { Float, Sql, Result, _}:... )
  413. {
  414.  
  415. // Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
  416. if( !get_playersnum( ) ) return;
  417.  
  418. new szMessage[ 256 ];
  419.  
  420. switch( iType )
  421. {
  422. // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
  423. case NORMAL: szMessage[ 0 ] = 0x01;
  424.  
  425. // Culoare Verde.
  426. case GREEN: szMessage[ 0 ] = 0x04;
  427.  
  428. // Alb, Rosu, Albastru.
  429. default: szMessage[ 0 ] = 0x03;
  430. }
  431.  
  432. vformat( szMessage[ 1 ], 251, msg, 4 );
  433.  
  434. // Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
  435. szMessage[ 192 ] = '^0';
  436.  
  437.  
  438. new iTeam, iColorChange, iPlayerIndex, MSG_Type;
  439.  
  440. if( id )
  441. {
  442. MSG_Type = MSG_ONE_UNRELIABLE;
  443. iPlayerIndex = id;
  444. }
  445. else
  446. {
  447. iPlayerIndex = CC_FindPlayer( );
  448. MSG_Type = MSG_ALL;
  449. }
  450.  
  451. iTeam = get_user_team( iPlayerIndex );
  452. iColorChange = CC_ColorSelection( iPlayerIndex, MSG_Type, iType);
  453.  
  454. CC_ShowColorMessage( iPlayerIndex, MSG_Type, szMessage );
  455.  
  456. if( iColorChange ) CC_Team_Info( iPlayerIndex, MSG_Type, TeamName[ iTeam ] );
  457.  
  458. }
  459.  
  460. CC_ShowColorMessage( id, const iType, const szMessage[ ] )
  461. {
  462.  
  463. static bool:bSayTextUsed;
  464. static iMsgSayText;
  465.  
  466. if( !bSayTextUsed )
  467. {
  468. iMsgSayText = get_user_msgid( "SayText" );
  469. bSayTextUsed = true;
  470. }
  471.  
  472. message_begin( iType, iMsgSayText, _, id );
  473. write_byte( id );
  474. write_string( szMessage );
  475. message_end( );
  476. }
  477.  
  478. CC_Team_Info( id, const iType, const szTeam[ ] )
  479. {
  480. static bool:bTeamInfoUsed;
  481. static iMsgTeamInfo;
  482. if( !bTeamInfoUsed )
  483. {
  484. iMsgTeamInfo = get_user_msgid( "TeamInfo" );
  485. bTeamInfoUsed = true;
  486. }
  487.  
  488. message_begin( iType, iMsgTeamInfo, _, id );
  489. write_byte( id );
  490. write_string( szTeam );
  491. message_end( );
  492.  
  493. return 1;
  494. }
  495.  
  496. CC_ColorSelection( id, const iType, Color:iColorType)
  497. {
  498. switch( iColorType )
  499. {
  500.  
  501. case RED: return CC_Team_Info( id, iType, TeamName[ 1 ] );
  502. case BLUE: return CC_Team_Info( id, iType, TeamName[ 2 ] );
  503. case GREY: return CC_Team_Info( id, iType, TeamName[ 0 ] );
  504.  
  505. }
  506.  
  507. return 0;
  508. }
  509.  
  510. CC_FindPlayer( )
  511. {
  512. new iMaxPlayers = get_maxplayers( );
  513.  
  514. for( new i = 1; i <= iMaxPlayers; i++ )
  515. if( is_user_connected( i ) )
  516. return i;
  517.  
  518. return -1;
  519. }

 

Kérem jelezz vissza:)

_________________
Nem Toretto vagyok!!! hanem s[T]* Levii (És le lehet szállni a Torreto-zásról)

Ts3 Ip: ts.beathost.ml:10005


A hozzászólást 2 alkalommal szerkesztették, utoljára Zeei 2015.04.18. 17:35-kor.
máskor tedd [sma][/sma] közé...


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: csomag
HozzászólásElküldve: 2015.04.18. 18:01 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.04.10. 15:32
Hozzászólások: 776
Megköszönt másnak: 122 alkalommal
Megköszönték neki: 60 alkalommal
Sztem inkább ,ezt használd.Ezt könyebben átlátod ,illetve könyebben tudod szerkeszteni.
Amit adtak neked fentebb ,az szerintem neked túlbonyolult.

viewtopic.php?f=100&t=20340

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: csomag
HozzászólásElküldve: 2015.04.18. 18:28 
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
alfaanero írta:
Sztem inkább ,ezt használd.Ezt könyebben átlátod ,illetve könyebben tudod szerkeszteni.
Amit adtak neked fentebb ,az szerintem neked túlbonyolult.

viewtopic.php?f=100&t=20340

Jajj egyem a szived <3 :oops:


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  [ 4 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 72 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