hlmod.hu
https://hlmod.hu/

Csomagot nem veszi fel
https://hlmod.hu/viewtopic.php?f=9&t=28725
Oldal: 1 / 1

Szerző:  Egoista [2018.02.05. 15:05 ]
Hozzászólás témája:  Csomagot nem veszi fel

Valaki ezt tudná javítani?
  1. public plugin_precache() precache_model("models/model.mdl");
  2. public plugin_init() {
  3.     register_plugin(PLUGIN, VERSION, AUTHOR);
  4.     register_event("DeathMsg", "Death", "a");
  5.     register_forward(FM_Touch, "ForwardTouch");
  6. }
  7. public Death()
  8. {
  9.     new Killer = read_data(1);
  10.     new Victim = read_data(2);
  11.  
  12.     if(is_user_connected(Victim) && is_user_connected(Killer))
  13.         Drop();
  14. }
  15. public Drop()
  16. {
  17.     new Victim = read_data(2);
  18.     static Float:Origin[3];
  19.     pev(Victim, pev_origin, Origin);
  20.     new Ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  21.     Origin[2] -= 36;
  22.     engfunc(EngFunc_SetOrigin, Ent, Origin);
  23.  
  24.     if(!pev_valid(Ent))
  25.         return PLUGIN_HANDLED;
  26.  
  27.     set_pev(Ent, pev_classname, "asdasd");
  28.     engfunc(EngFunc_SetModel, Ent, "models/model.mdl");
  29.     dllfunc(DLLFunc_Spawn, Ent);
  30.     set_pev(Ent, pev_solid, SOLID_BBOX);
  31.     set_pev(Ent, pev_movetype, MOVETYPE_NONE);
  32.     engfunc(EngFunc_SetSize, Ent, Float:{-23.160000, -13.660000, -0.050000}, Float:{11.470000, 12.780000, 6.720000});
  33.     engfunc(EngFunc_DropToFloor, Ent);
  34.     return PLUGIN_HANDLED;
  35. }
  36. public ForwardTouch(Ent, id)
  37. {
  38.     if(pev_valid(Ent))
  39.     {
  40.         new ClassName[32], Victim;
  41.         Victim = read_data(2);
  42.         new CsTeams:userTeam = cs_get_user_team(id);
  43.         new CsTeams:victimTeam = cs_get_user_team(Victim);
  44.         pev(Ent, pev_classname, ClassName, charsmax(ClassName));
  45.  
  46.         if(!equal(ClassName, "asdasd"))
  47.             return FMRES_IGNORED;
  48.  
  49.         if(userTeam == victimTeam)
  50.             client_printcolor(id, "A csapatok megegyeztek");
  51.  
  52.         engfunc(EngFunc_RemoveEntity, Ent);
  53.     }
  54.     return FMRES_IGNORED;
  55. }
  56. /*public logevent_round_start()
  57. {
  58.     new EntName = FM_NULLENT;
  59.     while((EntName = fm_find_ent_by_class(EntName, "dogcedula")))
  60.         engfunc(EngFunc_RemoveEntity, EntName);
  61. }*/
  62. stock client_printcolor(const id, const input[], any:...)
  63. {
  64.     new count = 1, players[32];
  65.     static msg[191];
  66.     vformat(msg, 190, input, 3);
  67.    
  68.     replace_all(msg, 190, "!g", "^4");
  69.     replace_all(msg, 190, "!y", "^1");
  70.     replace_all(msg, 190, "!t", "^3")   ;
  71.    
  72.     if (id) players[0] = id; else get_players(players, count, "ch");
  73.     {
  74.         for (new i = 0; i < count; i++)
  75.         {
  76.             if (is_user_connected(players[i]))
  77.             {
  78.                 message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  79.                 write_byte(players[i]);
  80.                 write_string(msg);
  81.                 message_end();
  82.             }
  83.         }
  84.     }
  85.     return PLUGIN_HANDLED;
  86. }

A csomagot ledobja, de ha nekimegyek semmi nem történik.
Log ezt irja:
  1. L 02/05/2018 - 15:09:33: [AMXX] Displaying debug trace (plugin "asd.amxx", version "1.0")
  2. L 02/05/2018 - 15:09:33: [AMXX] Run time error 10: native error (native "cs_get_user_team")
  3. L 02/05/2018 - 15:09:33: [AMXX]    [0] asd.sma::ForwardTouch (line 58)
  4. L 02/05/2018 - 15:09:37: [CSTRIKE] Player out of range (0)

Szerző:  zack1337 [2018.02.05. 15:19 ]
Hozzászólás témája:  Re: Csomagot nem veszi fel

Mit is szeretnél ezzel? Ki veheti fel? Ha nem csal a szemem csak az veheti fel aki a halottal egy csapatban van.

Szerző:  Egoista [2018.02.05. 15:30 ]
Hozzászólás témája:  Re: Csomagot nem veszi fel

Azt akartam, hogy aki a halottal egy csapatban van és felveszi akkor annak kiirjon egy üzenetet, de mindenki vehesse fel.

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