Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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

2 problemy...


  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 Destr0

    Nowy

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:7
  • Lokalizacja:Kwidzyn
Offline

Napisano 23.09.2009 08:53

1. spolszczylem plugin afkbombtransfer lecz ciagle nie dziala... co robie zle moglby ktos powiedziec ? dorzucam sma
2. Chcialbym zmienic kolor w nazwie menu wyboru interpu na czerwony "Wybierz swoj interp" dorzucam sma

proszę o konkretna pomoc


SMA 1.



#include <amxmodx>
#include <fakemeta>

// plugin's main information
#define PLUGIN_NAME "AFK Bomb Transfer"
#define PLUGIN_VERSION "0.4"
#define PLUGIN_AUTHOR "VEN"

// comment to avoid autodisabling the plugin on maps which not contain bomb targets
#define BOMB_MAP_CHECK

// float value, hud messages display time (in seconds)
#define MSG_TIME 7.0

// CVAR name, affects on spawned AFK bomb carrier which never moved after spawn
new CVAR_SPAWN[] = "afk_bombtransfer_spawn"

// CVAR value, max. allowed bomb carrier AFK time (in seconds)
new DEFAULT_SPAWN[] = "7"

// CVAR name, affects on any AFK bomb carrier except one which obey previous CVAR
new CVAR_TIME[] = "afk_bombtransfer_time"

// CVAR value, max. allowed bomb carrier AFK time (in seconds)
new DEFAULT_TIME[] = "15"

// do not set this value less than "maxplayers"
#define MAX_PLAYERS 32

// initial AMXX version number supported CVAR pointers in get/set_pcvar_* natives
#define CVAR_POINTERS_AMXX_INIT_VER_NUM 170

// determine if get/set_pcvar_* natives can be used
#if defined AMXX_VERSION_NUM && AMXX_VERSION_NUM >= CVAR_POINTERS_AMXX_INIT_VER_NUM
#define CVAR_POINTERS
new g_pcvar_spawn
new g_pcvar_time
#endif

new TEAM[] = "TERRORIST"
new WEAPON[] = "weapon_c4"

#define FL_ONGROUND (1<<9)

new bool:g_freezetime = true
new bool:g_spawn
new bool:g_planting

new g_carrier

new g_pos[MAX_PLAYERS + 1][3]
new g_time[MAX_PLAYERS + 1]

new g_maxplayers

public plugin_init() {
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

#if defined CVAR_POINTERS
g_pcvar_spawn = register_cvar(CVAR_SPAWN, DEFAULT_SPAWN)
g_pcvar_time = register_cvar(CVAR_TIME, DEFAULT_TIME)
#else
register_cvar(CVAR_SPAWN, DEFAULT_SPAWN)
register_cvar(CVAR_TIME, DEFAULT_TIME)
#endif

#if defined BOMB_MAP_CHECK
// is current map not contain bomb targets?
if (!engfunc(EngFunc_FindEntityByString, -1, "classname", "func_bomb_target"))
return
#endif

register_event("WeapPickup", "event_got_bomb", "be", "1=6")
register_event("BarTime", "event_bar_time", "be")
register_event("TextMsg", "event_bomb_drop", "bc", "2=#Game_bomb_drop")
register_event("TextMsg", "event_bomb_drop", "a", "2=#Bomb_Planted")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

register_logevent("logevent_round_start", 2, "1=Round_Start")

set_task(1.0, "task_afk_check", _, _, _, "b") // plugin's core loop

g_maxplayers = get_maxplayers()
}

/* *************************************************** Base **************************************************** */

public event_new_round() {
g_freezetime = true
g_spawn = true
g_planting = false
g_carrier = 0
}

public event_got_bomb(id) {
g_carrier = id
}

public event_bar_time(id) {
if (id == g_carrier) {
g_planting = bool:read_data(1)
get_user_origin(id, g_pos[id])
g_time[id] = 0
}
}

public event_bomb_drop() {
g_spawn = false
g_planting = false
g_carrier = 0
}

public logevent_round_start() {
new id[32], num
get_players(id, num, "ae", TEAM)

if (!num) // is server empty?
return

g_freezetime = false

// update afk timers and current positions
new x
for (new i = 0; i < num; ++i) {
x = id[i]
get_user_origin(x, g_pos[x])
g_time[x] = 0
}
}

public task_afk_check() {
if (g_freezetime) // is freezetime right now?
return

// afk check
new id[32], num, x, origin[3]
get_players(id, num, "ae", TEAM)
for (new i = 0; i < num; ++i) {
x = id[i]
get_user_origin(x, origin)
if (origin[0] != g_pos[x][0] || origin[1] != g_pos[x][1] || (x == g_carrier && g_planting)) {
g_time[x] = 0
g_pos[x][0] = origin[0]
g_pos[x][1] = origin[1]
if (g_spawn && x == g_carrier)
g_spawn = false
}
else
g_time[x]++
}

// is bomb not currently carried or Ts number less than 2?
if (!g_carrier || num < 2)
return

#if defined CVAR_POINTERS
new max_time = get_pcvar_num(g_spawn ? g_pcvar_spawn : g_pcvar_time)
#else
new max_time = get_cvar_num(g_spawn ? CVAR_SPAWN : CVAR_TIME)
#endif

// is plugin disabled (cvar <= 0) or carrier isn't afk?
if (max_time <= 0 || g_time[g_carrier] < max_time)
return

// find who from non-afk Ts is the closest to the afk carrier
get_user_origin(g_carrier, origin)
new min_dist = 999999, dist, recipient, origin2[3]
for (new i = 0; i < num; ++i) {
x = id[i]
if (g_time[x] < max_time) {
get_user_origin(x, origin2)
dist = get_distance(origin, origin2)
if (dist < min_dist) {
min_dist = dist
recipient = x
}
}
}

if (!recipient) // is all Ts afk?
return

new carrier = g_carrier
engclient_cmd(carrier, "drop", WEAPON) // drop the backpack
new c4 = engfunc(EngFunc_FindEntityByString, -1, "classname", WEAPON) // find weapon_c4 entity
if (!c4)
return

new backpack = pev(c4, pev_owner) // get backpack entity
if (backpack <= g_maxplayers)
return

// my backpack transfer trick (improved)
set_pev(backpack, pev_flags, pev(backpack, pev_flags) | FL_ONGROUND)
dllfunc(DLLFunc_Touch, backpack, recipient)

// hud messages stuff below
set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, MSG_TIME)
new message[128], c_name[32], r_name[32]
get_user_name(carrier, c_name, 31)
get_user_name(recipient, r_name, 31)
format(message, 127, "Pake dostal ^"%s^"^nponiewaz ^"%s^" jest AFK", r_name, c_name)
for (new i = 0; i < num; ++i)
show_hudmessage(id[i], "%s", message)

set_hudmessage(255, 255, 0, 0.42, 0.3, _, _, MSG_TIME, _, _, 3)
show_hudmessage(recipient, "Dostales pake!")
}

/* **************************************************** EOF */






SMA 2.




#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Interp ask"
#define VERSION "1.0"
#define AUTHOR "silversurfer thx r3x"

#define TASK_SHOWMENU 432

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
}
public client_putinserver(id){
if(!is_user_bot(id))
eventInGame(id);
}
public show_menu_(tid) {
new id=tid-TASK_SHOWMENU;
new iTeam=get_user_team(id);
new menu_id, keys;
new menuUp = player_menu_info( id, menu_id, keys );
if ( iTeam && (menuUp <= 0 || menu_id < 0) )
menu_displayer(id);
else
set_task(1.0, "show_menu_", tid);
}
public eventInGame(id){
set_task(1.0, "show_menu_", id+TASK_SHOWMENU);
}
public menu_displayer(id){
new menu = menu_create("Wybierz swoj interp", "menu_handler")
menu_additem(menu, "Interp - 0.01", "1", 0)
menu_additem(menu, "Interp - 0.02", "2", 0)
menu_additem(menu, "Interp - 0.03", "3", 0)
menu_additem(menu, "Interp - 0.04", "4", 0)
menu_additem(menu, "Interp - 0.05", "5", 0)
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public menu_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
return PLUGIN_HANDLED
}
new data[6], iName[64]
new iaccess, callback
menu_item_getinfo(menu, item, iaccess, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:{
client_cmd(id, "ex_interp 0.01")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 2:{
client_cmd(id, "ex_interp 0.02")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 3:{
client_cmd(id, "ex_interp 0.03")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 4:{
client_cmd(id, "ex_interp 0.04")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 5:{
client_cmd(id, "ex_interp 0.05")
menu_destroy(menu)
return PLUGIN_HANDLED
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}
  • +
  • -
  • 0

#2 naven

    Hero

  • Power User

Reputacja: 200
Profesjonalista

  • Postów:1088
  • GG:
  • Imię:Adam
  • Lokalizacja:Cieszyn
Offline

Napisano 23.09.2009 15:16

używaj tagów [code=auto:0]...
  • +
  • -
  • 0




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

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