Jump to content
  • 0

Question

Posted (edited)

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

2 answers to this question

Recommended Posts

  • 1
Posted (edited)

@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
  • 0
Posted (edited)
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...