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

nie trzeba przeładowywać na bb ?


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
18 odpowiedzi w tym temacie

#1 zenon

    Pomocny

  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland >Radomsko
Offline

Napisano 15.09.2011 17:01

Witam chciał bym zapytać czy da się przerobić plugin zp_extra_unlimited_clip z zombie moda na item do sklepu na base builder.

Jeśli się da to chciał bym wiedzieć jak to się robi.

I szukam jeszcze pluginu na dokupowanie 10 sekund do budowy.

Użytkownik zenon edytował ten post 15.09.2011 17:02

  • +
  • -
  • 0

#2 Skull3D

    Wszechmogący

  • Zbanowany

Reputacja: 102
Zaawansowany

  • Postów:651
  • Imię:Andrzej
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.09.2011 17:03

Da się
Daj sma bb lub sklepu do niego.

Użytkownik Skull3D edytował ten post 15.09.2011 17:03


#3 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland >Radomsko
Offline

Napisano 15.09.2011 17:17

Do base buildera dodaje się System Ammo Pakow i itemy dopisuje się w osobnym pliku ale trzeba mieć osobny plugin tez.

A tu mam przykład do itemów.

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <ammopacks.inc> // dolaczamy inc z natywem i forwardem
#include <fun>


#define PLUGIN "Item_nr2"
#define VERSION "1.0"
#define AUTHOR "G[o]Q"

new item
new koszt
new team

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

koszt=register_cvar("Nazwa_cvara_odpowiedzialnego_za_koszt","domyslna_wartosc")
team=register_cvar("Nazwa_cvara_odpowiedzialnego_za_team","domyslna_wartosc") //0 - ALL
//1 - ZOMBIE
//2 - HUMAN
new tkoszt=get_pcvar_num(koszt)
new tteam =get_pcvar_num(team)
item=dodaj_extra_item("+AP",tkoszt,tteam) //rejestrujemy nowy item - nazwa - koszt -team(1 - Zombie,2 - Human,0 - All

}
public wybrano_item(id,item_id){// co ma sie stac po kupieniu itemy

if(item_id==item){// sprawdzamy czy gracz kupil item zarejestrowany wczesniej
set_user_armor(id,500)
}

}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang1045\\ f0\\ fs16 \n\\ par }
*/


Użytkownik zenon edytował ten post 15.09.2011 17:20

  • +
  • -
  • 0

#4 Skull3D

    Wszechmogący

  • Zbanowany

Reputacja: 102
Zaawansowany

  • Postów:651
  • Imię:Andrzej
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.09.2011 17:45

hmmmm??

#include <amxmodx>
#include <amxmisc>
#include <ammopacks.inc>
#include <fun>
#include <cstrike>
#define PLUGIN "Un Ammo"
#define VERSION "1.0"
#define AUTHOR "Skull3D"
new item;
new koszt;
new team;
new ma[33];
new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}
new cvar_enable
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
koszt=register_cvar("koszt_ne","500")
team=register_cvar("team_ne","2") //0 - ALL
//1 - ZOMBIE
//2 - HUMAN
new tkoszt=get_pcvar_num(koszt)
new tteam =get_pcvar_num(team)
item=dodaj_extra_item("Unlimited Ammo",tkoszt,tteam) //rejestrujemy nowy item - nazwa - koszt -team(1 - Zombie,2 - Human,0 - All
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_logevent("PoczatekRundy", 2, "1=Round_Start");
}
public wybrano_item(id,item_id){// co ma sie stac po kupieniu itemy
if(item_id==item){// sprawdzamy czy gracz kupil item zarejestrowany wczesniej
ma[id] == true;
}
}
public PoczatekRundy()  {
for(new id=0;id<=32;id++)
{
	   ma[id] = false;
}
}
public event_curweapon(id)
{
//Check if the plugin is enabled and player is alive
if(ma || !is_user_alive(id))
  return PLUGIN_CONTINUE;

//Get and check weapon ID
new weaponID= read_data(2)
if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE || weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG)
  return PLUGIN_CONTINUE;

if(cs_get_user_bpammo(id, weaponID)!=CSW_MAXAMMO[weaponID])
  cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])

return PLUGIN_CONTINUE;
}


#5 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 15.09.2011 18:00

błędy przy kompilacji:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

ammo.sma(29) : warning 213: tag mismatch
ammo.sma(29) : warning 215: expression has no effect
ammo.sma(41) : error 033: array must be indexed (variable "ma")
ammo.sma(53) : warning 203: symbol is never used: "cvar_enable"

1 Error.
Could not locate output file ammo.amxx (compile failed).


I ten item miał by działać na zasadzie ze nie trzeba przeładowywać broni która się ma a to miało by być np za 50 ammo pakow bo taki jest system na serwie nie za zwykle pieniądze i by można było zrobić tak by nie działało na krowie.
  • +
  • -
  • 0

#6 Skull3D

    Wszechmogący

  • Zbanowany

Reputacja: 102
Zaawansowany

  • Postów:651
  • Imię:Andrzej
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.09.2011 18:08

#include <amxmodx>
#include <amxmisc>
#include <ammopacks.inc>
#include <fun>
#include <cstrike>
#define PLUGIN "Un Ammo"
#define VERSION "1.0"
#define AUTHOR "Skull3D"
new item;
new koszt;
new team;
new ma[33];
new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
koszt=register_cvar("koszt_ne","500")
team=register_cvar("team_ne","2") //0 - ALL
//1 - ZOMBIE
//2 - HUMAN
new tkoszt=get_pcvar_num(koszt)
new tteam =get_pcvar_num(team)
item=dodaj_extra_item("Unlimited Ammo",tkoszt,tteam) //rejestrujemy nowy item - nazwa - koszt -team(1 - Zombie,2 - Human,0 - All
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_logevent("PoczatekRundy", 2, "1=Round_Start");
}
public wybrano_item(id,item_id){// co ma sie stac po kupieniu itemy
if(item_id==item){// sprawdzamy czy gracz kupil item zarejestrowany wczesniej
ma[id] = true;
}
}
public PoczatekRundy()  {
for(new id=0;id<=32;id++)
{
           ma[id] = false;
}
}
public event_curweapon(id)
{
//Check if the plugin is enabled and player is alive
if(ma || !is_user_alive(id))
  return PLUGIN_CONTINUE;

//Get and check weapon ID
new weaponID= read_data(2)
if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE || weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG)
  return PLUGIN_CONTINUE;

if(cs_get_user_bpammo(id, weaponID)!=CSW_MAXAMMO[weaponID])
  cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])

return PLUGIN_CONTINUE;
}
 

Może to?

#7 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 15.09.2011 19:08

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

ammo.sma(41) : error 033: array must be indexed (variable "ma")
ammo.sma(52) : error 001: expected token: "}", but found "-end of file-"

2 Errors.
Could not locate output file ammo.amxx (compile failed).
  • +
  • -
  • 0

#8 Muzzi

    Guru

  • Przyjaciel

Reputacja: 228
Wszechwidzący

  • Postów:772
  • Lokalizacja:Kraków
Offline

Napisano 15.09.2011 19:09

@Skull3D, Jak coś robisz to rób to do porządku.

Try




#include <amxmodx>
#include <amxmisc>
#include <ammopacks>
#include <fun>
#include <cstrike>

#define PLUGIN "Un Ammo"
#define VERSION "1.0"
#define AUTHOR "Skull3D"

new item,
koszt,
team;

new bool:gbItem[33];

new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
koszt=register_cvar("koszt_ne","500")
team=register_cvar("team_ne","2") //0 - ALL
//1 - ZOMBIE
//2 - HUMAN
new tkoszt=get_pcvar_num(koszt)
new tteam =get_pcvar_num(team)
item=dodaj_extra_item("Unlimited Ammo",tkoszt,tteam) //rejestrujemy nowy item - nazwa - koszt -team(1 - Zombie,2 - Human,0 - All
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_logevent("PoczatekRundy", 2, "1=Round_Start");
}
public wybrano_item(id,item_id)
{ // co ma sie stac po kupieniu itemy
if(item_id==item){// sprawdzamy czy gracz kupil item zarejestrowany wczesniej
gbItem[id] = true;
}
}
public PoczatekRundy()
{
new iPlayers[32], iNum;

get_players(iPlayers, iNum);
for(new i=0; i<=iNum; i++)
{
gbItem[iPlayers[i]] = false;
}
}
public event_curweapon(id)
{
//Check if the plugin is enabled and player is alive
if(gbItem[id] || !is_user_alive(id))
return PLUGIN_CONTINUE;

//Get and check weapon ID
new weaponID= read_data(2)

if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE || weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG)
return PLUGIN_CONTINUE;

if(cs_get_user_bpammo(id, weaponID)!= CSW_MAXAMMO[weaponID])
cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])

return PLUGIN_CONTINUE;
}



Kod nie testowany, tylko poprawiłem błędy które były zawarte w kodzie wyżej.

Użytkownik Muzzi edytował ten post 15.09.2011 19:11

  • +
  • -
  • 0

#9 Skull3D

    Wszechmogący

  • Zbanowany

Reputacja: 102
Zaawansowany

  • Postów:651
  • Imię:Andrzej
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.09.2011 19:11

Muzzi ja to robiłem na necie a tam sie nie da tabow :)

#10 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 15.09.2011 19:27

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

ammo.sma(63) : error 001: expected token: "}", but found "-end of file-"

1 Error.
Could not locate output file ammo.amxx (compile failed).
  • +
  • -
  • 0

#11 speedkill

    Godlike

  • Przyjaciel

Reputacja: 1 592
Godlike

  • Postów:2 733
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Prudnik
Offline

Napisano 15.09.2011 19:30

Masz
http://amxx.pl/kompi...9&fname=das.sma
  • +
  • -
  • 1

If you can dream it, you can do it.


#12 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 15.09.2011 20:23

Udało się skompilować lecz nie daje tego efektu co chciałem tzn trzeba przeładowywać
  • +
  • -
  • 0

#13 Muzzi

    Guru

  • Przyjaciel

Reputacja: 228
Wszechwidzący

  • Postów:772
  • Lokalizacja:Kraków
Offline

Napisano 15.09.2011 20:31

Try


#include <amxmodx>
#include <amxmisc>
#include <ammopacks>
#include <fun>
#include <cstrike>

#define PLUGIN "Un Ammo"
#define VERSION "1.0"
#define AUTHOR "Skull3D"

new item,
koszt,
team;

new bool:gbItem[33];

new CSW_MAXAMMO[33]= {-2, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100, -1, -1}

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
koszt=register_cvar("koszt_ne","500")
team=register_cvar("team_ne","2") //0 - ALL
//1 - ZOMBIE
//2 - HUMAN
new tkoszt=get_pcvar_num(koszt)
new tteam =get_pcvar_num(team)
item=dodaj_extra_item("Unlimited Ammo",tkoszt,tteam) //rejestrujemy nowy item - nazwa - koszt -team(1 - Zombie,2 - Human,0 - All
register_event("CurWeapon", "event_curweapon", "be", "1=1")
register_logevent("PoczatekRundy", 2, "1=Round_Start");
}
public wybrano_item(id,item_id)
{ // co ma sie stac po kupieniu itemy
if(item_id==item){// sprawdzamy czy gracz kupil item zarejestrowany wczesniej
gbItem[id] = true;
}
}
public PoczatekRundy()
{
new iPlayers[32], iNum;

get_players(iPlayers, iNum);
for(new i=0; i<=iNum; i++)
{
gbItem[iPlayers[i]] = false;
}
}
public event_curweapon(id)
{
//Check if the plugin is enabled and player is alive
if(!gbItem[id] || !is_user_alive(id))
return PLUGIN_CONTINUE;

//Get and check weapon ID
new weaponID= read_data(2)

if(weaponID==CSW_C4 || weaponID==CSW_KNIFE || weaponID==CSW_HEGRENADE || weaponID==CSW_SMOKEGRENADE || weaponID==CSW_FLASHBANG)
return PLUGIN_CONTINUE;

if(cs_get_user_bpammo(id, weaponID)!= CSW_MAXAMMO[weaponID])
cs_set_user_bpammo(id, weaponID, CSW_MAXAMMO[weaponID])

return PLUGIN_CONTINUE;
}

  • +
  • -
  • 1

#14 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 15.09.2011 20:50

Nadal trzeba przeładowywać.
  • +
  • -
  • 0

#15 Muzzi

    Guru

  • Przyjaciel

Reputacja: 228
Wszechwidzący

  • Postów:772
  • Lokalizacja:Kraków
Offline

Napisano 16.09.2011 14:30

Kod pisany na nowo, skopiowanie kilka funkcji.

Try

/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "Unlimited Ammo"
#define VERSION "1.0"
#define AUTHOR "Uzytkownik"

new item,
koszt,
team;

new bool:gbHasItem[33];

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] =
{
-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_cvar("koszt_unammo","100")
register_cvar("team_unammo","2")

koszt = get_cvar_num("koszt_unammo");
team = get_cvar_num("team_unammo");

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_message(get_user_msgid("CurWeapon"), "message_CurWeapon")

item = dodaj_extra_item("Nieskonczona Amunicja", koszt, team)

}
public client_connect(id)
gbHasItem[id] = false

public wybrano_item(id,item_id)
{
if(item_id==item)
{
new name[33];
get_user_name(id, name, charsmax(name));
client_print(id, 3, "%s kupil unlimited ammo", name);
gbHasItem[id] = true
}

}

public event_round_start()
{
new iPlayers[32], iNum;

get_players(iPlayers, iNum);
for (new i; i < iNum; i++)
{
if(!is_user_connected(iPlayers[i]))
continue;

gbHasItem[iPlayers[i]] = false;
}
}

public message_cur_weapon(msg_id, msg_dest, msg_entity)
{
if (!gbHasItem[msg_entity])
return;


if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;

static weapon, clip
weapon = get_msg_arg_int(2)
clip = get_msg_arg_int(3)


if (MAXCLIP[weapon] > 2)
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])

if (clip < 2)
{

static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

return entity;
}

stock fm_set_weapon_ammo(entity, amount)
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);


  • +
  • -
  • 1

#16 diggs

    Wszechwidzący

  • Użytkownik

Reputacja: 28
Życzliwy

  • Postów:229
  • Lokalizacja:Internet
Offline

Napisano 16.09.2011 16:39

Kiedyś coś takiego zrobiłem, niestety usunąłem to bo było całkiem bezsensu (dla mnie). Zrobiłem to za pomocą eventu Cure_Weapon, w nim był jeden if który sprawdzał aktualną ilość naboi w porównaniu z maksymalna i jeśli było 0 naboi to ustawiał ich ilość znów na max. Efekt był taki że jak miałeś 0 pocisków od razu miałeś max (automatyczne przeładowanie).
  • +
  • -
  • 1

cFun.pl BaseBuilderPro v6.5.8 Tirant edit by diggs
IP: 80.82.16.66:27034
b_350_20_D91408_470002_FFFFFA_000000.png

cFun.pl Only AWP - 1000 FPS [SkinsMod]
IP: 80.72.42.113:27015
b_350_20_F8D241_B69427_0F100D_000000.png


#17 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 18.09.2011 12:18

Nie wiem czemu, ale nie pokazuje mi tego w sklepie.
Mam w logach błąd z tym pluginem

Spoiler

Użytkownik rpk. shark edytował ten post 18.09.2011 12:29
Spoiler...

  • +
  • -
  • 0

#18 Muzzi

    Guru

  • Przyjaciel

Reputacja: 228
Wszechwidzący

  • Postów:772
  • Lokalizacja:Kraków
Offline

Napisano 18.09.2011 13:31

Przepraszam mój błąd, źle nazwałem funkcje.

try


/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "Unlimited Ammo"
#define VERSION "1.0"
#define AUTHOR "Uzytkownik"

new item,
koszt,
team;

new bool:gbHasItem[33];

// CS Offsets
#if cellbits == 32
const OFFSET_CLIPAMMO = 51
#else
const OFFSET_CLIPAMMO = 65
#endif
const OFFSET_LINUX_WEAPONS = 4

// Max Clip for weapons
new const MAXCLIP[] =
{
-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_cvar("koszt_unammo","100")
register_cvar("team_unammo","2")

koszt = get_cvar_num("koszt_unammo");
team = get_cvar_num("team_unammo");

register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_message(get_user_msgid("CurWeapon"), "message_CurWeapon")

item = dodaj_extra_item("Nieskonczona Amunicja", koszt, team)

}
public client_connect(id)
gbHasItem[id] = false

public wybrano_item(id,item_id)
{
if(item_id==item)
{
new name[33];
get_user_name(id, name, charsmax(name));
client_print(id, 3, "%s kupil unlimited ammo", name);
gbHasItem[id] = true
}

}

public event_round_start()
{
new iPlayers[32], iNum;

get_players(iPlayers, iNum);
for (new i; i < iNum; i++)
{
if(!is_user_connected(iPlayers[i]))
continue;

gbHasItem[iPlayers[i]] = false;
}
}

public message_CurWeapon(msg_id, msg_dest, msg_entity)
{
if (!gbHasItem[msg_entity])
return;


if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
return;

static weapon, clip
weapon = get_msg_arg_int(2)
clip = get_msg_arg_int(3)


if (MAXCLIP[weapon] > 2)
{
set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])

if (clip < 2)
{

static wname[32], weapon_ent
get_weaponname(weapon, wname, sizeof wname - 1)
weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity)

fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon])
}
}
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) {}

return entity;
}

stock fm_set_weapon_ammo(entity, amount)
set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);

  • +
  • -
  • 1

#19 zenon

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: -1
Nowy

  • Postów:74
  • Lokalizacja:Poland &gt;Radomsko
Offline

Napisano 18.09.2011 15:48

Działa. Dziękuję :)
  • +
  • -
  • 0




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

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