Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|

HP na start
#2
Napisano 06.08.2011 14:09
#include <amxmodx> #include <hamsandwich> #include <fakemeta> new amx_hp_spawn; public plugin_init() { register_plugin("Custom Spawn HP", "1.0", "potatis_invalido"); RegisterHam(Ham_Spawn, "player", "ham_spawn_player"); amx_hp_spawn = register_cvar("amx_hp_spawn", "101"); } public ham_spawn_player(id) { if(is_user_connected(id) && get_pcvar_num(amx_hp_spawn)) set_task(0.3, "set_player_hp", id); } public set_player_hp(id) { if(is_user_alive(id) && get_pcvar_num(amx_hp_spawn) != 100) { set_pev(id, pev_health, float(get_pcvar_num(amx_hp_spawn))); } }
CVAR:
amx_hp_spawn "wartość"
Załączone pliki
Użytkownik Snapp edytował ten post 06.08.2011 14:10
#3
Napisano 06.08.2011 14:26
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "HP na start"
#define VERSION "1.0"
#define AUTHOR "BoB0_"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
register_clcmd("say /test", "Poczatek_Rundy");
}
public Poczatek_Rundy(id)
{
new zycie = get_user_health(id)
if(zycie < 100)
{
set_user_health(id, 100)
}
}
Musisz sobie zamienić event bo przy tym nie dodaje hp nie wiem czemu. Po wpisaniu /test daje 100hp
@edit.
Nie widziałem postu up.
Użytkownik BoB0_ edytował ten post 06.08.2011 14:26
#5
Napisano 06.08.2011 14:56
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#define PLUGIN "Nowy Plugin"
#define VERSION "0.1"
#define AUTHOR "Blak Rajder"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Spawn, "player", "set_hp", 0);
}
public set_hp(id)
{
if(is_user_connected(id))
{
set_user_health(id, 100);
}
}
Nowe portfolio. Ciekawe artykuły, ciekawe przykłady: WojtusDEV.pl
#7
Napisano 06.08.2011 15:29
#include <amxmodx>
#include <fakemeta>
public plugin_init()
{
register_plugin( "Plugin" , "0.1", "Dawedo" );
register_forward( FM_Spawn, "fmSpawn", 1 );
}
public fmSpawn( ent )
{
if( !pev_valid( ent ) )
return FMRES_IGNORED;
new classname[32];
pev( ent, pev_classname, classname, 31 );
if( !equali( classname, "player" ) )
return FMRES_IGNORED;
if( is_user_alive( ent ) )
set_pev( ent, pev_health, 100.0 );
return FMRES_HANDLED;
}
Nie pomagam na PW, tylko na forum.
#8
Napisano 06.08.2011 15:39
; AMX Mod X plugins ; Admin Base - Always one has to be activated amxbans_core.amxx ; AmxBans 1.6 amxbans_main.amxx ; AmxBans 1.6 ;admin.amxx ; admin base (required for any admin-related) ;admin_sql.amxx ; admin base - SQL version (comment admin.amxx) ; Basic admincmd.amxx ; basic admin console commands adminhelp.amxx ; help command for admin console commands adminslots.amxx ; slot reservation multilingual.amxx ; Multi-Lingual management ; Menus menufront.amxx ; front-end for admin menus cmdmenu.amxx ; command menu (speech, settings) plmenu.amxx ; players menu (kick, ban, client cmds.) ;telemenu.amxx ; teleport menu (Fun Module required!) mapsmenu.amxx ; maps menu (vote, changelevel) pluginmenu.amxx ; Menus for commands/cvars organized by plugin ; Chat / Messages adminchat.amxx ; console chat commands antiflood.amxx ; prevent clients from chat-flooding the server scrollmsg.amxx ; displays a scrolling message imessage.amxx ; displays information messages adminvote.amxx ; vote commands ; Map related nextmap.amxx ; displays next map in mapcycle mapchooser.amxx ; allows to vote for next map timeleft.amxx ; displays time left on map ; Configuration pausecfg.amxx ; allows to pause and unpause some plugins statscfg.amxx ; allows to manage stats plugins via menu and commands ; Counter-Strike ;restmenu.amxx ; restrict weapons menu statsx.amxx ; stats on death or round end (CSX Module required!) ;miscstats.amxx ; bunch of events announcement for Counter-Strike ;stats_logging.amxx ; weapons stats logging (CSX Module required!) ; Enable to use AMX Mod plugins ;amxmod_compat.amxx ; AMX Mod backwards compatibility layer ; Custom - Add 3rd party plugins here expmod.amxx debug DeathOrFree.amxx free.amxx DeathrunManager.amxx DRM_trigger_hurt_fix.amxx bh.amxx ad_manager.amxx adminlisten.amxx antyipnick.amxx dontsayips.amxx Galileo.amxx ip.amxx xredirect.amxx plugin_trail.amxx vip.amxx freezetraps.amxx deathrun_stats.amxx hpk.amxx tabela.amxx pokazuj.amxx Hats09.amxx adminhook.amxx amx_hp_spawn.amxx kolejka.amxx
Oglądasz seriale typu: The Flash, Arrow, Daredevil, The Walking Dead? Jeśli tak, to zapraszam na mój kanał YouTube
#9
Napisano 06.08.2011 16:22
Nie pomagam na PW, tylko na forum.
#11
Napisano 06.08.2011 16:30
#13
Napisano 06.08.2011 16:41
#15
Napisano 06.08.2011 21:48
get_user_team(id, 2) <= To moja wersja ale sypie błędami. Potrzebna do sprawdzenia czegoś.
#16
Napisano 06.08.2011 21:55
get_user_team( id ) == 2
Jeżeli o to chodzi to tak ma to wyglądać ;d
Nie pomagam na PW, tylko na forum.
#17
Napisano 06.08.2011 21:57
Ja zrobiłem coś takiego:
new team = get_user_team(id) //Sprawdza druzyne gracza
if(team == get_user_team(id, 2))
Myślisz że twoja opcja zadziała?
Użytkownik BoB0_ edytował ten post 06.08.2011 21:58
#18
Napisano 06.08.2011 22:16
Nie pomagam na PW, tylko na forum.
#19
Napisano 06.08.2011 22:22
Przepraszam. Sam zaglądałem i to mi namieszało. Dziękuję za pomoc. Plusik dla pana w niebieskim

Oto co zrobiłem. Może to zadziała.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "HP na start"
#define VERSION "1.0"
#define AUTHOR "BoB0_"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("Poczatek_Rundy", 2, "1=Round_Start") // Wywołuje funkcję Poczatek_rundy
register_clcmd("say /test", "Poczatek_Rundy"); // To samo co wyzej
}
public Poczatek_Rundy(id) //Funkcja dzialacja zaraz po spawnie
{
new zycie = get_user_health(id) // Sprawdza zycie gracza
if(zycie <= 99)
{
Odnowa_HP(id)
}
}
public Odnowa_HP(id) //Funkcja wywolana przez plugin
{
set_user_health(id, 100) // Ustawia zycie gracza na 100
new team = get_user_team(id) //Sprawdza druzyne gracza
if(get_user_team( id ) == 2) // Jezeli gracz jest antyterrorysta patrz nizej
{
set_user_health(id, 100); // Ustawia zycie gracza na 100
}
}
#20
Napisano 06.08.2011 22:30
Problem leży w tym że gryzie się to zmienianie hp z innym pluginem czy coś. Może opóźnienie taskiem rozwiąże sprawę, chociaż tego nie wiem.
#include <amxmodx>
#include <fakemeta>
#define TASK_SETHP 678
// Czas od spawnu po jakim ustawi hp gracza
#define SETHP_DELAY 1.0
public plugin_init()
{
register_plugin( "Plugin" , "0.1", "Dawedo" );
register_forward( FM_Spawn, "fmSpawn", 1 );
}
public fmSpawn( ent )
{
if( !pev_valid( ent ) )
return FMRES_IGNORED;
new classname[32];
pev( ent, pev_classname, classname, 31 );
if( !equali( classname, "player" ) )
return FMRES_IGNORED;
set_task( SETHP_DELAY, "taskSethp", id+TASK_SETHP );
return FMRES_HANDLED;
}
public taskSethp( id )
{
id -= TASK_SETHP;
if( is_user_alive( id ) )
set_pev( ent, pev_health, 100.0 );
}
Nie pomagam na PW, tylko na forum.
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych