gnashxalex Posted November 18, 2019 Share Posted November 18, 2019 (edited) I want to make this, when dont detect if ( ( getd( "$GROOM" + [email protected] ) && getcharid(2) == getd( "$GROOM" + [email protected] ) ) || ( getd( "$GROOMB" + [email protected] ) && getcharid(2) == getd( "$GROOMB" + [email protected] ) ) ) { 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 [email protected] , 0; [email protected] <= 30; set [email protected] , [email protected] + 1 ) { if ( ( getd( "$GROOM" + [email protected] ) && getcharid(2) == getd( "$GROOM" + [email protected] ) ) || ( getd( "$GROOMB" + [email protected] ) && getcharid(2) == getd( "$GROOMB" + [email protected] ) ) ) { 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 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 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...
I want to make this, when dont detect
if ( ( getd( "$GROOM" + [email protected] ) && getcharid(2) == getd( "$GROOM" + [email protected] ) ) || ( getd( "$GROOMB" + [email protected] ) && getcharid(2) == getd( "$GROOMB" + [email protected] ) ) ) {
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 [email protected] , 0; [email protected] <= 30; set [email protected] , [email protected] + 1 ) {
if ( ( getd( "$GROOM" + [email protected] ) && getcharid(2) == getd( "$GROOM" + [email protected] ) ) || ( getd( "$GROOMB" + [email protected] ) && getcharid(2) == getd( "$GROOMB" + [email protected] ) ) ) {
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