Raised This Month: $ Target: $400
 0% 

Prevent spawning on second connect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-08-2012 , 07:14   Prevent spawning on second connect
Reply With Quote #1

How can i prevent the game from spawning a person when he joins the server a second time and more in the same map?

PHP Code:
public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Pre"1);
}
 
public 
client_connect(id)
{
    
g_iPlayed[id]++;
}
 
public 
Fwd_PlayerSpawn_Pre(id)
{
     if(
g_iPlayed >=2)
         return 
PLUGIN_HANDLED;

will this work or do i have to silentkill the user after he spawned?
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-08-2012 at 08:31.
striker07 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-08-2012 , 08:52   Re: Prevent spawning on second connect
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <fakemeta>

//#define RESET_ON_NEW_ROUND

new Trie:SteamIds;

public 
plugin_init()
{
#if defined RESET_ON_NEW_ROUND
    
register_event("HLTV""OnHltv""a""1=0""2=0");
#endif

    
SteamIds TrieCreate();
}

public 
plugin_end()
    
TrieDestroy(SteamIds);

public 
client_putinserver(client)
{
    new 
steamId[35];
    
get_user_authid(clientsteamIdcharsmax(steamId));
    
    if (
TrieKeyExists(SteamIdssteamId))
        
set_pdata_int(client3651);
    else
        
TrieSetCell(SteamIdssteamIdtrue);
}

#if defined RESET_ON_NEW_ROUND
public OnHltv()
    
TrieClear(SteamIds);
#endif 
hleV is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 08-08-2012 , 12:33   Re: Prevent spawning on second connect
Reply With Quote #3

thanks alot
gj
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 08-08-2012 at 18:11.
striker07 is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 01-02-2014 , 13:47   Re: Prevent spawning on second connect
Reply With Quote #4

How can i allow players that joined the server, immediatly spawn the first time they are connecting since the map started.
using this code so that when there are connecting a second time during the same map they wont be spawned
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]
striker07 is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-02-2014 , 13:58   Re: Prevent spawning on second connect
Reply With Quote #5

try to uncomment the define
Backstabnoob is offline
striker07
Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
Old 01-02-2014 , 17:46   Re: Prevent spawning on second connect
Reply With Quote #6

nono, this function was made for when the server has the function i actually need.
I need to let players spawn into the game after they chose their team after they joined the game for the first time since the start of the map
__________________

Working on:
[CSGO/CSS] Mmorpg - an extensive XP/level modulair platform
Progress: [♣♣♣♣♣♣♣|♣♣♣]

Last edited by striker07; 01-02-2014 at 17:50.
striker07 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 05:48.


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