Raised This Month: $32 Target: $400
 8% 

Set Cvars everytime player joins


Post New Thread Reply   
 
Thread Tools Display Modes
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-27-2013 , 02:00   Re: Set Cvars everytime player joins
Reply With Quote #21

Thank you thank you thank you!!!!!!!!!!!!!!!!!!!
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**


Last edited by Jakesterdog123; 06-27-2013 at 02:05.
Jakesterdog123 is offline
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-28-2013 , 14:33   Re: Set Cvars everytime player joins
Reply With Quote #22

uh..necavi...
it seems sm_join just doesnt work no mater what i do ;-;

client cfg
sm_join #[userid]
sm_join

servercfg
sm_reloadadmins
sm_reloadadmins #[userid]

!join works in chat, sm_join works in console and chat, but the configs dont work with sm_join
why is this

it doesnt even show in console output for sm_join, nor does it write to admin_simple.ini

can you help me fix this again, and is anyone nice enough to test it out too, see if it works for u!?!?!
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**


Last edited by Jakesterdog123; 06-28-2013 at 14:34.
Jakesterdog123 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 06-28-2013 , 14:39   Re: Set Cvars everytime player joins
Reply With Quote #23

What does sm_join do?
__________________
Dr. McKay is offline
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-28-2013 , 14:43   Re: Set Cvars everytime player joins
Reply With Quote #24

Quote:
Originally Posted by Dr. McKay View Post
What does sm_join do?

Hey Dr. Mckay!

sm_join adds a client to an admin group in admin_simple.ini

btw, necavi, for now what i did is add sm_hsay to hint to users to type !join
this is another alt. for me xD
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**


Last edited by Jakesterdog123; 06-28-2013 at 14:44.
Jakesterdog123 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 06-28-2013 , 15:01   Re: Set Cvars everytime player joins
Reply With Quote #25

You'll need to use FakeClientCommand or something to run the command as the client when they join. Although that's a bit of a roundabout way of doing it.

Post the code of your sm_join plugin and it could be easily modified to do it automatically when the client joins.
__________________
Dr. McKay is offline
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-28-2013 , 15:07   Re: Set Cvars everytime player joins
Reply With Quote #26

Quote:
Originally Posted by Dr. McKay View Post
Post the code of your sm_join plugin and it could be easily modified to do it automatically when the client joins.
https://forums.alliedmods.net/showthread.php?p=1556742
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**

Jakesterdog123 is offline
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-28-2013 , 15:09   Re: Set Cvars everytime player joins
Reply With Quote #27

OMGOMGOMGOMGOMGOMG!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!
I was using my friends computer, and joined my server from his pc....
I was looking at how my server was doing...now as for my hsay...

instead of console, it started printing out Admin #8, Admin#13

so i realised THAT THE JOIN PLUGIN ADDS THE CONSOLE AS AN ADMIN --______-- IT DOESNT EVEN LOOK AT CLIENTS ..... ADSJFKLAJKFL;SDF
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**

Jakesterdog123 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 06-28-2013 , 15:46   Re: Set Cvars everytime player joins
Reply With Quote #28

This should do what you want.
Attached Files
File Type: sp Get Plugin or Get Source (join.sp - 53 views - 3.0 KB)
File Type: smx join.smx (5.4 KB, 52 views)
__________________

Last edited by Dr. McKay; 06-28-2013 at 20:07.
Dr. McKay is offline
Jakesterdog123
Senior Member
Join Date: Oct 2012
Location: California
Old 06-28-2013 , 16:07   Re: Set Cvars everytime player joins
Reply With Quote #29

Thanks McKay!!!
__________________
TF2 Server/Community - "Pony: Elements of Harmony - Squee!"
**IP - peohtf2.clanservers.com**

Jakesterdog123 is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 06-28-2013 , 16:09   Re: Set Cvars everytime player joins
Reply With Quote #30

Yeah, I realized I must've been asleep when I added the client commands, I didn't even change servercommand to client command:
PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
    
name "Spawn Commands",
    
author "necavi",
    
description "Runs a set of commands from a config whenever a player spawns.",
    
version "1.0",
    
url "http://necavi.org/"
}
new 
Handle:g_hSpawnServerCommands INVALID_HANDLE;
new 
Handle:g_hSpawnClientCommands INVALID_HANDLE;
public 
OnPluginStart()
{
    new 
String:path[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMpathsizeof(path), "configs/spawn_server_commands.cfg");
    if(
FileExists(path))
    {
        if(
g_hSpawnServerCommands != INVALID_HANDLE)
        {
            
CloseHandle(g_hSpawnServerCommands);
        }
        
g_hSpawnServerCommands CreateArray(256);
        new 
Handle:file OpenFile(path"r");
        new 
String:buffer[256];
        while(
ReadFileLine(filebuffersizeof(buffer)))
        {
            
PushArrayString(g_hSpawnServerCommandsbuffer);
        }
        
CloseHandle(file);
    }
    
BuildPath(Path_SMpathsizeof(path), "configs/spawn_client_commands.cfg");
    if(
FileExists(path))
    {
        if(
g_hSpawnClientCommands != INVALID_HANDLE)
        {
            
CloseHandle(g_hSpawnClientCommands);
        }
        
g_hSpawnClientCommands CreateArray(256);
        new 
Handle:file OpenFile(path"r");
        new 
String:buffer[256];
        while(
ReadFileLine(filebuffersizeof(buffer)))
        {
            
PushArrayString(g_hSpawnClientCommandsbuffer);
        }
        
CloseHandle(file);
    }
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
userid GetEventInt(event"userid");
    new 
client GetClientOfUserId(userid);
    if(
GetClientTeam(client) > 1)
    {
        new 
String:buffer[256];
        new 
String:szUserID[8];
        
IntToString(useridszUserIDsizeof(szUserID));
        for(new 
0GetArraySize(g_hSpawnServerCommands); i++)
        {
            
GetArrayString(g_hSpawnServerCommandsibuffersizeof(buffer));
            
ReplaceString(buffersizeof(buffer), "[userid]"szUserID);
            
ServerCommand("%s"buffer);
        }
        for(new 
0GetArraySize(g_hSpawnClientCommands); i++)
        {
            
GetArrayString(g_hSpawnClientCommandsibuffersizeof(buffer));
            
FakeClientCommand("%s"buffer);
        }
    }

</span></span>
necavi is offline
Reply


Thread Tools
Display Modes

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 23:30.


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