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)
remove_entity(dokunan)
}
}
}
}
public HookSay(id) {
if(!access(id,ADMIN_BAN)) {
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;
}
İstedigin yere nişan al;