You need to use trainerbattle
0x1 so the script continues straight after winning the battle.
Like in Diego's example script for a Gym Leader:
Code:
#dynamic 0x800000
#org @start
lock
faceplayer
checkflag 0x820
if 0x1 goto @done
msgbox @2 0x6
trainerbattle 0x1 0x001 0x0 @before @after @later
end
#org @before
= Show me what ya got!
#org @after
= What the-?
#org @later
msgbox @3 0x6
fanfare 0x13E
msgbox @4 0x4
waitfanfare
closeonkeypress
msgbox @5 0x6
giveitem 0x147 0x1
setflag 0x820
release
end
#org @done
msgbox @1 0x6
release
end
#org @1
= You should travel to Cerulean City\nto get your next badge.
#org @2
= Welcome to Pewter City Gym.\nYou want to challenge me?
#org @3
= Congratulations!\pFor beating me, you get\nthis badge!
#org @4
= \v\h01 recieved a badge!
#org @5
= Oh, and please take this.
You don't script warps tiles - that part has nothing to do with this tutorial. The warp diego used is as part of a script, whilst you're looking at warp tiles. The [W]s in A-Map simply go on a door (or by stairs, etc.) and will automatically warp you when you move in the correct manner. The warp you have a picture of takes you to Map 3,0 - Warp 0. Which should be Pallet Town. Change the numbers to change where it goes.