Results 1 to 4 of 4

Thread: How do add custom spawnpoints to a map?

  1. #1
    Private
    Join Date
    Apr 2020
    Posts
    61
    Thanks
    24
    Thanked 14 Times in 13 Posts

    How do add custom spawnpoints to a map?

    Hi
    As you can tell from the title i'm trying to add custom spawnpoints to a map.
    PHP Code:
        spawnpointname "mp_dm_spawn";
        
    spawnpoints getentarray(spawnpointname"classname");    

        
    spawnpoints[spawnpoints.size] = spawnStruct();
        
    spawnpoints[spawnpoints.size-1].origin = (1234 ,2068324);
        
    spawnpoints[spawnpoints.size-1].classname "mp_dm_spawn";
        
    spawnpoints[spawnpoints.size-1].angles = (03000);
        
        
    spawnpoints[spawnpoints.size] = spawnStruct();
        
    spawnpoints[spawnpoints.size-1].origin = (2262 ,2835106);
        
    spawnpoints[spawnpoints.size-1].classname "mp_dm_spawn";
        
    spawnpoints[spawnpoints.size-1].angles = (02100); 
    I want to know if this is the propper way to do it. The code above is added to mp_mapname.gsc Also if there is a way to delete spawnpoints.

    PHP Code:
    for( spawnpoints.size i++ )
    {
        if( 
    isSubStrspawnpoints[i].classname "mp_dm_spawn" ) )
            
    spawnpoints[idelete();
            

    I tried adding this before adding my custom spawn points because i wanted to see if they work but then the server skips the map and goes to the next. So i guess the spawnpoints are not added...
    Please help

  2. The Following User Says Thank You to agribilos For This Useful Post:

    kung foo man (24th March 2021)

  3. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,654
    Thanks
    17
    Thanked 996 Times in 625 Posts
    You dont get an entity using spawnstruct. Gotto spawn(), but you cant spawn something with a custom classname.

    As such, maybe try moving your existing spawnpoints? Also, you could just hijack the calls to the function that gets you a spawnpoint (spawnlogic.gsc iirc)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

    Sending me a private message makes me want to help you LESS.

  4. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    agribilos (18th March 2021),kung foo man (24th March 2021)

  5. #3
    Private
    Join Date
    Apr 2020
    Posts
    61
    Thanks
    24
    Thanked 14 Times in 13 Posts
    Hmm ok so I will try that. Thanks

  6. #4
    Private
    Join Date
    Apr 2020
    Posts
    61
    Thanks
    24
    Thanked 14 Times in 13 Posts
    Ok it worked!!! First i put all the current map spawnpoints in an array with
    PHP Code:
    level.customspawns getentarray(spawnpointname"classname"); 
    Then i added my custom spawnpoints as
    PHP Code:
    level.customspawns[level.customspawns.size] = spawnStruct();
        
    level.customspawns[level.customspawns.size-1].origin = (1234 ,2068324);
        
    level.customspawns[level.customspawns.size-1].classname "mp_dm_spawn";
        
    level.customspawns[level.customspawns.size-1].angles = (03000);
        
        
    level.customspawns[level.customspawns.size] = spawnStruct();
        
    level.customspawns[level.customspawns.size-1].origin = (2262 ,2835106);
        
    level.customspawns[level.customspawns.size-1].classname "mp_dm_spawn";
        
    level.customspawns[level.customspawns.size-1].angles = (02100); 
    In dm.gsc (or any gametype) at spawnplayer()

    PHP Code:
     if(isdefined(level.customspawns))
        
    spawnpoint maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM(level.customspawns);
        
        else
        
    spawnpoint maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM(spawnpoints); 
    Last edited by agribilos; 18th March 2021 at 21:23.

  7. The Following User Says Thank You to agribilos For This Useful Post:

    kung foo man (24th March 2021)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •