Merhaba, Arkadaşlar bende bir silah sması var. Zombi escape için bir menü yapmak istiyorum ve bu yüzden silah smasını tl ile alınabilecek şekilde yapabilir miyiz ? Yani silahı menüdeki tl ile alınmasını istiyorum böyle birşey mümkün mü ?
Konu
evet zp
Yapılabilir mi peki böyle birşey, mümkün mü yani ?
Yapılabilir mi peki böyle birşey, mümkün mü yani ?
Son Düzenleme: 04-09-2020, 16:52, Düzenleyen: admin1963+.
@admin1963+ sma ' nın içindeki silahların fiyatını ve hepsinin paralı ' mı olcağını yazarsan yardımcı olabilirim
kanka sma yı inceledimde olmaz gibi duruyor
kanka sma yı inceledimde olmaz gibi duruyor
Son Düzenleme: 04-09-2020, 18:33, Düzenleyen: Enes Fındık.
Para birimi eğer zombie plauge ile aynı ise deneyiniz ;
PHP Kod:
#include < amxmodx >
#include < amxmisc >
#include < engine >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < zombieplague >
#define WEAPON_BITSUM ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_UMP45) | (1<<CSW_FAMAS) | (1<<CSW_AWP) | (1<<CSW_MP5NAVY) | (1<<CSW_M249) | (1<<CSW_M3) | (1<<CSW_M4A1) | (1<<CSW_TMP) | (1<<CSW_G3SG1) | (1<<CSW_SG552) | (1<<CSW_AK47) | (1<<CSW_P90))
new const VERSION[] = "1.3";
new g_clipammo[33], g_has_balrog[33], g_itemid, g_hamczbots, g_laserbeam_spr, g_event_balrog,money_cvar, g_primaryattack, bal_balrog_damage_x, bal_balrog_bpammo, bal_balrog_shotspd, bal_balrog_oneround, bal_balrog_clip, bal_botquota;
new const SHOT_SOUND[][] = {"weapons/ethereal_shoot.wav"}
new const BALROG_SOUNDS[][] = {"weapons/ethereal_reload.wav", "weapons/ethereal_idle1.wav", "weapons/ethereal_draw.wav"}
new const GUNSHOT_DECALS[] = {41, 42, 43, 44, 45}
new const V_BALROG_MDL[64] = "models/v_plasmagun2.mdl";
new const P_BALROG_MDL[64] = "models/p_plasmagun.mdl";
new const W_BALROG_MDL[64] = "models/w_plasmagun.mdl";
public plugin_init()
{
// Plugin Register
register_plugin("[ZP:50] Extra Item: balrog", VERSION, "CrazY");
bal_balrog_damage_x = register_cvar("zp_balrog_damage_x", "1.6");
bal_balrog_clip = register_cvar("zp_balrog_clip", "40");
bal_balrog_bpammo = register_cvar("zp_balrog_bpammo", "200");
bal_balrog_shotspd = register_cvar("zp_balrog_shot_speed", "0.12");
bal_balrog_oneround = register_cvar("zp_balrog_oneround", "0");
money_cvar = register_cvar("zp_balrog_money","333")
// Cvar Pointer
bal_botquota = get_cvar_pointer("bot_quota");
// Events
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
// Forwards
register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1);
register_forward(FM_PrecacheEvent, "fw_PrecacheEvent_Post", 1)
register_forward(FM_PlaybackEvent, "fw_PlaybackEvent");
register_forward(FM_SetModel, "fw_SetModel");
// HAM Forwards
RegisterHam(Ham_Item_PostFrame, "weapon_ump45", "fw_ItemPostFrame");
RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack_Post", 1);
RegisterHam(Ham_Item_Deploy, "weapon_ump45", "fw_ItemDeploy_Post", 1);
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
RegisterHam(Ham_Item_AddToPlayer, "weapon_ump45", "fw_AddToPlayer");
RegisterHam(Ham_Spawn, "player", "bePS", 1);
register_clcmd("say /uzaylisilahi","command_give_balrog")
}
public plugin_precache()
{
precache_model(V_BALROG_MDL);
precache_model(P_BALROG_MDL);
precache_model(W_BALROG_MDL);
g_laserbeam_spr = precache_model("sprites/laserbeam.spr");
for(new i = 0; i < sizeof SHOT_SOUND; i++) precache_sound(SHOT_SOUND[i]);
for(new i = 0; i < sizeof BALROG_SOUNDS; i++) precache_sound(BALROG_SOUNDS[i]);
}
public bePS(id){
g_has_balrog[id] = false;
}
public client_disconnect(id)
{
g_has_balrog[id] = false;
}
public client_connect(id)
{
g_has_balrog[id] = false;
}
public zp_fw_core_infect_post(id)
{
g_has_balrog[id] = false;
}
public zp_fw_core_cure_post(id)
{
g_has_balrog[id] = false;
}
public client_putinserver(id)
{
g_has_balrog[id] = false;
if (is_user_bot(id) && !g_hamczbots && bal_botquota)
{
set_task(0.1, "register_ham_czbots", id);
}
}
public event_round_start()
{
if (get_pcvar_num(bal_balrog_oneround))
for (new i = 1; i <= get_maxplayers(); i++) g_has_balrog[i] = false;
}
public register_ham_czbots(id)
{
if (g_hamczbots || !is_user_bot(id) || !get_pcvar_num(bal_botquota))
return;
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage");
g_hamczbots = true;
}
public plugin_natives ()
{
register_native("give_weapon_ethereal", "native_give_weapon_add", 1)
}
public native_give_weapon_add(id)
{
command_give_balrog(id)
}
public command_give_balrog(player)
{
if(zp_get_user_ammo_packs(player) >= get_pcvar_num(money_cvar)){
zp_set_user_ammo_packs(player,zp_get_user_ammo_packs(player) - get_pcvar_num(money_cvar))
drop_primary(player);
g_has_balrog[player] = true;
new weaponid = give_item(player, "weapon_ump45");
cs_set_weapon_ammo(weaponid, get_pcvar_num(bal_balrog_clip));
cs_set_user_bpammo(player, CSW_UMP45, get_pcvar_num(bal_balrog_bpammo));
}
else {
client_print_c(player,"!gYou !tDon't Have !gEnough Money!")
}
}
public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
{
if (is_user_alive(id) && get_user_weapon(id) == CSW_UMP45 && g_has_balrog[id])
{
set_cd(cd_handle, CD_flNextAttack, halflife_time () + 0.001);
}
}
public fw_PrecacheEvent_Post(type, const name[])
{
if (equal("events/ump45.sc", name))
{
g_event_balrog = get_orig_retval()
return FMRES_HANDLED;
}
return FMRES_IGNORED;
}
public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if ((eventid != g_event_balrog) || !g_primaryattack)
return FMRES_IGNORED;
if (!(1 <= invoker <= get_maxplayers()))
return FMRES_IGNORED;
playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
return FMRES_SUPERCEDE;
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity) || !equal(model, "models/w_ump45.mdl")) return FMRES_IGNORED;
static szClassName[33]; pev(entity, pev_classname, szClassName, charsmax(szClassName))
if(!equal(szClassName, "weaponbox")) return FMRES_IGNORED;
static owner, wpn
owner = pev(entity, pev_owner)
wpn = find_ent_by_owner(-1, "weapon_ump45", entity)
if(g_has_balrog[owner] && pev_valid(wpn))
{
g_has_balrog[owner] = false;
set_pev(wpn, pev_impulse, 10991);
engfunc(EngFunc_SetModel, entity, W_BALROG_MDL);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public fw_AddToPlayer(wpn, id)
{
if(pev_valid(wpn) && is_user_connected(id) && pev(wpn, pev_impulse) == 10991)
{
g_has_balrog[id] = true;
set_pev(wpn, pev_impulse, 0);
return HAM_HANDLED;
}
return HAM_IGNORED;
}
public fw_ItemPostFrame(weapon_entity)
{
new id = pev(weapon_entity, pev_owner);
if(!g_has_balrog[id] || !is_user_connected(id) || !pev_valid(weapon_entity))
return HAM_IGNORED;
static iClipExtra; iClipExtra = get_pcvar_num(bal_balrog_clip);
new Float:flNextAttack = get_pdata_float(id, 83, 5);
new iBpAmmo = cs_get_user_bpammo(id, CSW_UMP45);
new iClip = get_pdata_int(weapon_entity, 51, 4);
new fInReload = get_pdata_int(weapon_entity, 54, 4);
if(fInReload && flNextAttack <= 0.0)
{
new Clp = min(iClipExtra - iClip, iBpAmmo);
set_pdata_int(weapon_entity, 51, iClip + Clp, 4);
cs_set_user_bpammo(id, CSW_UMP45, iBpAmmo-Clp);
set_pdata_int(weapon_entity, 54, 0, 4);
fInReload = 0;
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_UMP45 && g_has_balrog[iAttacker])
{
static Float:flEnd[3]
get_tr2(ptr, TR_vecEndPos, flEnd)
if(iEnt)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
write_short(iEnt)
message_end()
} else {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_short(iAttacker)
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
}
public fw_PrimaryAttack(weapon_entity)
{
new id = get_pdata_cbase(weapon_entity, 41, 4);
if (g_has_balrog[id])
{
g_clipammo[id] = cs_get_weapon_ammo(weapon_entity);
g_primaryattack = 1;
}
}
public fw_PrimaryAttack_Post(weapon_entity)
{
new id = get_pdata_cbase(weapon_entity, 41, 4);
if (g_has_balrog[id] && g_clipammo[id])
{
g_primaryattack = 0;
set_pdata_float(weapon_entity, 46, get_pcvar_float(bal_balrog_shotspd), 4);
emit_sound(id, CHAN_WEAPON, SHOT_SOUND[random_num(0, sizeof SHOT_SOUND - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
MAKE_LaserBeam(id, 7, 100, 0, 0);
UTIL_PlayWeaponAnimation(id, random_num(3, 5));
}
}
public fw_ItemDeploy_Post(weapon_entity)
{
static id; id = get_weapon_ent_owner(weapon_entity);
if (pev_valid(id) && g_has_balrog[id])
{
set_pev(id, pev_viewmodel2, V_BALROG_MDL);
set_pev(id, pev_weaponmodel2, P_BALROG_MDL);
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if(is_user_alive(attacker) && get_user_weapon(attacker) == CSW_UMP45 && g_has_balrog[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(bal_balrog_damage_x));
}
}
stock MAKE_LaserBeam(id, Size, R, G, B)
{
static End[3]
get_user_origin(id, End, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte (TE_BEAMENTPOINT)
write_short( id |0x1000 )
write_coord(End[0])
write_coord(End[1])
write_coord(End[2])
write_short(g_laserbeam_spr)
write_byte(0)
write_byte(1)
write_byte(1)
write_byte(Size)
write_byte(4)
write_byte(R)
write_byte(G)
write_byte(B)
write_byte(255)
write_byte(0)
message_end()
}
stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
set_pev(Player, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
write_byte(Sequence)
write_byte(pev(Player, pev_body))
message_end()
}
stock get_weapon_ent_owner(ent)
{
return get_pdata_cbase(ent, 41, 4);
}
stock give_item(index, const item[])
{
if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
return 0;
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
if (!pev_valid(ent))
return 0;
new Float:origin[3];
pev(index, pev_origin, origin);
set_pev(ent, pev_origin, origin);
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, ent);
new save = pev(ent, pev_solid);
dllfunc(DLLFunc_Touch, ent, index);
if (pev(ent, pev_solid) != save)
return ent;
engfunc(EngFunc_RemoveEntity, ent);
return -1;
}
stock drop_primary(id)
{
new weapons[32], num;
get_user_weapons(id, weapons, num);
for (new i = 0; i < num; i++)
{
if (WEAPON_BITSUM & (1<<weapons[i]))
{
static wname[32];
get_weaponname(weapons[i], wname, sizeof wname - 1);
engclient_cmd(id, "drop", wname);
}
}
}
stock client_print_c(const id,const input[], any:...)
{
new msg[191], players[32], count = 1; vformat(msg,190,input,3);
replace_all(msg,190,"!g","^4"); // green
replace_all(msg,190,"!y","^1"); // normal
replace_all(msg,190,"!t","^3"); // team
if (id) players[0] = id; else get_players(players,count,"ch");
for (new i=0;i<count;i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
Son Düzenleme: 05-09-2020, 10:12, Düzenleyen: PawNod'.
Yok reis gerek kalmadı ben hallettim. Konuyu Taşıyabilirsiniz. TEŞEKKÜRLER YİNEDE 


(04-09-2020, 18:32)Enes Fındık Adlı Kullanıcıdan Alıntı: @admin1963+ sma ' nın içindeki silahların fiyatını ve hepsinin paralı ' mı olcağını yazarsan yardımcı olabilirimBi arkadaşla beraber yaptık reis oldu. ama yinede teşekkür ederim
kanka sma yı inceledimde olmaz gibi duruyor

Son Düzenleme: 05-09-2020, 15:38, Düzenleyen: admin1963+.
Benzer Konular
Yorum
1.269
Okunma
08-02-2026, 13:09
Yorum
1.929
Okunma
18-11-2025, 04:36
)



