View Single Post
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 11-16-2008 , 11:29   Re: [TUT/INFO] Condition operator aka ? and :
Reply With Quote #25

Quote:
Originally Posted by jaaaalot View Post
PHP Code:
new bm str_to_num(arg)
 
 if(
bm == 0)
 {
  if(
get_pcvar_num(quiet) == 2)
  {
  
unpause("ac","hnk_bannedmaps.amxx")
  } 
  else
  {
   new 
name[32]
   
get_user_name(id,name,31)
   
unpause("ac""hnk_bannedmaps.amxx")
   
ColorChat(0,RED,"^x04[hnk]^x03 %s :^x01 enabled bannedmaps",get_pcvar_num(quiet) == name "ADMIN")
  }
 } 
work like this too?
You got the idea. The main use of the ternary operator is changing arguments passed to the function without writing the function+arguments two or more times.
__________________

Community / No support through PM
danielkza is offline