←  Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Przeładowanie bo fragu

Zablokowany

  • +
  • -
kasza - zdjęcie kasza 04.06.2010

Siema. Proszę aby ktoś napisał plugin w którym jak zabijemy kogoś automatycznie zapełniał nam się magazynek. Chodzi o to abyśmy nie musieli ładować. Plugin potrzebny na DM.
Pozdrawiam.
Odpowiedz

Gość_deLL_* 05.06.2010

Wyciągnięte z DiabloModa...

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>

#define PLUGIN "Refill Ammo"
#define VERSION "1.0"
#define AUTHOR "deLL"

new clip, ammo;

stock const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","DeathMsg","a")
}

public DeathMsg(id)
{
new killer_id = read_data(1)
refill_ammo(killer_id)
}

stock refill_ammo(id)
{
new wpnid, wpn[32], wEnt;
if(!is_user_alive(id) || pev(id, pev_iuser1)) return;

wpnid = get_user_weapon(id, clip, ammo)
get_weaponname(wpnid, wpn, 31)

wpnid = get_weaponid(wpn)
wEnt = get_weapon_ent(id, wpnid);
cs_set_weapon_ammo(wEnt, maxClip[wpnid]);
}

stock get_weapon_ent(id,wpnid=0,wpnName[]="")
{
static newName[32];

if(wpnid) get_weaponname(wpnid,newName,31);

else formatex(newName,31,"%s",wpnName);

if(!equal(newName,"weapon_",7))
format(newName,31,"weapon_%s",newName);

new ent;
while((ent = engfunc(EngFunc_FindEntityByString,ent,"classname",newName)) && pev(ent,pev_owner) != id) {}

return ent;
}
Odpowiedz

  • +
  • -
kasza - zdjęcie kasza 08.06.2010

Dzięki deLL wszystko ładnie śmiga :) +

08 czerwiec 2010 - 18:23:
A jednak nie wszystko jed dobrze do końca :/

L 06/06/2010 - 16:55:11: Start of error session.
L 06/06/2010 - 16:55:11: Info (map "de_aztec") (file "addons/amxmodx/logs/error_20100606.log")
L 06/06/2010 - 16:55:11: [CSTRIKE] Non-player entity 0 out of range
L 06/06/2010 - 16:55:11: [AMXX] Run time error 10 (plugin "noreload.amxx") (native "cs_set_weapon_ammo") - debug not enabled!
L 06/06/2010 - 16:55:11: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Odpowiedz

  • +
  • -
AmD - zdjęcie AmD 10.06.2010

dopisz debug przed pluginem

teraz wygląda tak to w plugins.ini:
[...]noreload.amxx

a ma być:
[...]noreload.amxx debug
Odpowiedz

  • +
  • -
R3X - zdjęcie R3X 10.06.2010

nie trzeba :P

public DeathMsg(id)
{
        new killer_id = read_data(1)
        refill_ammo(killer_id)
}
na
public DeathMsg(id)
{
        new killer_id = read_data(1)
        if(is_user_alive(killer_id))
                refill_ammo(killer_id)
}
Odpowiedz
Zablokowany