Jump to content
  • 0

Not giving you a prize.


karazu

Question


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   5
  • Joined:  03/09/12
  • Last Seen:  

Please help me with this.

after the event/BG it will not give you a prize.


This is the script


DRAW,TEAM A or B wins it will not give you.

 

 

OnTimer190000:
    if(.point[1]>.point[2]){
        set .bg_id_w,$@bg_id_a;
        Announce "[Battle Ground]:Team A Win!",0;
    }else if(.point[2]>.point[1]){
        set .bg_id_w,$@bg_id_b;
        Announce "[Battle Ground]:Team B Win!",0;
    }else{
        set .bg_id_w,-1;
        Announce "[Battle Ground]:Draw!",0;
    }
    for( set .@i,1; .playerid[.@i]; set .@i,.@i+1 ){
        if( attachrid(.playerid[.@i]) ){    //Prize if Team A win
            if(.bg_id_w == -1){ getitem 605,1;} //If Match Draws
            else if( getcharid(4) == .bg_id_w ) { getitem 605,1;} //If Someone Wins
        }
    }
 
 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  39
  • Reputation:   2
  • Joined:  08/19/12
  • Last Seen:  

Are you sure that you're syntax of your for()-loop is right?

for( set .@i,1; ..playerid[.@i]; set .@i,.@i+1 ){

[/quote

as you can the in the marked part there is not really a statement telling the loop how long it should repeat.

It might be working, what I actually do not know because the athena-script-language is a bit weird and sometimes quite simple, so I would find it weird, if this would work.

If it's like PHP it might be working if it interprets that you're just asking if this var has a value, so returning true. and as long as this statement returns true the for-loop should work.

 

But to be safe just try this:

 

for( set .@i,1; getarraysize(.playerid[.@i]) < .@i; set .@i,.@i+1 ){
Edited by skyleo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   5
  • Joined:  03/09/12
  • Last Seen:  

Thank you for that.

I will try this one.

 

 

 

Are you sure that you're syntax of your for()-loop is right?

for( set .@i,1; ..playerid[.@i]; set .@i,.@i+1 ){

[/quote

as you can the in the marked part there is not really a statement telling the loop how long it should repeat.

It might be working, what I actually do not know because the athena-script-language is a bit weird and sometimes quite simple, so I would find it weird, if this would work.

If it's like PHP it might be working if it interprets that you're just asking if this var has a value, so returning true. and as long as this statement returns true the for-loop should work.

 

But to be safe just try this:

 

for( set .@i,1; getarraysize(.playerid[.@i]) < .@i; set .@i,.@i+1 ){

Hello  Still did not work.

 

 

It will only announce and will not give prize..


Hello Lets just continue the discussion fixing here:
 

 

http://rathena.org/board/topic/88645-custom-battle-ground-by-goddammit-not-properly-working/
 

Thank you

Edited by karazu
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...