A little assistance
#1

Okay, so I'm working on a new gamemode that's based on Counter strike. It'll contain C4's, Defusing kits, and stuff that counter strike has.

So now I'm working on making it possible to CHANGE the map.

What does the fucking map include:

C4 plant pickups
Weapon pickups
Objects
Spawn places
Class selections
Buying area



Each map will last about 15 minutes.


Now I've set the timer and stuff, But what i really don't know is how can I make it possible for me to change the map with pickup locations, C4 plant pickup locations, objects and stuff WITHOUT rewriting a copy-paste script with just different coords.

Any help will be appreciated and your name will be added in the servers /credits list.
Reply
#2

Yeah but I'll have to copy it all, and make the new code for it. It's a slow process.

I'm planning to let the players submit maps for the server, And if this is the way it goes, It'll be really slow.


Isn't there another way around?
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
You could get one of the map loaders scripts, which can read .map files and use them to create objects. I believe there are a couple of them about.
I know that. But there'll be a few pickups too. Not just a few but many. I wanna create it like:

The main gamemode just responds to dialogs, pickups, and changes the map time by time.
And there's another file in which the C4 pickup location, buying place location and spawn locations are stored...
Reply
#4

BUUUUUUUUUUUURP
Reply
#5

Can't you just make some functions like LoadMap(mapid) and UnloadMap(mapid) that create the pickups/objects. And set a global var that stores the current mapid. Then under your callbacks check which is the current map, and go from there.

Eg,

pawn Код:
#define RACE_MAP_LS             (1)
#define DM_MAP_LV               (2)

new g_iCurrentMapID = 0;

stock LoadMap(mapid)
{
    switch(mapid)
    {
        case RACE_MAP_LS:
        {
            g_iCurrentMapID = RACE_MAP_LS;
            //load objects pickups for this map
        }
       
        case DM_MAP_LV:
        {
            g_iCurrentMapID = DM_MAP_LV;
            //load objects pickups for this map
        }
    }
}

stock UnloadMap(mapid)
{
    switch(mapid)
    {
        case RACE_MAP_LS:
        {
            g_iCurrentMapID = 0;
            //unload objects pickups for this map
        }
        //...
    }
}

public OnPlayerSpawn(playerid)
{
    switch(g_iCurrentMapID)
    {
        case RACE_MAP_LS:
        {
            //set spawn in this map
        }
        //...
    }
    return 1;
}
Reply
#6

Make all your pickup's etc in a FS and in GM just add map.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)