Jump to content
  • 0
IndieRO

help with script pvp room official

Question

how to make announce when player get in pvp map

 

this is official script

function    script    F_PVP_FSRS    {
    if (getargcount()) {
        if (BaseLevel < getarg(0) || BaseLevel > getarg(1)) {
            mes "[PVP Fight Square Reception Staff]";
            mes "Sorry, but you base level has to be between LV "+getarg(0)+" and LV "+getarg(1)+".";
            close;
        }
    }
    if (strnpcinfo(4) == "pvp_y_room") {
        .@base$ = "pvp_y_"+strnpcinfo(2);

        setarray .@maps$[0],    .@base$+"-1",    .@base$+"-2",    .@base$+"-3",    .@base$+"-4",    .@base$+"-5";
        setarray .@name$[0],    "Prontera",        "Izlude",        "Payon",        "Alberta",        "Morroc";
        setarray .@Limit[0],    128,            128,            128,            128,            128;

    } else {
        setarray .@maps$[0],    "pvp_n_8-1",    "pvp_n_8-2",    "pvp_n_8-3",    "pvp_n_8-4",    "pvp_n_8-5";
        setarray .@name$[0],    "Sandwich",        "Lock on",        "Four Room",    "Under cross",    "Compass Room";
        setarray .@Limit[0],    64,                32,                32,                32,                32;
    }
    for (.@i = 0; .@i<5; ++.@i)
        .@menu$ += .@name$[.@i]+" ["+getmapusers(.@maps$[.@i])+" / "+.@Limit[.@i]+"]:";
    .@menu$ += "Cancel.";
    .@i = select(.@menu$)-1;
    if (.@i == 5) close;
    if (getmapusers(.@maps$[.@i]) >= .@Limit[.@i]) {
        mes "[PVP Fight Square Reception Staff]";
        mes "This map is currently full.";
        close;
    }
    
    warp .@maps$[.@i],0,0;
    end;
}

 

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

This code announces the character's name when they enter the map. It checks the name of your map using the strcharinfo(3) function.

 

OnPCLoadMapEvent:
if (strcharinfo(3) == "ENTER YOUR MAP HERE") {
mapannounce "ENTER YOUR MAP NAME HERE","" + strcharinfo(0) + " joined the map!",0;
}
end;

Share this post


Link to post
Share on other sites
  • 0

This code announces the character's name when they enter the map. It checks the name of your map using the strcharinfo(3) function.

 

OnPCLoadMapEvent:
if (strcharinfo(3) == "ENTER YOUR MAP HERE") {
mapannounce "ENTER YOUR MAP NAME HERE","" + strcharinfo(0) + " joined the map!",0;
}
end;
For OnPCLoadMapEvent to trigger, the map should have loadevent mapflag too

Share this post


Link to post
Share on other sites
  • 0

 

This code announces the character's name when they enter the map. It checks the name of your map using the strcharinfo(3) function.

OnPCLoadMapEvent:
if (strcharinfo(3) == "ENTER YOUR MAP HERE") {
mapannounce "ENTER YOUR MAP NAME HERE","" + strcharinfo(0) + " joined the map!",0;
}
end;
For OnPCLoadMapEvent to trigger, the map should have loadevent mapflag too

Is that true? Cause I got mine to load without it @_@ what exactly does that mapflag do (and where can I read up on it?)

Share this post


Link to post
Share on other sites
  • 0

OnPCLoadMapEvent:

This special label will trigger once a player steps in a map marked with 
the 'loadevent' mapflag and attach its RID. The fact that this label 
requires a mapflag for it to work is because, otherwise, it'd be 
server-wide and trigger every time a player would change maps. Imagine the 
server load with 1,000 players (oh the pain...)

Only the special labels which are not associated with any script command 
are listed here. There are other kinds of labels which may be triggered in 
a similar manner, but they are described with their associated commands.
https://raw.githubusercontent.com/HerculesWS/Hercules/master/doc/script_commands.txt

 

That mapflag is specially for that label

Maybe your script doesn't need it because it dynamically sets the flag by setmapflag script command...

Share this post


Link to post
Share on other sites
  • 0

 

OnPCLoadMapEvent:

This special label will trigger once a player steps in a map marked with 
the 'loadevent' mapflag and attach its RID. The fact that this label 
requires a mapflag for it to work is because, otherwise, it'd be 
server-wide and trigger every time a player would change maps. Imagine the 
server load with 1,000 players (oh the pain...)

Only the special labels which are not associated with any script command 
are listed here. There are other kinds of labels which may be triggered in 
a similar manner, but they are described with their associated commands.
https://raw.githubusercontent.com/HerculesWS/Hercules/master/doc/script_commands.txt

 

That mapflag is specially for that label

Maybe your script doesn't need it because it dynamically sets the flag by setmapflag script command...

so @dastgir can u help me ???

Share this post


Link to post
Share on other sites
  • 0

Well it can also be that the mapflag as already been added somewhere else. It often occures when you use several custom scripts.

@melv0, add "map_name<tab>mapflag<tab>loadevent" on first or last line of your script.

 

Then, add the script section:

OnPCLoadMapEvent:
if (strcharinfo(3) == "ENTER YOUR MAP HERE") {
mapannounce "ENTER YOUR MAP NAME HERE","" + strcharinfo(0) + " joined the map!",0;
}
end;

just before the last "}" as "True Zeal" told.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.