hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.03.29. 09:39



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot] 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  [ 20 hozzászólás ]  Oldal Előző 1 2
Szerző Üzenet
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.11. 11:43 
Offline
Tag

Csatlakozott: 2018.01.23. 20:45
Hozzászólások: 43
Megköszönt másnak: 9 alkalommal
demon írta:
Nem kell így túlbonyolítani a dolgokat, van sokkal egyszerűbb módja is.
Minden entityhez tartozik 4 darab integer változó (iuser1, iuser2, iuser3, iuser4), amelyet kedvünk szerint állíthatunk, ebben az esetben 1 is elég. Ezt a változót halálkor és drop estén állítjuk be, amely tartalmazni fogja a skin id-jét, ha felveszi valaki ezt a fegyvert akkor Ham_Item_Deploy eseménynél lekérjük ezt a változót és beállítjuk a skint.

#define SetWeapSkin(%1,%2) ( set_pev( %1, pev_iuser1, %2 ) )
#define GetWeapSkin(%1) ( pev( %1, pev_iuser1 ) )

SetWeapSkin( Entity, Érték ); -- beállítja az entity iuser1 értékét a megadott Értékre
GetWeapSkin( Entity ); -- visszaadja az adott Entity iuser1 értékét (0-t ad vissza, ha nincs beállítva)


Ezzel próbáltam megcsinálni, hogy egy szimpla csomag a hullán pluginnál, a csomag elmentse az áldozat id-jét, és ha valaki felveszi akkor kiirja, hogy kinek a csomagját vette fel.
Ezzel csak az a gond, hogy mindig annak a nevét irja, aki utoljára meghalt.Ez ellen lehet tenni valamit?

  1. public Drop()
  2. {
  3.     new Victim; Victim = read_data(2);
  4.     static Float:Origin[3];
  5.     pev(Victim, pev_origin, Origin);
  6.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  7.     Origin[2] -= 36;
  8.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  9.  
  10.     if(!pev_valid(Ent))
  11.         return PLUGIN_HANDLED;
  12.  
  13.     set_pev(Ent, pev_classname, "dogcedula");
  14.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  15.     dllfunc(DLLFunc_Spawn, Ent);
  16.     set_pev(Ent, pev_solid, SOLID_BBOX);
  17.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  18.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  19.     engfunc(EngFunc_DropToFloor, Ent);
  20.     SetWeapSkin(Ent, Victim);
  21.     return PLUGIN_HANDLED;
  22. }
  23. public ForwardTouch(Ent, id)
  24. {
  25.     if(pev_valid(Ent))
  26.     {
  27.         new ClassName[32];
  28.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  29.  
  30.         if(!equal(ClassName, "dogcedula"))
  31.             return FMRES_IGNORED;
  32.  
  33.         new pName[32], idVictim;
  34.         idVictim = GetWeapSkin(Ent);
  35.         client_printcolor(id, "%s csomagjat vetted fel.", pName[32]);
  36.         csomag[id]++;
  37.         engfunc(EngFunc_RemoveEntity, Ent);
  38.     }
  39.     return FMRES_IGNORED;
  40. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.11. 20:46 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.01.15. 19:04
Hozzászólások: 407
Megköszönt másnak: 17 alkalommal
Megköszönték neki: 176 alkalommal
Ha csak a név kell akkor jobban jársz, ha azt tárolod el pev_message-ben, így a lecsatlakozás problémát is megoldod.
  1. public Drop(iVictim)
  2. {
  3.     static Float:Origin[3], sName[ 32 ];
  4.     pev(Victim, pev_origin, Origin);
  5.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6.     Origin[2] -= 36;
  7.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  8.  
  9.     if(!pev_valid(Ent))
  10.         return PLUGIN_HANDLED;
  11.        
  12.     get_user_name( iVictim, sName, charsmax( sName ) );
  13.    
  14.     set_pev( Ent, pev_message, sName );
  15.  
  16.     set_pev(Ent, pev_classname, "dogcedula");
  17.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  18.     dllfunc(DLLFunc_Spawn, Ent);
  19.     set_pev(Ent, pev_solid, SOLID_BBOX);
  20.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  21.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  22.     engfunc(EngFunc_DropToFloor, Ent);
  23.     return PLUGIN_HANDLED;
  24. }
  25. public ForwardTouch(Ent, id)
  26. {
  27.     if(pev_valid(Ent))
  28.     {
  29.         new ClassName[32];
  30.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  31.  
  32.         if(!equal(ClassName, "dogcedula"))
  33.             return FMRES_IGNORED;
  34.  
  35.         new sOwner[ 32 ];
  36.         pev( Ent, pev_message, sOwner, charsmax( sOwner ) );
  37.         client_printcolor(id, "%s csomagjat vetted fel.", sOwner);
  38.         csomag[id]++;
  39.         engfunc(EngFunc_RemoveEntity, Ent);
  40.     }
  41.     return FMRES_IGNORED;
  42. }


A Drop függvényt gondolom a halál eventben hívod meg, így egyből megadhatod paraméterként a játékos id-t is (Drop(Victim)).

Ők köszönték meg demon nek ezt a hozzászólást (összesen 2): Egoista (2018.02.11. 20:53) • 8mTNNe (2022.02.08. 20:54)
  Népszerűség: 4.55%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.11. 22:34 
Offline
Tud valamit
Avatar

Csatlakozott: 2018.02.07. 01:13
Hozzászólások: 127
Megköszönt másnak: 7 alkalommal
Megköszönték neki: 25 alkalommal
demon írta:
Ha csak a név kell akkor jobban jársz, ha azt tárolod el pev_message-ben, így a lecsatlakozás problémát is megoldod.
  1. public Drop(iVictim)
  2. {
  3.     static Float:Origin[3], sName[ 32 ];
  4.     pev(Victim, pev_origin, Origin);
  5.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6.     Origin[2] -= 36;
  7.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  8.  
  9.     if(!pev_valid(Ent))
  10.         return PLUGIN_HANDLED;
  11.        
  12.     get_user_name( iVictim, sName, charsmax( sName ) );
  13.    
  14.     set_pev( Ent, pev_message, sName );
  15.  
  16.     set_pev(Ent, pev_classname, "dogcedula");
  17.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  18.     dllfunc(DLLFunc_Spawn, Ent);
  19.     set_pev(Ent, pev_solid, SOLID_BBOX);
  20.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  21.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  22.     engfunc(EngFunc_DropToFloor, Ent);
  23.     return PLUGIN_HANDLED;
  24. }
  25. public ForwardTouch(Ent, id)
  26. {
  27.     if(pev_valid(Ent))
  28.     {
  29.         new ClassName[32];
  30.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  31.  
  32.         if(!equal(ClassName, "dogcedula"))
  33.             return FMRES_IGNORED;
  34.  
  35.         new sOwner[ 32 ];
  36.         pev( Ent, pev_message, sOwner, charsmax( sOwner ) );
  37.         client_printcolor(id, "%s csomagjat vetted fel.", sOwner);
  38.         csomag[id]++;
  39.         engfunc(EngFunc_RemoveEntity, Ent);
  40.     }
  41.     return FMRES_IGNORED;
  42. }


A Drop függvényt gondolom a halál eventben hívod meg, így egyből megadhatod paraméterként a játékos id-t is (Drop(Victim)).

Es hol kell ezt lekerni
  1. public ForwardTouch(Ent, id)
  2. {
  3.     if(pev_valid(Ent))
  4.     {
  5.         new ClassName[32];
  6.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  7.  
  8.         if(!equal(ClassName, "dogcedula"))
  9.             return FMRES_IGNORED;
  10.  
  11.         new sOwner[ 32 ];
  12.         pev( Ent, pev_message, sOwner, charsmax( sOwner ) );
  13.         client_printcolor(id, "%s csomagjat vetted fel.", sOwner);
  14.         csomag[id]++;
  15.         engfunc(EngFunc_RemoveEntity, Ent);
  16.     }
  17.     return FMRES_IGNORED;
  18. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 15:23 
Offline
Őstag
Avatar

Csatlakozott: 2015.07.27. 22:56
Hozzászólások: 1367
Megköszönt másnak: 28 alkalommal
Megköszönték neki: 351 alkalommal
Ahol a játékos hozzáér az entityhez ami a földön van, avagy "felveszi".


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 15:50 
Offline
Tag

Csatlakozott: 2018.01.23. 20:45
Hozzászólások: 43
Megköszönt másnak: 9 alkalommal
demon írta:
Ha csak a név kell akkor jobban jársz, ha azt tárolod el pev_message-ben, így a lecsatlakozás problémát is megoldod.
  1. public Drop(iVictim)
  2. {
  3.     static Float:Origin[3], sName[ 32 ];
  4.     pev(Victim, pev_origin, Origin);
  5.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  6.     Origin[2] -= 36;
  7.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  8.  
  9.     if(!pev_valid(Ent))
  10.         return PLUGIN_HANDLED;
  11.        
  12.     get_user_name( iVictim, sName, charsmax( sName ) );
  13.    
  14.     set_pev( Ent, pev_message, sName );
  15.  
  16.     set_pev(Ent, pev_classname, "dogcedula");
  17.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  18.     dllfunc(DLLFunc_Spawn, Ent);
  19.     set_pev(Ent, pev_solid, SOLID_BBOX);
  20.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  21.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  22.     engfunc(EngFunc_DropToFloor, Ent);
  23.     return PLUGIN_HANDLED;
  24. }
  25. public ForwardTouch(Ent, id)
  26. {
  27.     if(pev_valid(Ent))
  28.     {
  29.         new ClassName[32];
  30.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  31.  
  32.         if(!equal(ClassName, "dogcedula"))
  33.             return FMRES_IGNORED;
  34.  
  35.         new sOwner[ 32 ];
  36.         pev( Ent, pev_message, sOwner, charsmax( sOwner ) );
  37.         client_printcolor(id, "%s csomagjat vetted fel.", sOwner);
  38.         csomag[id]++;
  39.         engfunc(EngFunc_RemoveEntity, Ent);
  40.     }
  41.     return FMRES_IGNORED;
  42. }


A Drop függvényt gondolom a halál eventben hívod meg, így egyből megadhatod paraméterként a játékos id-t is (Drop(Victim)).


Köszönöm szépen, de ezzel is ugyan az a baj.Akárkinek a csomagját veszem fel mindig annak a nevét irja, akit utoljára megöltek.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 18:33 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.01.15. 19:04
Hozzászólások: 407
Megköszönt másnak: 17 alkalommal
Megköszönték neki: 176 alkalommal
Valamit rosszul csináltál, másold be a teljes kódot a halál eventtel együtt.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 18:54 
Offline
Tag

Csatlakozott: 2018.01.23. 20:45
Hozzászólások: 43
Megköszönt másnak: 9 alkalommal
demon írta:
Valamit rosszul csináltál, másold be a teljes kódot a halál eventtel együtt.


  1. new Team[33], Ent;
  2.  
  3. public plugin_precache() precache_model("models/model.mdl");
  4. public plugin_init() {
  5.     register_plugin(PLUGIN, VERSION, AUTHOR);
  6.     register_event("DeathMsg", "Death", "a");
  7.     register_forward(FM_Touch, "ForwardTouch");
  8. }
  9. public Death()
  10. {
  11.     new Killer = read_data(1);
  12.     new Victim = read_data(2);
  13.  
  14.     if(Killer != Victim && is_user_alive(Killer) && is_user_connected(Victim))
  15.         Drop(Victim);
  16. }
  17. public Drop(Victim)
  18. {
  19.     new VictimName[32];
  20.     get_user_name(Victim, VictimName, charsmax(VictimName));
  21.     static Float:Origin[3];
  22.     pev(Victim, pev_origin, Origin);
  23.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  24.     Origin[2] -= 36;
  25.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  26.  
  27.     if(!pev_valid(Ent))
  28.         return PLUGIN_HANDLED;
  29.  
  30.  
  31.     set_pev(Ent, pev_classname, "asdasd");
  32.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  33.     dllfunc(DLLFunc_Spawn, Ent);
  34.     set_pev(Ent, pev_solid, SOLID_BBOX);
  35.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  36.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  37.     engfunc(EngFunc_DropToFloor, Ent);
  38.     set_pev(Ent, pev_message, VictimName);
  39.     client_printcolor(0, "DROP VICTIM ID: %d", Victim);
  40.     //SetEntiUser(Ent, Victim);
  41.     return PLUGIN_HANDLED;
  42. }
  43. public ForwardTouch(Ent, id)
  44. {
  45.     if(pev_valid(Ent))
  46.     {
  47.         new ClassName[32];
  48.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  49.  
  50.         if(!equal(ClassName, "asdasd"))
  51.             return FMRES_IGNORED;
  52.  
  53.         Find(id);
  54.         engfunc(EngFunc_RemoveEntity, Ent);
  55.     }
  56.     return FMRES_IGNORED;
  57. }
  58. public Find(id)
  59. {
  60.     new VictimName[32], pName[32], Players[32], Num, idVictim;
  61.     pev(Ent, pev_message, VictimName, charsmax(VictimName));
  62.     get_players(Players, Num);
  63.  
  64.     for(new i; i < Num; i++)
  65.     {
  66.         new iName[32];
  67.         get_user_name(Players[i], iName, charsmax(iName));
  68.  
  69.         if(equal(iName, VictimName))
  70.             idVictim = Players[i];
  71.     }
  72.  
  73.     new CsTeams:userTeam = cs_get_user_team(id)
  74.     new CsTeams:victimTeam = cs_get_user_team(idVictim);
  75.     get_user_name(id, pName, charsmax(pName));
  76.  
  77.     switch(userTeam) {
  78.         case CS_TEAM_T: Team[id] = 1;
  79.         case CS_TEAM_CT: Team[id] = 2;
  80.     }
  81.     switch(victimTeam) {
  82.         case CS_TEAM_T: Team[idVictim] = 1;
  83.         case CS_TEAM_CT: Team[idVictim] = 2;
  84.     }
  85.    
  86.     if(Team[id] == Team[idVictim]) {
  87.         client_printcolor(id, "!g%s !yFelélesztetted a(z) egyik csapattársadat(!t%s!y).", CHATPREFIX, VictimName);
  88.         client_printcolor(idVictim, "!g%s !t%s !yFelélesztetted téged!", CHATPREFIX, pName);
  89.     }
  90.     else
  91.         client_printcolor(id, "!g%s !yKaptál egy !tCsomagot!y!", CHATPREFIX);
  92.  
  93.     return PLUGIN_HANDLED;
  94. }
  95. public logevent_round_start()
  96. {
  97.     new EntName = FM_NULLENT;
  98.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  99.         engfunc(EngFunc_RemoveEntity, EntName);
  100. }
  101. public logevent_round_end()
  102. {
  103.     new EntName = FM_NULLENT;
  104.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  105.         engfunc(EngFunc_RemoveEntity, EntName);
  106. }
  107. stock client_printcolor(const id, const input[], any:...)
  108. {
  109.     new count = 1, players[32];
  110.     static msg[191];
  111.     vformat(msg, 190, input, 3);
  112.    
  113.     replace_all(msg, 190, "!g", "^4");
  114.     replace_all(msg, 190, "!y", "^1");
  115.     replace_all(msg, 190, "!t", "^3")   ;
  116.    
  117.     if (id) players[0] = id; else get_players(players, count, "ch");
  118.     {
  119.         for (new i = 0; i < count; i++)
  120.         {
  121.             if (is_user_connected(players[i]))
  122.             {
  123.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  124.                 write_byte(players[i]);
  125.                 write_string(msg);
  126.                 message_end();
  127.             }
  128.         }
  129.     }
  130.     return PLUGIN_HANDLED;
  131. }


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 22:30 
Offline
Jómunkásember
Avatar

Csatlakozott: 2013.01.15. 19:04
Hozzászólások: 407
Megköszönt másnak: 17 alkalommal
Megköszönték neki: 176 alkalommal
  1. new Team[33], Ent;
  2.  
  3. public plugin_precache() precache_model("models/model.mdl");
  4. public plugin_init() {
  5.     register_plugin(PLUGIN, VERSION, AUTHOR);
  6.     register_event("DeathMsg", "Death", "a");
  7.     register_forward(FM_Touch, "ForwardTouch");
  8. }
  9. public Death()
  10. {
  11.     new Killer = read_data(1);
  12.     new Victim = read_data(2);
  13.  
  14.     if(Killer != Victim && is_user_alive(Killer) && is_user_connected(Victim))
  15.     {
  16.         Team[Victim] = cs_get_user_team(Victim);
  17.         Drop(Victim);
  18.     }
  19. }
  20. public Drop(Victim)
  21. {
  22.     new VictimName[32];
  23.     get_user_name(Victim, VictimName, charsmax(VictimName));
  24.     static Float:Origin[3];
  25.     pev(Victim, pev_origin, Origin);
  26.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  27.     Origin[2] -= 36;
  28.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  29.  
  30.     if(!pev_valid(Ent))
  31.         return PLUGIN_HANDLED;
  32.  
  33.  
  34.     set_pev(Ent, pev_classname, "asdasd");
  35.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  36.     dllfunc(DLLFunc_Spawn, Ent);
  37.     set_pev(Ent, pev_solid, SOLID_BBOX);
  38.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  39.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  40.     engfunc(EngFunc_DropToFloor, Ent);
  41.     set_pev(Ent, pev_message, VictimName);
  42.     client_printcolor(0, "DROP VICTIM ID: %d", Victim);
  43.     set_pev( Ent, pev_iuser1, Victim )
  44.     return PLUGIN_HANDLED;
  45. }
  46. public ForwardTouch(Ent, id)
  47. {
  48.     if(pev_valid(Ent))
  49.     {
  50.         new ClassName[32];
  51.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  52.  
  53.         if(!equal(ClassName, "asdasd"))
  54.             return FMRES_IGNORED;
  55.  
  56.         Find(id, Ent);
  57.     }
  58.     return FMRES_IGNORED;
  59. }
  60. public Find(id, iEnt)
  61. {
  62.     new VictimName[32], pName[32], idVictim;
  63.     pev(iEnt, pev_message, VictimName, charsmax(VictimName));
  64.     idVictim = pev( iEnt, pev_iuser1 );
  65.    
  66.     engfunc(EngFunc_RemoveEntity, Ent);
  67.  
  68.     new CsTeams:userTeam = cs_get_user_team(id)
  69.     get_user_name(id, pName, charsmax(pName));
  70.  
  71.     switch(userTeam) {
  72.         case CS_TEAM_T: Team[id] = 1;
  73.         case CS_TEAM_CT: Team[id] = 2;
  74.     }
  75.    
  76.     if(Team[id] == Team[idVictim]) {
  77.         client_printcolor(id, "!g%s !yFelélesztetted a(z) egyik csapattársadat(!t%s!y).", CHATPREFIX, VictimName);
  78.         client_printcolor(idVictim, "!g%s !t%s !yFelélesztetted téged!", CHATPREFIX, pName);
  79.     }
  80.     else
  81.         client_printcolor(id, "!g%s !yKaptál egy !tCsomagot!y!", CHATPREFIX);
  82.  
  83.     return PLUGIN_HANDLED;
  84. }
  85. public logevent_round_start()
  86. {
  87.     new EntName = FM_NULLENT;
  88.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  89.         engfunc(EngFunc_RemoveEntity, EntName);
  90. }
  91. public logevent_round_end()
  92. {
  93.     new EntName = FM_NULLENT;
  94.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  95.         engfunc(EngFunc_RemoveEntity, EntName);
  96. }
  97. stock client_printcolor(const id, const input[], any:...)
  98. {
  99.     new count = 1, players[32];
  100.     static msg[191];
  101.     vformat(msg, 190, input, 3);
  102.    
  103.     replace_all(msg, 190, "!g", "^4");
  104.     replace_all(msg, 190, "!y", "^1");
  105.     replace_all(msg, 190, "!t", "^3")   ;
  106.    
  107.     if (id) players[0] = id; else get_players(players, count, "ch");
  108.     {
  109.         for (new i = 0; i < count; i++)
  110.         {
  111.             if (is_user_connected(players[i]))
  112.             {
  113.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  114.                 write_byte(players[i]);
  115.                 write_string(msg);
  116.                 message_end();
  117.             }
  118.         }
  119.     }
  120.     return PLUGIN_HANDLED;
  121. }

Ők köszönték meg demon nek ezt a hozzászólást: Egoista (2018.02.12. 22:42)
  Népszerűség: 2.27%


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 22:54 
Offline
Tag

Csatlakozott: 2018.01.23. 20:45
Hozzászólások: 43
Megköszönt másnak: 9 alkalommal
demon írta:
  1. new Team[33], Ent;
  2.  
  3. public plugin_precache() precache_model("models/model.mdl");
  4. public plugin_init() {
  5.     register_plugin(PLUGIN, VERSION, AUTHOR);
  6.     register_event("DeathMsg", "Death", "a");
  7.     register_forward(FM_Touch, "ForwardTouch");
  8. }
  9. public Death()
  10. {
  11.     new Killer = read_data(1);
  12.     new Victim = read_data(2);
  13.  
  14.     if(Killer != Victim && is_user_alive(Killer) && is_user_connected(Victim))
  15.     {
  16.         Team[Victim] = cs_get_user_team(Victim);
  17.         Drop(Victim);
  18.     }
  19. }
  20. public Drop(Victim)
  21. {
  22.     new VictimName[32];
  23.     get_user_name(Victim, VictimName, charsmax(VictimName));
  24.     static Float:Origin[3];
  25.     pev(Victim, pev_origin, Origin);
  26.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  27.     Origin[2] -= 36;
  28.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  29.  
  30.     if(!pev_valid(Ent))
  31.         return PLUGIN_HANDLED;
  32.  
  33.  
  34.     set_pev(Ent, pev_classname, "asdasd");
  35.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  36.     dllfunc(DLLFunc_Spawn, Ent);
  37.     set_pev(Ent, pev_solid, SOLID_BBOX);
  38.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  39.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  40.     engfunc(EngFunc_DropToFloor, Ent);
  41.     set_pev(Ent, pev_message, VictimName);
  42.     client_printcolor(0, "DROP VICTIM ID: %d", Victim);
  43.     set_pev( Ent, pev_iuser1, Victim )
  44.     return PLUGIN_HANDLED;
  45. }
  46. public ForwardTouch(Ent, id)
  47. {
  48.     if(pev_valid(Ent))
  49.     {
  50.         new ClassName[32];
  51.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  52.  
  53.         if(!equal(ClassName, "asdasd"))
  54.             return FMRES_IGNORED;
  55.  
  56.         Find(id, Ent);
  57.     }
  58.     return FMRES_IGNORED;
  59. }
  60. public Find(id, iEnt)
  61. {
  62.     new VictimName[32], pName[32], idVictim;
  63.     pev(iEnt, pev_message, VictimName, charsmax(VictimName));
  64.     idVictim = pev( iEnt, pev_iuser1 );
  65.    
  66.     engfunc(EngFunc_RemoveEntity, Ent);
  67.  
  68.     new CsTeams:userTeam = cs_get_user_team(id)
  69.     get_user_name(id, pName, charsmax(pName));
  70.  
  71.     switch(userTeam) {
  72.         case CS_TEAM_T: Team[id] = 1;
  73.         case CS_TEAM_CT: Team[id] = 2;
  74.     }
  75.    
  76.     if(Team[id] == Team[idVictim]) {
  77.         client_printcolor(id, "!g%s !yFelélesztetted a(z) egyik csapattársadat(!t%s!y).", CHATPREFIX, VictimName);
  78.         client_printcolor(idVictim, "!g%s !t%s !yFelélesztetted téged!", CHATPREFIX, pName);
  79.     }
  80.     else
  81.         client_printcolor(id, "!g%s !yKaptál egy !tCsomagot!y!", CHATPREFIX);
  82.  
  83.     return PLUGIN_HANDLED;
  84. }
  85. public logevent_round_start()
  86. {
  87.     new EntName = FM_NULLENT;
  88.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  89.         engfunc(EngFunc_RemoveEntity, EntName);
  90. }
  91. public logevent_round_end()
  92. {
  93.     new EntName = FM_NULLENT;
  94.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  95.         engfunc(EngFunc_RemoveEntity, EntName);
  96. }
  97. stock client_printcolor(const id, const input[], any:...)
  98. {
  99.     new count = 1, players[32];
  100.     static msg[191];
  101.     vformat(msg, 190, input, 3);
  102.    
  103.     replace_all(msg, 190, "!g", "^4");
  104.     replace_all(msg, 190, "!y", "^1");
  105.     replace_all(msg, 190, "!t", "^3")   ;
  106.    
  107.     if (id) players[0] = id; else get_players(players, count, "ch");
  108.     {
  109.         for (new i = 0; i < count; i++)
  110.         {
  111.             if (is_user_connected(players[i]))
  112.             {
  113.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  114.                 write_byte(players[i]);
  115.                 write_string(msg);
  116.                 message_end();
  117.             }
  118.         }
  119.     }
  120.     return PLUGIN_HANDLED;
  121. }


Müködik, köszönöm szépen!


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Skin átruházása eldobáskor
HozzászólásElküldve: 2018.02.12. 23:36 
Offline
Tud valamit
Avatar

Csatlakozott: 2018.02.07. 01:13
Hozzászólások: 127
Megköszönt másnak: 7 alkalommal
Megköszönték neki: 25 alkalommal
demon írta:
  1. new Team[33], Ent;
  2.  
  3. public plugin_precache() precache_model("models/model.mdl");
  4. public plugin_init() {
  5.     register_plugin(PLUGIN, VERSION, AUTHOR);
  6.     register_event("DeathMsg", "Death", "a");
  7.     register_forward(FM_Touch, "ForwardTouch");
  8. }
  9. public Death()
  10. {
  11.     new Killer = read_data(1);
  12.     new Victim = read_data(2);
  13.  
  14.     if(Killer != Victim && is_user_alive(Killer) && is_user_connected(Victim))
  15.     {
  16.         Team[Victim] = cs_get_user_team(Victim);
  17.         Drop(Victim);
  18.     }
  19. }
  20. public Drop(Victim)
  21. {
  22.     new VictimName[32];
  23.     get_user_name(Victim, VictimName, charsmax(VictimName));
  24.     static Float:Origin[3];
  25.     pev(Victim, pev_origin, Origin);
  26.     Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  27.     Origin[2] -= 36;
  28.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  29.  
  30.     if(!pev_valid(Ent))
  31.         return PLUGIN_HANDLED;
  32.  
  33.  
  34.     set_pev(Ent, pev_classname, "asdasd");
  35.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  36.     dllfunc(DLLFunc_Spawn, Ent);
  37.     set_pev(Ent, pev_solid, SOLID_BBOX);
  38.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  39.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  40.     engfunc(EngFunc_DropToFloor, Ent);
  41.     set_pev(Ent, pev_message, VictimName);
  42.     client_printcolor(0, "DROP VICTIM ID: %d", Victim);
  43.     set_pev( Ent, pev_iuser1, Victim )
  44.     return PLUGIN_HANDLED;
  45. }
  46. public ForwardTouch(Ent, id)
  47. {
  48.     if(pev_valid(Ent))
  49.     {
  50.         new ClassName[32];
  51.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  52.  
  53.         if(!equal(ClassName, "asdasd"))
  54.             return FMRES_IGNORED;
  55.  
  56.         Find(id, Ent);
  57.     }
  58.     return FMRES_IGNORED;
  59. }
  60. public Find(id, iEnt)
  61. {
  62.     new VictimName[32], pName[32], idVictim;
  63.     pev(iEnt, pev_message, VictimName, charsmax(VictimName));
  64.     idVictim = pev( iEnt, pev_iuser1 );
  65.    
  66.     engfunc(EngFunc_RemoveEntity, Ent);
  67.  
  68.     new CsTeams:userTeam = cs_get_user_team(id)
  69.     get_user_name(id, pName, charsmax(pName));
  70.  
  71.     switch(userTeam) {
  72.         case CS_TEAM_T: Team[id] = 1;
  73.         case CS_TEAM_CT: Team[id] = 2;
  74.     }
  75.    
  76.     if(Team[id] == Team[idVictim]) {
  77.         client_printcolor(id, "!g%s !yFelélesztetted a(z) egyik csapattársadat(!t%s!y).", CHATPREFIX, VictimName);
  78.         client_printcolor(idVictim, "!g%s !t%s !yFelélesztetted téged!", CHATPREFIX, pName);
  79.     }
  80.     else
  81.         client_printcolor(id, "!g%s !yKaptál egy !tCsomagot!y!", CHATPREFIX);
  82.  
  83.     return PLUGIN_HANDLED;
  84. }
  85. public logevent_round_start()
  86. {
  87.     new EntName = FM_NULLENT;
  88.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  89.         engfunc(EngFunc_RemoveEntity, EntName);
  90. }
  91. public logevent_round_end()
  92. {
  93.     new EntName = FM_NULLENT;
  94.     while((EntName = fm_find_ent_by_class(EntName, "asdasd")))
  95.         engfunc(EngFunc_RemoveEntity, EntName);
  96. }
  97. stock client_printcolor(const id, const input[], any:...)
  98. {
  99.     new count = 1, players[32];
  100.     static msg[191];
  101.     vformat(msg, 190, input, 3);
  102.    
  103.     replace_all(msg, 190, "!g", "^4");
  104.     replace_all(msg, 190, "!y", "^1");
  105.     replace_all(msg, 190, "!t", "^3")   ;
  106.    
  107.     if (id) players[0] = id; else get_players(players, count, "ch");
  108.     {
  109.         for (new i = 0; i < count; i++)
  110.         {
  111.             if (is_user_connected(players[i]))
  112.             {
  113.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  114.                 write_byte(players[i]);
  115.                 write_string(msg);
  116.                 message_end();
  117.             }
  118.         }
  119.     }
  120.     return PLUGIN_HANDLED;
  121. }

Es ha skinre akarnam csinalni ezt az egeszet pld ak47 -re ? nagyon megkoszonem


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  [ 20 hozzászólás ]  Oldal Előző 1 2


Ki van itt

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