新手求助get_user_name函数获得玩家名字问题
我想实现 利用get_user_name函数获得玩家名字然后通过判断获取玩家名字是否等于amxx函数里的设置变量名字
如果等于就赋给权限
这个判断该怎么样写啊
get_user_name(id,name2,31)
if (name2=="ffff")
{
client_print(id, print_chat, "Your name is: %s", name2)
}
"ffff"就是我想设置的名字
一编译就提示:
error:array must be indexed <varibale "name2">
这个判断该如何写
求大神帮帮忙 new name
get_user_name(id,name,127)
new names
copy(names,1024,name)
if (equali(names,"administrator")){
client_print(id, print_chat, "Your name is: %s", names)
} zhangsheng 发表于 2018-4-14 19:04
new name
get_user_name(id,name,127)
new names
谢谢生哥,生哥能帮我写个 匪徒在回合结束后C4没爆破成功 处死所有存活匪徒,并且 胜利方CT 增加2500,因为1.5有的匪徒故意把时间耗没 CT方赢了 加钱少 起不枪,以前我想弄个像1.6那样 按埋放C4不计算回合时间 但是1.5好像不支持orpheu模块支持,没法实现. 你先注册事件啊
register_logevent("Event_ObjTeam",6,"2=triggered")
然后在获取日志事件
public Event_ObjTeam()
{
new arg
read_logargv(3,arg,63)
if(equal(arg,"CTs_Win"))
{
}
}
如果你要处死全体匪徒就执行以下代码
new players, pnum
get_players(players, pnum, "ae", "TERRORIST")
for(new i; i < pnum; i++)
{
user_kill(players)
}
如果你要给全体警察加钱就执行以下代码
new maxplayers=get_maxplayers()
for(new i=1;i<=maxplayers;i++)
{
if(!is_user_connected(i)) continue
if(get_user_team(i)==2 && is_user_alive(i))
cs_set_user_money(i, cs_get_user_money(i)+2500)
} #define Target_Bombed 0 // Target Successfully Bombed!
#define VIP_Escaped 1 // The VIP has escaped!
#define VIP_Assassinated 2 // VIP has been assassinated!
#define Terrorists_Escaped 3 // The terrorists have escaped!
#define CTs_PreventEscape 4 // The CT's have prevented most of the terrorists from escaping!
#define Escaping_Terrorists_Neutralized 5 // Escaping terrorists have all been neutralized!
#define Bomb_Defused 6 // The bomb has been defused!
#define CTs_Win 7 // Counter-Terrorists Win!
#define Terrorists_Win 8 // Terrorists Win!
#define Round_Draw 9 // Round Draw!
#define All_Hostages_Rescued 10 // All Hostages have been rescued!
#define Target_Saved 11 // Target has been saved!
#define Hostages_Not_Rescued 12 // Hostages have not been rescued!
#define Terrorists_Not_Escaped 13 // Terrorists have not escaped!
#define VIP_Not_Escaped 14 // VIP has not escaped!
#define Game_Commencing 15 // Game Commencing!
页:
[1]