Skocz do zawartości

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Prośba o przerobieniehealthkit.sma


  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 Mrufka

    Nowy

  • Nowy

Reputacja: 0
Nowy

  • Postów:2
  • Lokalizacja:Łódź
Offline

Napisano 15.05.2010 08:27

Mam prośbę o przerobienie tego pluginu. Jak kogoś zabije wylatuje z niego apteczka i jak podniose daje mi hp (do ustalenia w cvarach) i zmienienie max hp (do ustalenia w cvarach) np na 200.
Bardzo proszę ponieważ mam serwer 4fun
* AMX Mod X
* Healthkit
*
* (c) Copyright 2006 by VEN
*
* This file is provided as is (no warranties)
*
* Description:
* This plugin basically provides an ability to spawn HL healthkits.
* If healthkit is collected it would appear again later like in HL.
* Note: Engine module required.
*
* Commands:
* healthkit_spawn [save] - spawns a healthkit at the origin of a player who typed that command
* if "save" argument is specified then origin would be added to the end of the file
* $configsdir/maps/<currentmap>.cfg (file would be created if it is not exists)
* that would allow to spawn saved healthkits every specific map load
* Note: to avoid error create $configsdir/maps folder if it is not exists.
*
* healthkit_load <x> <y> <z> - spawns a healthkit at the specified origin
*
* healthkit_clear - removes all spawned healthkits
*
* Commands access level is ADMIN_CFG (falg "h") can be redefined (#define ACCESS_LEVEL)
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ACCESS_LEVEL ADMIN_CFG
new CLASSNAME[] = "item_healthkit"

new FILE[96]

public plugin_init() {
register_plugin("Healthkit", "0.1", "VEN")
register_clcmd("healthkit_spawn", "cmd_healthkit_spawn", ACCESS_LEVEL, "[save]")
register_concmd("healthkit_load", "cmd_healthkit_load", ACCESS_LEVEL, "<x> <y> <z>")
register_concmd("healthkit_clear", "cmd_healthkit_clear", ACCESS_LEVEL)

new configs_dir[64], map[32]
get_configsdir(configs_dir, 63)
get_mapname(map, 31)
format(FILE, 95, "%s/maps/%s.cfg", configs_dir, map)
}

public plugin_precache() {
precache_model("models/w_medkit.mdl")
precache_sound("items/smallmedkit1.wav")
}

public cmd_healthkit_spawn(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

new origin[3]
get_user_origin(id, origin)
healthkit_spawn(origin)

new arg1[6]
read_argv(1, arg1, 5)
if (!equali(arg1, "save"))
return PLUGIN_HANDLED

new command[48]
format(command, 47, "healthkit_load %d %d %d", origin[0], origin[1], origin[2])
write_file(FILE, command)

return PLUGIN_HANDLED
}

public cmd_healthkit_load(id, level, cid) {
if (!cmd_access(id, level, cid, 4))
return PLUGIN_HANDLED

new arg1[8], arg2[8], arg3[8], origin[3]
read_argv(1, arg1, 7)
read_argv(2, arg2, 7)
read_argv(3, arg3, 7)
origin[0] = str_to_num(arg1)
origin[1] = str_to_num(arg2)
origin[2] = str_to_num(arg3)
healthkit_spawn(origin)

return PLUGIN_HANDLED
}

public cmd_healthkit_clear(id, level, cid) {
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED

new healthkit = -1
while ((healthkit = find_ent_by_class(healthkit, CLASSNAME)))
remove_entity(healthkit)

return PLUGIN_HANDLED
}

healthkit_spawn(origin[3]) {
new healthkit = create_entity(CLASSNAME)
if (!healthkit)
return

new Float:vec[3]
IVecFVec(origin, vec)
entity_set_origin(healthkit, vec)
DispatchSpawn(healthkit)
}


15 maj 2010 - 14:50:
Odświeżam

16 maj 2010 - 17:08:
Odwiezam
  • +
  • -
  • 0
Dołączona grafika




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych