gnashxalex Posted November 18, 2019 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 52 Reputation: 1 Joined: 08/19/18 Last Seen: February 23, 2021 Share Posted November 18, 2019 (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 November 18, 2019 by gnashxalex Quote Link to comment Share on other sites More sharing options...
1 Mabuhay Posted November 18, 2019 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 446 Reputation: 232 Joined: 03/20/12 Last Seen: October 22, 2020 Share Posted November 18, 2019 (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 November 18, 2019 by Mabuhay Quote Link to comment Share on other sites More sharing options...
0 gnashxalex Posted November 18, 2019 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 52 Reputation: 1 Joined: 08/19/18 Last Seen: February 23, 2021 Author Share Posted November 18, 2019 (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 November 18, 2019 by gnashxalex Quote Link to comment Share on other sites More sharing options...
Question
gnashxalex
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 gnashxalexLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.