hlmod.hu
https://hlmod.hu/

Spawn Deagle-el, Five-Seven-nel
https://hlmod.hu/viewtopic.php?f=29&t=10374
Oldal: 1 / 1

Szerző:  xXLegendXx [ 2013.08.22. 10:59 ]
Hozzászólás témája:  Spawn Deagle-el, Five-Seven-nel

Sziasztok! Egy olyan plugint szeretnék kérni, hogy spawnolás után autómatikusan a CT-k kapjanak egy Five-seven-t, a Terroristák pedig egy Desert Eagle-t. Mind a kettőt tele tárral. Ha valaki megcsinálja, annak előre is megköszönöm.

Szerző:  RaZzoR [ 2013.08.22. 11:04 ]
Hozzászólás témája:  Re: Spawn Deagle-el, Five-Seven-nel

SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <hamsandwich>
  4. #include <cstrike>
  5.  
  6. public plugin_init()
  7. {
  8. register_plugin("Spawn", "1.0", "RaZzoR")
  9. RegisterHam(Ham_Spawn, "player", "Spawn", 1)
  10. }
  11.  
  12. public Spawn(id)
  13. {
  14. if(get_user_team(id) == 1)
  15. {
  16. give_item(id, "weapon_deagle")
  17. cs_set_user_bpammo(id, CSW_DEAGLE, 35)
  18. }
  19.  
  20. if(get_user_team(id) == 2)
  21. {
  22. give_item(id, "weapon_fiveseven")
  23. cs_set_user_bpammo(id, CSW_FIVESEVEN, 100)
  24. }
  25. }

Szerző:  kiki [ 2013.08.22. 13:00 ]
Hozzászólás témája:  Re: Spawn Deagle-el, Five-Seven-nel

Vedd el neki az alap pisztolyokat szerintem. Kettő pisztoly lesz nálluk az cinkes.

Szerző:  Vinnice [ 2013.08.22. 13:07 ]
Hozzászólás témája:  Re: Spawn Deagle-el, Five-Seven-nel

kiki írta:
Vedd el neki az alap pisztolyokat szerintem. Kettő pisztoly lesz nálluk az cinkes.

Elvileg ez így jó.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <hamsandwich>
  4. #include <cstrike>
  5. #include <fakemeta>
  6.  
  7. public plugin_init()
  8. {
  9. register_plugin("Spawn", "1.0", "RaZzoR");
  10. RegisterHam(Ham_Spawn, "player", "Spawn", 1);
  11. };
  12.  
  13. public Spawn(id)
  14. {
  15. switch(cs_get_user_team(id))
  16. {
  17. case CS_TEAM_T:
  18. {
  19. give_item(id, "weapon_deagle");
  20. cs_set_user_bpammo(id, CSW_DEAGLE, 35);
  21. ham_strip_weapon(id, "weapon_glock18");
  22. }
  23. case CS_TEAM_CT:
  24. {
  25. give_item(id, "weapon_fiveseven");
  26. cs_set_user_bpammo(id, CSW_FIVESEVEN, 100);
  27. ham_strip_weapon(id, "weapon_usp");
  28. }
  29. }
  30. };
  31. stock ham_strip_weapon(id,weapon[])
  32. {
  33. if(!equal(weapon,"weapon_",7)) return 0;
  34.  
  35. new wId = get_weaponid(weapon);
  36. if(!wId) return 0;
  37.  
  38. new wEnt;
  39. while((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
  40. if(!wEnt) return 0;
  41.  
  42. if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
  43.  
  44. if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;
  45. ExecuteHamB(Ham_Item_Kill,wEnt);
  46.  
  47. set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId));
  48.  
  49. if(wId == CSW_C4)
  50. {
  51. cs_set_user_plant(id,0,0);
  52. cs_set_user_bpammo(id,CSW_C4,0);
  53. }
  54. else if(wId == CSW_SMOKEGRENADE || wId == CSW_FLASHBANG || wId == CSW_HEGRENADE)
  55. cs_set_user_bpammo(id,wId,0);
  56.  
  57. return 1;
  58. };

Szerző:  RaZzoR [ 2013.08.22. 14:43 ]
Hozzászólás témája:  Re: Spawn Deagle-el, Five-Seven-nel

kiki írta:
Vedd el neki az alap pisztolyokat szerintem. Kettő pisztoly lesz nálluk az cinkes.


nem kérte, hogy vegyem el :D

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