• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Our friends from the Johto Times are hosting a favorite Pokémon poll - and we'd love for you to participate! Click here for information on how to vote for your favorites!
  • Akari, Selene, Mint, Solana - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Removing a registered Person in the phone

  • 66
    Posts
    12
    Years
    • Seen Nov 12, 2023
    Hello everybody,

    how I can remove a registered Person from the phone? Expecially the special contacts.

    Is it a new def-section like:
    def PhoneRemove(name)
    [scripts]
    end

    How can I do it?
     

    He said from the phone, the correct script is pbPhoneDeleteContact(index) even though I haven't tested it.

    EDIT Indeed I did test it and it was incomplete.
    What you need to do is create a new section of code in the script "PScreen_Phone" and paste this:

    Code:
    def pbPhoneDeleteNPC(ident,name,mapid,showmessage=true) #edited by Telemetius
      if !$PokemonGlobal.phoneNumbers
        $PokemonGlobal.phoneNumbers=[]
      end
      exists=pbFindPhoneTrainer(ident,name)
      if exists
          exists[0]=false
      else
        phonenum=[]
        phonenum.push(false)  
        phonenum.push(ident)
        phonenum.push(name) 
        phonenum.push(mapid)
      end
      $PokemonGlobal.phoneNumbers.delete(phonenum)
    end
    end

    Eg. if you registered prof Oak with this script call:

    Code:
    pbPhoneRegisterNPC(1,"Professor Oak",4)

    Then paste this in an event as a script call to delete his number:

    Code:
    pbPhoneDeleteNPC(1,"Professor Oak",4)

    Let me know if you find any problems.
     
    Last edited:
    Back
    Top