gnashxalex Posted November 18, 2019 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
1 Mabuhay Posted November 18, 2019 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
0 gnashxalex Posted November 18, 2019 Author 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
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 gnashxalex2 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.