Raised This Month: $ Target: $400
 0% 

Spawn Points


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-20-2018 , 10:44   Re: Spawn Points
Reply With Quote #1

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)] );

__________________
stuff

Last edited by maqi; 07-20-2018 at 10:53.
maqi is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-20-2018 , 10:51   Re: Spawn Points
Reply With Quote #2

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.
__________________









Last edited by CrazY.; 07-20-2018 at 11:10.
CrazY. is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-20-2018 , 10:54   Re: Spawn Points
Reply With Quote #3

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.
__________________
stuff

Last edited by maqi; 07-20-2018 at 10:55.
maqi is offline
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 07-24-2018 , 02:27   Re: Spawn Points
Reply With Quote #4

r u dumb? nvm who cares. STFU
__________________
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
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 12:21.


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