←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Po zgonie jest respawn

Locked

hardbot's Photo hardbot 27.07.2010

Jak zrobić plugin który po zabiciu gracza albo jak gracz sam sie zabije od razu żeby ożywał :D
Quote

  • +
  • -
Owner123's Photo Owner123 27.07.2010

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
register_plugin("AutoRespawn", "1.0", "Owner")
RegisterHam(Ham_Killed, "player", "fwHamPlayerKilledPost", 1)
}

public fwHamPlayerKilled(victim, attacker, shouldgib)
ExecuteHam(Ham_Spawn, victim)

Btw. Było pełno takich tematów ...

Edit.
Albo nieco inaczej:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
register_plugin("New Plugin", "1.0", "Owner")
RegisterHam(Ham_Player_PostThink, "player", "fwHamPlayerPostThink", 1)
}

public fwHamPlayerPostThink(id)
if(!ExecuteHam(Ham_IsAlive, id) && (get_user_team(id) == 1 || get_user_team(id) == 2))
ExecuteHam(Ham_Spawn, id)

Edited by Owner123, 27.07.2010 12:07.
Quote

  • +
  • -
G[o]Q's Photo G[o]Q 27.07.2010

lub dedykowany pod cs'a

ExecuteHam(Ham_CS_RoundRespawn, victim)
Quote

hardbot's Photo hardbot 27.07.2010

Owner to twoje nie dziala zabiłem się nie ożywiło mnie. i tak samo zabiłem kogos ktoś mnie i nie ożywiło ??

A druga funkcja :D tworzy kopie mnie a samego mnie wywala tzn moża to by nazwać na speca latam jak na speccie jak sie zabije potem :D

@@@ UP:

Żadne nie działa. Gracze się sami zabijają, lub zabijają się nawzajem i ich nie wskrzesza ??
Edited by HARDBOT, 27.07.2010 12:38.
Quote

  • +
  • -
Lukasz5's Photo Lukasz5 27.07.2010

A coś takiego?
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Lukasz5"

new bool:gHevebonus[33];

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Spawn, "player", "HamSpawn", 1);
}

public HamSpawn(id)
{
if(is_user_alive(id)) {
gHevebonus[id] = true;
}
}

public respawn_player(id)
{
if (!is_user_connected(id) || is_user_alive(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR) return;

set_pev(id, pev_deadflag, DEAD_RESPAWNABLE)
dllfunc(DLLFunc_Think, id)

if (is_user_bot(id) && pev(id, pev_deadflag) == DEAD_RESPAWNABLE)
{
dllfunc(DLLFunc_Spawn, id)
}
}

public DeathMsg(id)
{
new vid = read_data(2) // ofiara
if(gHevebonus[vid])
{
set_task(2.0,"respawn_player",vid)
client_print(vid,print_chat,"[Ruletka]: za 2 sec otrzymasz bonusowe zycie !")
gHevebonus[vid]=false;
}
}
Quote

  • +
  • -
byCZUS's Photo byCZUS 31.07.2010

@Up nie pisz że plugin jest twój...

Zobacz sobie to:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>

public plugin_init() {
register_plugin("asdasd", "1.0", "Me?");
register_event("DeathMsg", "ded", "a");
}

public ded()
{
new killer = read_data(1);
new victim = read_data(2);

if(killer != victim && get_user_team(killer) != get_user_team(victim))
set_task(0.5, "resawn", victim);
}

public resawn(id)
ExecuteHamB(Ham_CS_RoundRespawn, id);

Edited by byQQ, 31.07.2010 02:33.
Quote

Gość_Maestro_* 31.07.2010

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

public plugin_init() {
register_plugin("Respawn", "1.0", "Maestro");

register_event("DeathMsg", "DeathMsg", "a")
}

public DeathMsg()
{
new kid = read_data(1) //zabojca

new vid = read_data(2) // ofiara


if(!is_user_alive(vid))
{
set_pev(vid, pev_deadflag, DEAD_RESPAWNABLE);
dllfunc(DLLFunc_Think, vid);
dllfunc(DLLFunc_Spawn, vid);
strip_user_weapons(vid);
give_item(vid, "weapon_knife");
}
}

Edited by Maestro, 31.07.2010 12:41.
Quote

hardbot's Photo hardbot 31.07.2010

Dobra temat do zamknięcia. Dzięki za pomoc
Quote
Locked