Raised This Month: $ Target: $400
 0% 

A plugin that execute commands when...


Post New Thread Reply   
 
Thread Tools Display Modes
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 07-28-2009 , 22:40   Re: A plugin that execute commands when...
Reply With Quote #11

I thought I was pretty clear. I wanted a plugin that executed commands when a specific steamid joined. Not just sm_say.... That was just an example. Whenever I said 'something I could use commands in also, like sm_colorize and sm_beacon'...

Let me try and be a little clearer. This is what I want to have setup.

The plugin loads a special config file full of steamids and several different commands specific to those steamids to perform when those steamids join the game.

Player 1 has a steam id that is in the config file. The config file section would look like this for player 1.

STEAMID 0:013296516
{
"onconnect" "sm_slay @all, sm_say HERE HE COMES, THE BRINGER OF DEATH"
}

And so when this player connects, everyone will get slayed, and there will be a message in the chatbox saying "HERE HE COMES, THE BRINGER OF DEATH". But thats not all...

Player 2 joins (his STEAMID is also in the config file. He is an admin) His section of the config file looks like

STEAMID 0:116565666
{
"onconnect" "sm_hsay Admin Jimmy James has joined"
"ondisconnect" "sm_hsay Admin Jimmy James has left"
}

And Player3 joins, who isnt an admin but just a regular that one of the admins has added their steamID to the config file.

STEAMID 0:65659495
{
"onconnect" "sm_csay Watch out for this guy!"
"onplayerspawn" "sm_blind $ 255, sm_csay $ has been blinded for his first life for being too good."
"ondisconnect" sm_csay Finally he's gone"
}

Where $ is a placeholder for the player's name. These are just examples. Please do not make actual plugins that do only these commands. The idea is that I can write in commands(any command from any plugin on the server) in the config file and the server will execute them when those specific players join.

I dunno if its asking alot, but I would think that people would have already something like this for donators or special regulars.
__________________
MrSaturn is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 07-29-2009 , 16:00   Re: A plugin that execute commands when...
Reply With Quote #12

Oh, that sounds simple enough, but I haven't messed with keyvalues yet so I won't be of any use xD
Dragonshadow is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 07-30-2009 , 19:14   Re: A plugin that execute commands when...
Reply With Quote #13

I can deal with the kvfiles and the server commands.

What will be a problem is the "events" that you want. Some of these events would need to be hardcoded. For example...

onconnect -> tied to -> OnClientPostAdminCheck()
ondisconnect -> tied to -> OnClientDisconnect()
etc.

Those phrases and events that they are tied to would need to be hardcoded.

However, you could create some dynamic hooks in another kvfile if you wanted to hook game events instead. For example...

onplayerspawn -> tied to -> Hookevent("player_spawn", ....)

You could add additional events, but each event would require a phrase and the event tied to each other.

So what is needed is a list from you of all the events and phrases tied to them so the ones that had to be hardcoded were included, and the dynamic events created and tested.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 07-30-2009 , 19:31   Re: A plugin that execute commands when...
Reply With Quote #14

Quote:
Originally Posted by Antithasys View Post
I can deal with the kvfiles and the server commands.

What will be a problem is the "events" that you want. Some of these events would need to be hardcoded. For example...

onconnect -> tied to -> OnClientPostAdminCheck()
ondisconnect -> tied to -> OnClientDisconnect()
etc.

Those phrases and events that they are tied to would need to be hardcoded.

However, you could create some dynamic hooks in another kvfile if you wanted to hook game events instead. For example...

onplayerspawn -> tied to -> Hookevent("player_spawn", ....)

You could add additional events, but each event would require a phrase and the event tied to each other.

So what is needed is a list from you of all the events and phrases tied to them so the ones that had to be hardcoded were included, and the dynamic events created and tested.
tbh I think I would be happy with just player_spawn as the only event. You dont even have to add phrases to it. But is there a way to make it only happen the first time they spawn when they join the server?
__________________
MrSaturn 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 03:12.


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