Originally Posted By: michaelukz
Everything works except the alert

Code:
// Add warnings to a player
ON 5:TEXT:!warn*:#: {
  var %user = $2
  var %add = 1
  var %val = $readini( warns.ini, %user, warnings )
  writeini -n warns.ini %user warnings $calc(%val + 1)
  if (%val == $3) { msg $chan %user has had the maximum warnings! }
  elseif (%user) {
    msg $chan %user has been warned
    writeini -n warns.ini %user warnings $calc( %val + 1 )
  }
}

Its worth noting that you are setting %val before incriminating the number of warns that the person has received.

Also the if/elseif are weird. What are you actually attempting to do here?

Last edited by Belhifet; 01/02/15 07:05 PM.