Официалният форум на iPlay.bg 

Този раздел е създаден специално за проблеми и въпроси за направата на плъгини или преработката на вече съществуващи кодове.
 #395170  от southdivision
 нед юли 17, 2016 12:41 pm
Код: Избери всички
public admin_heal(id,level,cid)
{
    if (!cmd_access(id,level,cid,2))  
    return PLUGIN_HANDLED 
     
    new arg[32], arg2[8]
	new name[32], name2[32], authid[36], authid2[36]
	read_argv(1,arg,31)
	read_argv(2,arg2,7)
	get_user_name(id,name,31)
	get_user_authid(id,authid,35)
	
	new hpGive = str_to_num(arg2)

	if (hpGive <= 0) {
		console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_AMOUNT_GREATER")
		return PLUGIN_HANDLED
	} 
     
    if (arg[0]=='@'){  
        if(equali(arg[1],"ALL")) 
        { 
		
		new players[32], inum
		if (equali("T",arg[1]))		copy(arg[1],31,"PRISONERS")
		if (equali("ALL",arg[1]))	get_players(players,inum)
		else						get_players(players,inum,"e",arg[1])

		if (inum == 0) {
			console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_NO_PLAYERS")
			return PLUGIN_HANDLED
		}
		
	    for(new a = 0;a < inum; a++) {
		set_user_health(players[a], hpGive)
		}
		
	
	
        } 
        else if(equali(arg[1],"T")) 
        { 
		
        if (equali("T",arg[1]))		copy(arg[1],31,"TERRORIST")
            
       
		
        } 
        else if(equali(arg[1],"CT")) 
        { 
            new players[32], totalplayers 
            get_players(players, totalplayers) 

           
		
        } 
    } 
	
	else {

		new player = cmd_target(id,arg,6)
		if (!player) return PLUGIN_HANDLED

		set_user_health(player, hpGive)

		get_user_name(player,name2,31)
		get_user_authid(player,authid2,35)
		
	}
	
    return PLUGIN_HANDLED 
}
Проблема е,че когато желая със @all да дам кръв го изпълнява,но ако е на определен отбор или играч - не работи. Също така и проверката дали има играчи в отбора на който давам кръв - не работи незнайно защо ..
 #395172  от zolfeca
 нед юли 17, 2016 2:07 pm
Код: Избери всички
public admin_heal(id,level,cid)
{
    if (!cmd_access(id,level,cid,2))  
    return PLUGIN_HANDLED 
     
    new arg[32], arg2[8]
   new name[32], name2[32], authid[36], authid2[36]
   read_argv(1,arg,31)
   read_argv(2,arg2,7)
   get_user_name(id,name,31)
   get_user_authid(id,authid,35)
   
   new hpGive = str_to_num(arg2)

   if (hpGive <= 0) {
      console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_AMOUNT_GREATER")
      return PLUGIN_HANDLED
   } 
     
    if (arg[0]=='@'){  
       
      
      new players[32], inum
      if (equali("T",arg[1]))      copy(arg[1],31,"PRISONERS")
      if (equali("ALL",arg[1]))   get_players(players,inum)
      else                  get_players(players,inum,"e",arg[1])

      if (inum == 0) {
         console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_NO_PLAYERS")
         return PLUGIN_HANDLED
      }
      
       for(new a = 0;a < inum; a++) {
      set_user_health(players[a], hpGive)
      }
      
   
   
         
        else if(equali(arg[1],"T")) 
        { 
      
        if (equali("T",arg[1]))      copy(arg[1],31,"TERRORIST")
            
       
      
        } 
        else if(equali(arg[1],"CT")) 
        { 
            new players[32], totalplayers 
            get_players(players, totalplayers) 

           
      
        } 
    } 
   
   else {

      new player = cmd_target(id,arg,6)
      if (!player) return PLUGIN_HANDLED

      set_user_health(player, hpGive)

      get_user_name(player,name2,31)
      get_user_authid(player,authid2,35)
      
   }
   
    return PLUGIN_HANDLED 
}
 #395234  от southdivision
 пон юли 18, 2016 2:21 pm
zolfeca написа:
Код: Избери всички
public admin_heal(id,level,cid)
{
    if (!cmd_access(id,level,cid,2))  
    return PLUGIN_HANDLED 
     
    new arg[32], arg2[8]
   new name[32], name2[32], authid[36], authid2[36]
   read_argv(1,arg,31)
   read_argv(2,arg2,7)
   get_user_name(id,name,31)
   get_user_authid(id,authid,35)
   
   new hpGive = str_to_num(arg2)

   if (hpGive <= 0) {
      console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_AMOUNT_GREATER")
      return PLUGIN_HANDLED
   } 
     
    if (arg[0]=='@'){  
       
      
      new players[32], inum
      if (equali("T",arg[1]))      copy(arg[1],31,"PRISONERS")
      if (equali("ALL",arg[1]))   get_players(players,inum)
      else                  get_players(players,inum,"e",arg[1])

      if (inum == 0) {
         console_print(id,"%L", LANG_PLAYER, "AMX_SUPER_NO_PLAYERS")
         return PLUGIN_HANDLED
      }
      
       for(new a = 0;a < inum; a++) {
      set_user_health(players[a], hpGive)
      }
      
   
   
         
        else if(equali(arg[1],"T")) 
        { 
      
        if (equali("T",arg[1]))      copy(arg[1],31,"TERRORIST")
            
       
      
        } 
        else if(equali(arg[1],"CT")) 
        { 
            new players[32], totalplayers 
            get_players(players, totalplayers) 

           
      
        } 
    } 
   
   else {

      new player = cmd_target(id,arg,6)
      if (!player) return PLUGIN_HANDLED

      set_user_health(player, hpGive)

      get_user_name(player,name2,31)
      get_user_authid(player,authid2,35)
      
   }
   
    return PLUGIN_HANDLED 
}
Оправих се :) Лок