Raised This Month: $12 Target: $400
 3% 

Solved [Maps ] Spawn Bosses


Post New Thread Reply   
 
Thread Tools Display Modes
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-21-2020 , 08:33   Re: [Maps ] Spawn Bosses
Reply With Quote #11

The equal() function is case-sensitive and returns whether string 1 is EXACTLY equal to string 2.
Code:
fo() {     equal("de_dust2", "de_dust2") // the two strings are equal (true)     equal("de_dust2", "dust2") // the strings are different (false)     equal("de_dust2", "De_Dust2") // the strings are different (false) }


The equali() function is case-insensitive and returns whether string 1 is equal to string 2 with case ignoring.
Code:
fo() {     equali("de_dust2", "de_dust2") // the two strings are equal (true)     equali("de_dust2", "dust2") // the strings are different (false)     equali("de_dust2", "De_Dust2") // the two strings are equal (true) }


The contain() function is case-sensitive and finds the position of a string inside another string.
Code:
fo() {     contain("de_dust2", "de_dust2") // substring is inside string (> -1)     contain("de_dust2", "dust2") // substring is inside string (> -1)     contain("de_dust2", "De_Dust2") // substring IS NOT inside string (-1) }


The containi() function is case-insensitive and finds the position of a string inside another string with case ignoring.
Code:
fo() {     containi("de_dust2", "de_dust2") // substring is inside string (> -1)     containi("de_dust2", "dust2") // substring is inside string (> -1)     containi("de_dust2", "De_Dust2") // substring is inside string (> -1) }

Knowing this you should already have a guess about which function you should use in your specific case.
Check out "AMX Mod X Scripting API Reference".



@supertrio17, sorry but I have to agree with what fysiks told you.
Quote:
Originally Posted by fysiks View Post
I think you're getting a little carried away with trying to help. You need a lot more experience to be answer these type of questions. So, at the very least, you should test your suggestions before you post them.
__________________









Last edited by CrazY.; 06-21-2020 at 08:58.
CrazY. is offline
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 06-21-2020 , 08:40   Re: [Maps ] Spawn Bosses
Reply With Quote #12

Quote:
Originally Posted by Foxa View Post
What are the exact map names? I'm pretty sure that there aren't maps named "Alien", "Revenant" and "Titan"..
Maybe "boss_alien", "boss_revenant" and "boss_titan"??
Also how are you getting the "mapname"?
I renamed maps according to boss names


Maybe I should use the Boss plugin download on a specific map like this?
But it still doesn’t work .
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < engine >
#include < fakemeta >
#include < hamsandwich >

#define MAP_ALIEN       "Alien"
#define MAP_REVENANT    "Revenant"
#define MAP_TITAN       "Titan"

new Array:BossMap

public plugin_precache() 
{
    
BossMap ArrayCreate(128)
    
    if(
is_plugin_loaded("boss_alien.amxx"true) != -1ArrayPushString(BossMapMAP_ALIEN)
    if(
is_plugin_loaded("boss_revenant.amxx"true) != -1ArrayPushString(BossMapMAP_REVENANT)
    if(
is_plugin_loaded("boss_titan.amxx"true) != -1ArrayPushString(BossMapMAP_TITAN)

MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-21-2020 , 08:51   Re: [Maps ] Spawn Bosses
Reply With Quote #13

You can simple load specific plugins per map with one of the features of amxmodx.
Everything you need to know is here
__________________









Last edited by CrazY.; 06-21-2020 at 08:51.
CrazY. is offline
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 06-21-2020 , 08:57   Re: [Maps ] Spawn Bosses
Reply With Quote #14

Quote:
Originally Posted by CrazY. View Post
You can simple load specific plugins per map with one of the features of amxmodx.
Everything you need to know is here
Unfortunately, this option for loading plugins is not suitable for me.
I need just such an implementation
MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-21-2020 , 09:06   Re: [Maps ] Spawn Bosses
Reply With Quote #15

With only pieces of code there's not much we can do to help you.
Try debugging the value that is stored in the "mapname" variable and check if the value of the "y_spawn_points" variable is not being changed elsewhere
__________________









Last edited by CrazY.; 06-21-2020 at 09:10.
CrazY. is offline
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-21-2020 , 12:53   Re: [Maps ] Spawn Bosses
Reply With Quote #16

Quote:
Originally Posted by HamletEagle View Post
You didn't, as your code does not even compile.

if(g_mapname) is wrong because g_mapname is an array, you probably meant g_mapname[0](to check if the string is not empty).
switch(g_mapname) switch cannot be used on strings.
case Alien: Alien is not a string, "Alien" is(unless you defined somewhere new Allien[] = "Alien", which you probably did not, and if you did you should have posted this in your answer). Alien, as you used it in your code, is an unknown symbol and will produce a compilation error.
Regardless, the code you posted will not compile because of issues 1 and 2 anyway.

A simple test plugin:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    new array[
32]
    if(array)
    {
        switch(array)
        {
            case 
"aaa"
            {
            }
            case 
"bbb":
            {
            }
        }
    }

Can you compile it? You can't because it is not valid.

Please test your code before posting and trying to help others so you don't end up confusing them instead.
Sorry for letting you down, I compiled the wrong plugin. I was sure that it should work .
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
MayroN
Senior Member
Join Date: Aug 2017
Location: Kyiv
Old 06-22-2020 , 20:23   Re: [Maps ] Spawn Bosses
Reply With Quote #17

Decision
PHP Code:
#define MAP "Alien"

new mapname[31]

public 
plugin_init()
{
    
get_mapname(mapname,31)
    if(!
equali(mapnameMAP)) return
}

public 
plugin_precache()
{
    
y_spawn_points[0] = 138.0
    y_spawn_points
[1] = -263.0 
    y_spawn_points
[2] = 36.0 

MayroN is offline
Send a message via ICQ to MayroN Send a message via Skype™ to MayroN
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:23.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode