I am using this script and it's giving me headaches, I can't get this one part working. It's a Capture the Flag event, and at the end of the event (when 5 points are made by a team), it is suppose to go to an donpcevent label, but my mapserver keeps saying it cant find it ("CTF::OnEventGameOverClassic").
This is the part of the code that errors, the rest of the script works perfectly fine so I will not include it; it's a huge script.
Help is greatly appreciated
bat_c01,149,52,5 script Red Base::red_base 1026,{ getmapxy($@redbase$,$@redbasex,$@redbasey,1);getmapxy($@rbasetouch$,$@rbasetouchx,$@rbasetouchy,0); if (distance($@redbasex,$@redbasey,$@rbasetouchx,$@rbasetouchy) <= 2){ If (@team == 2) { if ($@flagcarrier$ == strcharinfo(0)) { movenpc "neutral_flag2",65,116; set $@nredpt, $@nredpt + 1; set #fcapt, #fcapt + 1; set fcapt, fcapt + 1; set ctfpt, ctfpt + 10; set tctfpt, tctfpt + 10; announce "The Blue Team has "+$@nbluept+" points.",bc_map; announce "The Red Team has "+$@nredpt+" points.",bc_map; set $@flaggone, 0; set $@flagcarrier$, "-"; if ($@nredpt >= 5) { mapannounce "bat_c01", "The Red Team has won the match",0; set $@nbluept, 0; set $@nredpt, 0; set $@nblueqt, 0; set $@nredqt, 0; set $@flagcarrier$, "-"; set $@nredwin, 1; donpcevent "CTF::OnEventGameOverClassic"; }} if ($@reddropped == 1) { //Return the Flag movenpc "neutral_flag",134,65; set $@redgone, 0; set $@reddropped, 0; set #freturn, #freturn + 1; set freturn, freturn + 1; announce "The Red Flag has been returned.",bc_map; }}}} bat_c01,50,131,4 script Blue Base::blue_base 1188,{ getmapxy($@bluebase$,$@bluebasex,$@bluebasey,1);getmapxy($@bbasetouch$,$@bbasetouchx,$@bbasetouchy,0); if (distance($@bluebasex,$@bluebasey,$@bbasetouchx,$@bbasetouchy) <= 2){ If (@team == 1) { if ($@flagcarrier$ == strcharinfo(0)) { movenpc "neutral_flag",134,67; set $@nbluept, $@nbluept + 1; set #fcapt, #fcapt + 1; set fcapt, fcapt + 1; set ctfpt, ctfpt + 10; set tctfpt, tctfpt + 10; announce "The Blue Team has "+$@nbluept+" points.",bc_map; announce "The Red Team has "+$@nredpt+" points.",bc_map; set $@flaggone, 0; set $@flagcarrier$, "-"; if ($@nbluept >= 5) { mapannounce "bat_c01", "The Blue Team has won the match",0; set $@nbluept, 0; set $@nredpt, 0; set $@nblueqt, 0; set $@nredqt, 0; set $@flagcarrier$, "-"; set $@nbluewin, 1; donpcevent "CTF::OnEventGameOverClassic"; } } if ($@bluedropped == 1) { //Return the Flag // movenpc "blue_flag",65,116; set $@bluegone, 0; set $@bluedropped, 0; set #freturn, #freturn + 1; set freturn, freturn + 1; announce "The Blue Flag has been returned.",bc_map; }}}} OnEventGameOverClassic:set .@classqt, getarraysize($@classic);set .@cctf, 0; over:if (.@cctf < .@classqt){ { attachrid $@classic[.@cctf]; if (@classic == 1) { if (@team == 2) { if ($@redwin == 1) { set #win, #win + 1; set win, win + 1; } if ($@bluewin == 1) { set #lose, #lose + 1; set lose, lose + 1; } } if (@team == 1) { if ($@redwin == 1) { set #lose, #lose + 1; set lose, lose + 1; } if ($@bluewin == 1) { set #win, #win + 1; set win, win + 1; } } } save originmap$, (originx), (originy); mapwarp "prt_are01","prontera",156,182; callfunc("setlook2", 6, hair); callfunc("setlook2", 7, body); set Hp, charhp; set Sp, charsp; set @playing, 0; set @classic, 0; set @heal, 0; detachrid; set .@cctf, .@cctf + 1; goto over; }}for (set .@i, 0; .@i < getarraysize($@classic); set .@i, .@i+1) { setarray $@classic[.@i], 0;}end;}
Hi Hercules! It's been a while.
I am using this script and it's giving me headaches, I can't get this one part working. It's a Capture the Flag event, and at the end of the event (when 5 points are made by a team), it is suppose to go to an donpcevent label, but my mapserver keeps saying it cant find it ("CTF::OnEventGameOverClassic").
This is the part of the code that errors, the rest of the script works perfectly fine so I will not include it; it's a huge script.
Help is greatly appreciated
Share this post
Link to post
Share on other sites