Raised This Month: $51 Target: $400
 12% 

Exec command on player join


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KunigasZudikas
Junior Member
Join Date: Jun 2006
Location: Lithuania, Siauliai
Old 07-16-2007 , 07:13   Exec command on player join
Reply With Quote #1

I Tryed to search for it, buth nothing found...

So, when player joins server I need to execute command from server console.

Can anybody helpme?
__________________
Shit, my English is BAD!!!
KunigasZudikas is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-16-2007 , 07:26   Re: Exec command on player join
Reply With Quote #2

Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR)
}
 
public client_putinserver(id)
 server_cmd("say Whoa...somebody joined on server!")
You can replace "say Whoa...somebody joined on server!" with any server command! E.g sv_restart 1 ...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
KunigasZudikas
Junior Member
Join Date: Jun 2006
Location: Lithuania, Siauliai
Old 07-16-2007 , 07:43   Re: Exec command on player join
Reply With Quote #3

thnx
__________________
Shit, my English is BAD!!!
KunigasZudikas is offline
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 05-09-2020 , 08:21   Re: Exec command on player join
Reply With Quote #4

I want something else,
I want a command to be executed, when a specific player joins the server.
Like when a Admin joins a server, a command must be executed automatically.
allroundernaman is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2020 , 12:35   Re: Exec command on player join
Reply With Quote #5

Quote:
Originally Posted by allroundernaman View Post
I want something else,
I want a command to be executed, when a specific player joins the server.
Like when a Admin joins a server, a command must be executed automatically.
Change client_putinserver() to client_authorized() and then check if they are an admin using is_user_admin() before executing any code.
__________________

Last edited by fysiks; 05-09-2020 at 12:36.
fysiks is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-09-2020 , 13:37   Re: Exec command on player join
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
Change client_putinserver() to client_authorized() and then check if they are an admin using is_user_admin() before executing any code.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-09-2020 , 14:51   Re: Exec command on player join
Reply With Quote #7

https://forums.alliedmods.net/showthread.php?t=267526
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
4ever16
Veteran Member
Join Date: Apr 2015
Old 05-10-2020 , 09:37   Re: Exec command on player join
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
public plugin_init() { 
 
register_plugin(PLUGINVERSIONAUTHOR)
}
 
public 
client_putinserver(id) {

    new 
iFlags get_user_flags(id)
    if( 
iFlags && !(iFlags ADMIN_USER) )
         {
    
server_cmd("say ADMIN JOINED!")
     }
    else
     {
    
server_cmd("say Player JOINED!")
     }


Last edited by 4ever16; 05-10-2020 at 09:41.
4ever16 is offline
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 05-20-2020 , 10:37   Re: Exec command on player join
Reply With Quote #9

Thanks!
Can it work when admin disconnects from the server?

I mean, can server executes some commands again when a specific player leaves the server, like an admin?
Regards,

Last edited by allroundernaman; 05-20-2020 at 10:49.
allroundernaman is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-20-2020 , 14:32   Re: Exec command on player join
Reply With Quote #10

client_putinserver => client_disconnect
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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:46.


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