|
发表于 2004-12-18 20:19:00
|
显示全部楼层
|阅读模式
来自 中国–黑龙江–齐齐哈尔
// written by thomas aka -]ToC[-blah blah blah
// admin commands:
// amx_girlthrow <authid, nick or #userid> [time]
// amx_ungirlthrow <authid, nick or #userid>
// cvars:
// amx_girlthrow 0 or 1 - makes all players throw like a girl
#include <amxmod>
#include <amxmisc>
#include <xtrafun>
new const HEGRENADE_MODEL[] = "models/w_hegrenade.mdl"
new girlthrow[33]
public grenid(parm[]){
new id = parm[0]
new string[32], grenadeid = 0
do
{
grenadeid = get_grenade_id(id, string, 31, grenadeid)
}
while (grenadeid &&!equali(HEGRENADE_MODEL,string));
if (grenadeid)
{
new grenage_vel[3]
grenage_vel[0] = 0
grenage_vel[1] = 0
grenage_vel[2] = 0
set_entity_velocity(grenadeid, grenage_vel)
}
}
public TextMsg(id){
new cvar = get_cvar_num("amx_girlthrow")
if (!girlthrow[id] && !cvar) return PLUGIN_CONTINUE
new name[32]
read_data(3, name, 31)
if (id==find_player("a",name))
{
new parm[1]
parm[0] = id
set_task(0.001,"grenid",50,parm,1)
}
return PLUGIN_CONTINUE
}
public amx_girlthrow(id,level,cid) {
if (!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,1)
if (!player) return PLUGIN_HANDLED
girlthrow[player] = 1
new sthrowtime[8]
read_argv(2,sthrowtime,7)
new Float:throwtime = floatstr(sthrowtime)
new param[2]
param[0] = player
new name[32]
get_user_name(player, name , 31)
set_task( throwtime ? throwtime : 99999.0 ,"ungirlthrow",player,param,1)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"%s throws like a girl!",name)
return PLUGIN_HANDLED
}
public ungirlthrow(param[]) {
new id = param[0]
if (!girlthrow[id]) return PLUGIN_HANDLED
girlthrow[id] = 0
new name[32]
get_user_name(id, name , 31)
set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
show_hudmessage(0,"%s no longer throws like a girl.",name)
return PLUGIN_HANDLED
}
public amx_ungirlthrow(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,1)
if (!player) return PLUGIN_HANDLED
new param[2]
param[0] = player
ungirlthrow(param)
return PLUGIN_HANDLED
}
public client_disconnect(id) {
new param[2]
param[0] = id
ungirlthrow(param)
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin("Throw Like a Girl","0.1","blah")
register_cvar("amx_girlthrow","0")
register_concmd("amx_girlthrow","amx_girlthrow",ADMIN_LEVEL_A,"<authid, nick or #userid> [time]")
register_concmd("amx_ungirlthrow","amx_ungirlthrow",ADMIN_LEVEL_A,"<authid, nick or #userid>")
register_event("TextMsg","TextMsg","b","2&#Game_radio", "4&#Fire_in_the_hole")
return PLUGIN_CONTINUE
} |
|