Ktos odświeżyl temat i widze ze mialem tu jakies zalegle obietnice...
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <engine>
#define PLUGIN "Drop the Money"
#define VERSION "0.1"
#define AUTHOR "SAMURAI"
// sisez
#define MINS Float:{-12.650000, -22.070000, -3.950000}
#define MAXS Float:{19.870001, 8.390000, 20.540001}
new const money_model[] = "models/briefcase_money_model.mdl";
new const money_classname[] = "amxx_money";
public plugin_precache()
{
// precache model
precache_model(money_model);
}
public plugin_init()
{
// register plugin
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","DeathMsg","ade")
register_event("HLTV","Event_StartRound","a","1=0","2=0")
// FM_Touch forward
register_forward(FM_Touch,"fw_touch");
}
// client_death CSX Forward
public DeathMsg()
{
// get victim origin
new victim = read_data(2)
static Float:victim_origin[3], Float:fNewOrigin[3];
pev(victim,pev_origin,victim_origin);
// create new ent
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"));
// adjust coordinates
fNewOrigin[0] = victim_origin[0] + 40.0;
fNewOrigin[1] = victim_origin[1];
fNewOrigin[2] = victim_origin[2] - 32.0;
// create new origin
engfunc(EngFunc_SetOrigin,ent,fNewOrigin);
//engfunc(EngFunc_MoveToOrigin,
// check if isn't a valid ent
if(!pev_valid(ent))
return 0;
// set model
engfunc(EngFunc_SetModel,ent,money_model);
// set classname
set_pev(ent,pev_classname,money_classname);
// spawn ent
dllfunc(DLLFunc_Spawn, ent);
// set solid
set_pev(ent,pev_solid,SOLID_BBOX);
// set movetype
set_pev(ent,pev_movetype,MOVETYPE_FLY);
// set sizes
engfunc(EngFunc_SetSize,ent,MINS,MAXS);
// drop entity to floor
engfunc(EngFunc_DropToFloor,ent);
// store victims money in iuser4
new money=cs_get_user_money(victim)/2
set_pev(ent,pev_iuser4,money);
cs_set_user_money(victim,money,1)
return 0;
}
public Event_StartRound()
{
new ent=0
while((ent=find_ent_by_class(ent,money_classname))>0)
{
engfunc(EngFunc_RemoveEntity,ent);
}
}
public fw_touch(ent,id)
{
// check if toucher isn't valid
if(!is_user_alive(id))
return FMRES_IGNORED;
// get touched classname
static classname[32];
pev(ent,pev_classname,classname,31);
// check if isn't "amxx_money"
if(!equali(classname,money_classname) )
return FMRES_IGNORED;
// stuff more get victim money, money to set etc
static money_found, money_have, money_set;
money_found = pev(ent,pev_iuser4);
money_have = cs_get_user_money(id);
money_set = money_found + money_have;
// if result >= 16000
if(money_set > 16000)
{
cs_set_user_money(id,16000)
set_pev(ent,pev_iuser4,money_set-16000)
return FMRES_IGNORED;
}
// set user lost money
cs_set_user_money(id,money_set);
// finally remove ent
engfunc(EngFunc_RemoveEntity,ent);
return FMRES_IGNORED;
}
-Pozbylem sie modulu co wymagal bodaj najnowszej wersji
amxx'a (dziala teraz na moim 1.76d)
-Niestety dodalem modul
-W walizce jest 50% twojej kasy, czyli ginac tracisz 50% tak jak prosiliscie.
-Jesli masz 15900 a w walizce masz 200 to stara wersja nie pozwalala podniesc kasy... moja daje ci 16000 i w walizce zostaje 100 kasy
jak 0 to walizka znika
-Walizka znika na poczatku nowej rundy