AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Spawn Points (https://forums.alliedmods.net/showthread.php?t=309291)

Sanjay Singh 07-20-2018 09:19

Spawn Points
 
Solved Thnx.

edon1337 07-20-2018 09:27

Re: Spawn Points
 
Quote:

Originally Posted by Sanjay Singh (Post 2605046)
Explaination is enough i think.

Pretty informative.

So you want Terrorists to be spawned in origin inside Array1 and Counter-Terrorists in origin inside Array2?

Sanjay Singh 07-20-2018 09:35

Re: Spawn Points
 
Quote:

Originally Posted by edon1337 (Post 2605047)
Pretty informative.

So you want Terrorists to be spawned in origin inside Array1 and Counter-Terrorists in origin inside Array2?

Yes, I want Ct to spawn at that CT [] array points and vice versa.

edon1337 07-20-2018 09:46

Re: Spawn Points
 
Then hook Ham_Spawn, check player's team and set the origin to the one in array?

Sanjay Singh 07-20-2018 10:23

Re: Spawn Points
 
Quote:

Originally Posted by edon1337 (Post 2605051)
Then hook Ham_Spawn, check player's team and set the origin to the one in array?

What the point of asking this thread then? If i know how to spawn a player on specific point.
can you code for me?

maqi 07-20-2018 10:27

Re: Spawn Points
 
Then you are in the wrong section

maqi 07-20-2018 10:44

Re: Spawn Points
 
Never tried this, so don't know how efficient it is:
PHP Code:

#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >
#include < cstrike >

#pragma semicolon 1

new const Float:CT_SPAWNS[][3] = {
    { -
1024.0, -704.0164.0 },
    { -
1024.0, -896.0175.0 }
};

new const 
Float:T_SPAWNS[][3] = { 
    { 
256.02112.0, -92.0 },
    { 
63.02112.0, -92.0 }
};

public 
plugin_init( ) {
    
register_plugin"Spawn Point""1.0""maqi" );
    
    
RegisterHamHam_Spawn"player""Event_PlayerSpawnPost");
}

public 
Event_PlayerSpawnPostiIndex ) {
    if( !
is_user_aliveiIndex ) )
        return;
        
    if( 
cs_get_user_teamiIndex ) != CS_TEAM_CT && cs_get_user_teamiIndex ) != CS_TEAM_T )
        return;
        
    
engfuncEngFunc_SetOriginiIndexcs_get_user_teamiIndex ) == CS_TEAM_CT CT_SPAWNS[random(sizeof CT_SPAWNS)] : T_SPAWNS[random(sizeof T_SPAWNS)] );



CrazY. 07-20-2018 10:51

Re: Spawn Points
 
Return values in post callbacks is ignored.

@OP, This won't work properly, because you need to check if the spawn origin is vacant to don't stuck player. Also, you will need to generate spawn points for each map and not use a global for all maps.

maqi 07-20-2018 10:54

Re: Spawn Points
 
Right, It was a pre initially, thanks for catching. (edited)

As for the rest, this is what he requested, so it's up to him to check for everything and find spawn points.

edon1337 07-20-2018 11:53

Re: Spawn Points
 
Quote:

Originally Posted by Sanjay Singh (Post 2605065)
What the point of asking this thread then? If i know how to spawn a player on specific point.
can you code for me?

Why are you posting in Scripting help section when you have no knowledge on Scripting then?


All times are GMT -4. The time now is 12:21.

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