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

spawn player at random place


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-09-2017 , 10:43   spawn player at random place
Reply With Quote #1

Is there any way to spawn player anywhere in map without having spawn points in map just random place
indraraj striker is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 11-09-2017 , 12:07   Re: spawn player at random place
Reply With Quote #2

Not directly by a file, but anyway you will need to get valid values of each spawn point (angle, v_angle and origin), because if you use a method such as random_float for example, to generate random values, the player may be born above, below the map, inside the wall... at last... in the wrong places.
__________________








CrazY. is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-09-2017 , 12:54   Re: spawn player at random place
Reply With Quote #3

Thanks for reply
but we can do something like check between wall, air and below the map then spawn them at ground
do you have example how to do i just want this for some round so ppl can enjoy

Last edited by indraraj striker; 11-09-2017 at 12:55.
indraraj striker is offline
imindfreak
Senior Member
Join Date: Oct 2007
Location: 127.0.0.1
Old 11-10-2017 , 00:43   Re: spawn player at random place
Reply With Quote #4

Quote:
Originally Posted by indraraj striker View Post
Thanks for reply
but we can do something like check between wall, air and below the map then spawn them at ground
do you have example how to do i just want this for some round so ppl can enjoy
CSDM has this feature and GunGame as well.
Look into those plugins and you can find an answer there.
__________________
BeastGaming Community - Map Maker & Coder.
imindfreak is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-10-2017 , 01:00   Re: spawn player at random place
Reply With Quote #5

Thanks for reply
i dont want to install csdm and gungame. I already made small plugin which is good for us as we are going to play for 5 rounds
Thanks i will check those plugin and get back here
indraraj striker is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 11-10-2017 , 04:47   Re: spawn player at random place
Reply With Quote #6

just use superspawns and ham spawn player and you will get ur answer
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 11-10-2017 , 05:21   Re: spawn player at random place
Reply With Quote #7

https://forums.alliedmods.net/attach...2&d=1161509881
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 11-10-2017 , 05:46   Re: spawn player at random place
Reply With Quote #8

should be possible but cannot be 100% reliable as some maps might have areas that are technically "habitable" but player shouldn't spawn there (under bridge in assault for example) so these are kinda hard to avoid

I think there are similar plugins out there already, but if not, you could look at the location algo for plugins like bonus box
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-10-2017 , 06:06   Re: spawn player at random place
Reply With Quote #9

Thanks D3XT3R & aron9forever for idea, i will try out
Thanks raizo11 for reply but i am looking for something else that is used to increase spawn points of map
suppose aa_dima2 has 24 spawn points only 24 players can spawn we can use map_spawn editor to increase the spawn points
Anyway thanks everyone
indraraj striker is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 11-10-2017 , 13:53   Re: spawn player at random place
Reply With Quote #10

So i tried as DEXTER suggested me to check superspawns
but its not working/spawning at random place what could be issue \? check below code
Link to superspawns : https://forums.alliedmods.net/showthread.php?t=132500
PHP Code:

#include <amxmodx>
#include <hamsandwich>
#include <superspawns>

public plugin_init()
{
    
// First we have to initialize the arrays and parameters
    // The value 3500.0 is the minimum distance between points
    // Nearest points will be found, but GetOrigin will erase points
    // with less than 3500.0 distance with other used points and return
    
SsInit(3500.0)

    
// Let start scanning the map
        
SsScan()

    
// This call is to dump on server logs the origins found
        
SsDump()

    
// This command will call GetOrigin() to get a new location, then spawn a model (is't just an example)
        
register_clcmd("say /spawn""spawnent")
}

public 
spawnent(id)
{
        new 
Float:origin[3]

    
// SsGetOrigin() will return true if useful location was found
    // will return false if there's no more usefull locations

        
if(SsGetOrigin(origin))
        {
                new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
                if(
pev_valid(ent))
                {
                        
ExecuteHamB(Ham_CS_RoundRespawn,id)     
                        
engfunc(EngFunc_SetOriginentorigin)
                }
        }
        else
        {
                
server_print("No more locations")
        }

        return 
PLUGIN_HANDLED

Also i tried this one
same result

PHP Code:
 new Float:origin[3]
 if(
SsGetOrigin(origin))
        {
ExecuteHamB(Ham_CS_RoundRespawn,id


Last edited by indraraj striker; 11-10-2017 at 14:00.
indraraj striker is offline
Reply



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 19:03.


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