help with script pvp room official

IndieRO

New member
Messages
287
Points
0
Age
34
Location
Indonesia
Discord
RagnaIDN#7960
Emulator
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;
}
 
This code announces the character's name when they enter the map. It checks the name of your map using the strcharinfo(3) function.

Code:
OnPCLoadMapEvent:
if (strcharinfo(3) == "ENTER YOUR MAP HERE") {
mapannounce "ENTER YOUR MAP NAME HERE","" + strcharinfo(0) + " joined the map!",0;
}
end;
 
where should I put your code to my script??
can you help me
 
 
 
This code announces the character's name when they enter the map. It checks the name of your map using the strcharinfo(3) function.

Code:
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
 
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?)

 
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...

 
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 ???

 
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.

 
Back
Top