高人帮忙加上权限没有权限的不能保存经验
// Advanced Swear Filter and Punishment plugin uses this function
public Admin_TakeXP(){
#if ADVANCED_DEBUG
writeDebugInfo("Admin_TakeXP",0)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
new argID, argXP
read_argv(1,argID,2)
read_argv(2,argXP,31)
new id = str_to_num(argID)
p_data -= str_to_num(argXP)
WAR3_Display_Level(id,DISPLAYLEVEL_NONE)
return PLUGIN_HANDLED
}
public Admin_GiveMole(id, level, cid){
#if ADVANCED_DEBUG
writeDebugInfo("Admin_GiveMole",id)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if ( id && !( get_user_flags( id ) & XP_get_admin_flag() ) )
{
client_print(id,print_console,"%L",id,"YOU_HAVE_NO_ACCESS", g_MODclient)
return PLUGIN_HANDLED
}
new arg
read_argv(1,arg,31)
if(equali(arg,"@ALL")){
new players, inum
get_players(players,inum)
for(new a=0;a<inum;++a){
p_data]=ITEM_MOLE
WAR3_Display_Level(id,DISPLAYLEVEL_NONE)
}
return PLUGIN_HANDLED
}
else if (arg=='@'){
new players, inum
get_players(players,inum,"e",arg)
if (inum==0){
console_print(id,"%L",id,"NO_CLIENTS_IN_TEAM")
return PLUGIN_HANDLED
}
for(new a=0;a<inum;++a){
p_data]=ITEM_MOLE
WAR3_Display_Level(id,DISPLAYLEVEL_NONE)
}
}
else {
new player = find_target(id,arg)
if (!player) return PLUGIN_HANDLED
p_data=ITEM_MOLE
WAR3_Display_Level(player,DISPLAYLEVEL_NONE)
}
return PLUGIN_HANDLED
}
public changeXP(){
#if ADVANCED_DEBUG
writeDebugInfo("changeXP",0)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
new arg1
new arg2
read_argv(1,arg1,3)
read_argv(2,arg2,7)
new id=str_to_num(arg1)
new xp=str_to_num(arg2)
if((p_data + xp)< 0)
p_data = 0
else
p_data += xp
WAR3_Display_Level(id, DISPLAYLEVEL_NONE)
return PLUGIN_CONTINUE
}
public Admin_SaveXP(id, level, cid){
#if ADVANCED_DEBUG
writeDebugInfo("Admin_SaveXP",id)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if ( id && !( get_user_flags( id ) & XP_get_admin_flag() ) )
{
client_print(id,print_console,"%L",id,"YOU_HAVE_NO_ACCESS", g_MODclient)
return PLUGIN_HANDLED
}
new target
read_argv(1,target,31)
_Admin_SaveXP(id, target)
return PLUGIN_HANDLED
}
_Admin_SaveXP(id, target[]){
#if ADVANCED_DEBUG
writeDebugInfo("_Admin_SaveXP",id)
#endif
if(equali(target,"@ALL")){
new players, inum
get_players(players,inum,"c")
for(new a=0;a<inum;++a){
XP_Save(players)
}
return PLUGIN_CONTINUE
}
else if (target=='@'){
new players, inum
get_players(players,inum,"ce",target)
if (inum==0){
console_print(id,"%L",id,"NO_CLIENTS_IN_TEAM")
return PLUGIN_CONTINUE
}
for(new a=0;a<inum;++a){
XP_Save(players)
}
}
else {
new player = find_target(id,target)
if (!player)
return PLUGIN_CONTINUE
XP_Save(player)
}
return PLUGIN_CONTINUE
}
public Admin_GiveXP(id, level, cid){
#if ADVANCED_DEBUG
writeDebugInfo("Admin_GiveXP",id)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if ( id && !( get_user_flags( id ) & XP_get_admin_flag() ) )
{
client_print(id,print_console,"%L",id,"YOU_HAVE_NO_ACCESS", g_MODclient)
return PLUGIN_HANDLED
}
new target, xp
read_argv(1,target,31)
read_argv(2,xp,9)
_Admin_GiveXP(id, target, str_to_num(xp))
return PLUGIN_HANDLED
}
public _Admin_GiveXP(id, target[], iXP){
#if ADVANCED_DEBUG
writeDebugInfo("_Admin_GiveXP",id)
#endif
if(equali(target,"@ALL")){
new players, inum
get_players(players,inum)
for(new a=0;a<inum;++a){
client_print(players,print_chat,"%s %L",g_MODclient, id,"THE_ADMIN_GAVE_YOU_EXPERIENCE", iXP)
p_data] += iXP
WAR3_Display_Level(players,DISPLAYLEVEL_NONE)
}
return PLUGIN_CONTINUE
}
else if (target=='@'){
new players, inum
get_players(players,inum,"e",target)
if (inum==0){
console_print(id,"%L",id,"NO_CLIENTS_IN_TEAM")
return PLUGIN_CONTINUE
}
for(new a=0;a<inum;++a){
client_print(players,print_chat,"%s %L",g_MODclient, id,"THE_ADMIN_GAVE_YOU_EXPERIENCE", iXP)
p_data] += iXP
WAR3_Display_Level(players,DISPLAYLEVEL_NONE)
}
}
else {
new player = find_target(id,target)
if (!player)
return PLUGIN_CONTINUE
client_print(player,print_chat,"%s %L",g_MODclient, id,"THE_ADMIN_GAVE_YOU_EXPERIENCE", iXP)
p_data += iXP
WAR3_Display_Level(player,DISPLAYLEVEL_NONE)
}
return PLUGIN_CONTINUE
}
页:
[1]