Raised This Month: $ Target: $400
 0% 

[TF2] Plugin that sends command when player spawns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
misak1717
Junior Member
Join Date: May 2013
Old 01-14-2014 , 14:07   [TF2] Plugin that sends command when player spawns
Reply With Quote #1

Hello, as name of topic says, I need plugin that will send command as player/as server everytime player join server and spawns. Please post script here, I will edit command myself, thanks
misak1717 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-14-2014 , 14:38   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #2

need more information maing.
__________________
View my Plugins | Donate
TnTSCS is offline
misak1717
Junior Member
Join Date: May 2013
Old 01-14-2014 , 15:40   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #3

I want a script that will do a command as server (or as player, if possible) when he joins game (after he spawn)
misak1717 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-14-2014 , 16:11   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #4

Ok, define "a command" - the reason I ask is that maybe what you're requesting isn't possible, but since you didn't specify what command, here you go:

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
<= client <= MaxClients)
    {
        
// Command goes here
    
}

You also didn't say if you only want the command to execute once per client session, once per map, or every spawn...
__________________
View my Plugins | Donate

Last edited by TnTSCS; 01-14-2014 at 16:12.
TnTSCS is offline
misak1717
Junior Member
Join Date: May 2013
Old 01-15-2014 , 10:51   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #5

Sorry, im new to this so:
- How do I write command in space where is "// Command goes here" ? just write something like sm_admin ?
- Once per client session
- If I want more commands to add, what can I do?
misak1717 is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 01-15-2014 , 13:51   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #6

Are you requesting help with scripting, or requesting something be made for you?
__________________
View my Plugins | Donate
TnTSCS is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-15-2014 , 14:09   Re: [TF2] Plugin that sends command when player spawns
Reply With Quote #7

here, i added comments to explain what it does. hope it helps
Attached Files
File Type: sp Get Plugin or Get Source (cmdonspawn.sp - 451 views - 1.7 KB)
Mitchell 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 21:28.


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