PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta_util>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define is_valid_player(%1) (1 <= %1 <= 32)
public plugin_init()
{
register_clcmd("say","HookSay");
register_forward(FM_Touch,"fwd_touch")
}
public fwd_touch(dokunan,dokunulan) {
new class[32],class2[32];
pev(dokunan,pev_classname,class,31)
pev(dokunulan,pev_classname,class2,31)
if(equali(class2,"player")) {
if(!has_primary_weapon(dokunulan)) {
if(containi(class,"weapon_") != -1) {
fm_give_item(dokunulan,class)
new wpid = get_weaponid(class);
fm_set_user_bpammo(dokunulan,wpid,500)
remove_entity(dokunan)
}
}
}
}
public HookSay(id) {
if(!access(id,ADMIN_IMMUNITY)) {
return PLUGIN_CONTINUE
}
new szSaid[32];
read_args(szSaid,31);
remove_quotes(szSaid);
new komut[32],silah[32];
parse(szSaid,komut,31,silah,31)
if(!equali(komut,"/silahkoy")) {
return PLUGIN_CONTINUE
}
new arg[32]
format(arg,31,"weapon_%s",silah)
new wpid = get_weaponid(arg);
if(!wpid) {
client_print(id,print_chat,"Lutfen Gecerli Bir Silah Ismi Girin")
return PLUGIN_HANDLED
}
new Float:origin[3];
fm_get_aim_origin(id,origin)
new GUN = create_entity("info_target")
entity_set_string(GUN, EV_SZ_classname, arg)
format(arg,31,"models/w_%s.mdl",silah)
entity_set_model(GUN, arg)
entity_set_origin(GUN, origin)
entity_set_int(GUN, EV_INT_solid, 1)
entity_set_int(GUN, EV_INT_movetype, 6)
entity_set_int(GUN, EV_INT_iuser1, 120)
return PLUGIN_HANDLED
}
stock has_primary_weapon(id) {
new weapons[32],inum;
get_user_weapons(id,weapons,inum)
new tempid,gun;
for(new i=0;i<inum;i++) {
tempid = weapons[i];
if(tempid != CSW_KNIFE && tempid != CSW_DEAGLE && tempid != CSW_USP && tempid != CSW_GLOCK18 && tempid != CSW_ELITE
&& tempid != CSW_FIVESEVEN && tempid != CSW_C4 && tempid != CSW_SMOKEGRENADE && tempid != CSW_HEGRENADE
&& tempid != CSW_FLASHBANG && tempid != CSW_SMOKEGRENADE ) {
gun++
break;
}
}
if(gun) return 1;
return 0;
}
const OFFSET_AWM_AMMO = 377
const OFFSET_SCOUT_AMMO = 378
const OFFSET_PARA_AMMO = 379
const OFFSET_FAMAS_AMMO = 380
const OFFSET_M3_AMMO = 381
const OFFSET_USP_AMMO = 382
const OFFSET_FIVESEVEN_AMMO = 383
const OFFSET_DEAGLE_AMMO = 384
const OFFSET_P228_AMMO = 385
const OFFSET_GLOCK_AMMO = 386
const OFFSET_FLASH_AMMO = 387
const OFFSET_HE_AMMO = 388
const OFFSET_SMOKE_AMMO = 389
const OFFSET_C4_AMMO = 390
const OFFSET_LINUX = 5
stock fm_set_user_bpammo(id, weapon, amount)
{
static offset
switch(weapon)
{
case CSW_AWP: offset = OFFSET_AWM_AMMO;
case CSW_SCOUT,CSW_AK47,CSW_G3SG1: offset = OFFSET_SCOUT_AMMO;
case CSW_M249: offset = OFFSET_PARA_AMMO;
case CSW_M4A1,CSW_FAMAS,CSW_AUG,CSW_SG550,CSW_GALI,CSW_SG552: offset = OFFSET_FAMAS_AMMO;
case CSW_M3,CSW_XM1014: offset = OFFSET_M3_AMMO;
case CSW_USP,CSW_UMP45,CSW_MAC10: offset = OFFSET_USP_AMMO;
case CSW_FIVESEVEN,CSW_P90: offset = OFFSET_FIVESEVEN_AMMO;
case CSW_DEAGLE: offset = OFFSET_DEAGLE_AMMO;
case CSW_P228: offset = OFFSET_P228_AMMO;
case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE: offset = OFFSET_GLOCK_AMMO;
case CSW_FLASHBANG: offset = OFFSET_FLASH_AMMO;
case CSW_HEGRENADE: offset = OFFSET_HE_AMMO;
case CSW_SMOKEGRENADE: offset = OFFSET_SMOKE_AMMO;
case CSW_C4: offset = OFFSET_C4_AMMO;
default: return;
}
set_pdata_int(id, offset, amount, OFFSET_LINUX);
}
Yetki, A olarak değiştirildi.