Jump to content
  • 0

Help with Script


gnashxalex

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   1
  • Joined:  08/19/18
  • Last Seen:  

I want to make this, when dont detect 
if ( ( getd( "$GROOM" + .@i ) && getcharid(2) == getd( "$GROOM" + .@i ) ) || ( getd( "$GROOMB" + .@i ) && getcharid(2) == getd( "$GROOMB" + .@i ) ) ) {    
do else dispbottom "your guild dont have a guild house"

im trying this but dont work

 

-    script    script_gh    -1,{
OnAtCmd:
    if(getmapflag(strcharinfo(3),mf_town)){
    for( set .@i , 0; .@i <= 30; set .@i , .@i + 1 ) {
        if ( ( getd( "$GROOM" + .@i ) && getcharid(2) == getd( "$GROOM" + .@i ) ) || ( getd( "$GROOMB" + .@i ) && getcharid(2) == getd( "$GROOMB" + .@i ) ) ) {    
                warp "sanctum",56,61;
                            end;
    else{
    dispbottom "Your guild does not own a room";
    end;
        } 
    }

    OnInit:
        bindatcmd("guildhouse","script_gh::OnAtCmd");
        end;
    }

}
    
 

Edited by gnashxalex
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

@gnashxalex

-    script    script_gh    -1,{
OnAtCmd:
	.@gid = getcharid(2);
	if( !getmapflag(strcharinfo(3),mf_town)) {
		dispbottom "@"+.@atcmd_command$+" failed. Can only be used in towns.", 0xff0000;
		end;
	}
	for( .@i = 0; .@i <= 30; .@i++ )
		if ( getd( "$GROOM" + .@i ) == .@gid || getd( "$GROOMB" + .@i ) == .@gid )
			.@owned++; // Checks if owns a guild room..
	if ( .@owned )
		warp "sanctum",56,61;
	else
		dispbottom "Your guild does not own a room";
	end;

OnInit:
	bindatcmd("guildhouse",strnpcinfo(0)+"::OnAtCmd");
}

You should have checked your mapserver. It will tell you your problem.

Your original code has missing curlys just by the look of it.

Edited by Mabuhay
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  52
  • Reputation:   1
  • Joined:  08/19/18
  • Last Seen:  

2 hours ago, Mabuhay said:

@gnashxalex


-    script    script_gh    -1,{
OnAtCmd:
	.@gid = getcharid(2);
	if( !getmapflag(strcharinfo(3),mf_town)) {
		dispbottom "@"+.@atcmd_command$+" failed. Can only be used in towns.", 0xff0000;
		end;
	}
	for( .@i = 0; .@i <= 30; .@i++ )
		if ( getd( "$GROOM" + .@i ) == .@gid || getd( "$GROOMB" + .@i ) == .@gid )
			.@owned++; // Checks if owns a guild room..
	if ( .@owned )
		warp "sanctum",56,61;
	else
		dispbottom "Your guild does not own a room";
	end;

OnInit:
	bindatcmd("guildhouse",strnpcinfo(0)+"::OnAtCmd");
}

You should have checked your mapserver. It will tell you your problem.

Your original code has missing curlys just by the look of it.

It works perfectly. next time I will see the mapserver, thank you very much.

Edited by gnashxalex
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...