Raised This Month: $ Target: $400
 0% 

trigger on steamID connect.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 21:45   trigger on steamID connect.
Reply With Quote #1

Well this is a script by Bigballer but I want to rebuild it so that it only sais things when a certain people connect (like admin) it needs to be triggered by steamID but because of my lack of small-language I dont really know what to do

Code:
/* Admin join/leave message béta 1 by h4ns This lets the players now when admin is connected or disconnected to the server. Just upload this into your amxx/plugins folder add admin_ann.amxx in your amxx/plugins.ini Restart server or changemap AND ENJOY! Special thanks to BigBaller for the original script. */ #include <amxmodx> public plugin_init() {   register_plugin("Admin join/Leave Message", "beta 1","h4ns")   register_cvar("amx_join_message", "Beware %name% is connecting!")   register_cvar("amx_joined_message", "O NO! %name% is here!"   register_cvar("amx_leave_message", "Finally %name% is gone!") } public client_connect(id){     new user[32], len     user[0] = id     len = get_user_name(id,user[1],31)     set_task(2.0, "join_msg", 0, user,len + 2)     return PLUGIN_CONTINUE } public client_putinserver(id){     new user[32], len     user[0] = id     len = get_user_name(id,user[1],31)     set_task(2.0, "joined_msg", 0, user, len + 2)     return PLUGIN_CONTINUE } public client_disconnect(id){     new user[32], len     user[0] = id     len = get_user_name(id, user[1], 31)     set_task(2.0, "leave_msg", 0, user, len + 2) } public join_msg(user[]) {     if (get_cvar_num("amx_join_leave")==0){     return PLUGIN_HANDLED     }     if (get_cvar_num("amx_join_leave")==1){     new message[192]     get_cvar_string("amx_join_message", message, 191)     replace(message, 191, é%name", user[1])     set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)     show_hudmessage(0, message)     return PLUGIN_CONTINUE     }     return PLUGIN CONTINUE } public joined_msg(user[]) {         if (get_cvar_num("amx_join_leave")==0){         return PLUGIN_HANDLED         }     if (get_cvar_num("amx_join_leave")==1){     new message[192]     get_cvar_string("amx_joined_message", message, 191)     replace(message, 191, "%name%", user[1])     set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)     show_hudmessage(0, message)     return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE } public leave_msg(user[]) {         if (get_cvar_num("amx_join_leave")==0){         return PLUGIN_HANDLED         }     if (get_cvar_num("amx_join_leave")==1){     new message[192]     get_cvar_string("amx_leave_message", message, 191)     replace(message, 191, "%name%", user[1])     set_hudmessage(0, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)     show_hudmessage(0, message)     return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }

That whas the smallcode if u can tell me what to change to get it working, that would be great. ONCE AGAIN: NEEDS TO BE TRIGGERED BY STEAMID ONLY!!! (so only if steamid 0_0:54684 connects)=>[EXAMPLE]
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 21:58  
Reply With Quote #2

Code:
new authID[33] get_user_authid(id,authID,32) if (authID) {     // .. }


Also, judging by all of the red in your code, that can't be good!
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 22:03  
Reply With Quote #3

Quote:
if (authID) {
// ..
}
should the steam id's be placed before the //?

and im looking into that red part.
h4ns is offline
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 22:10  
Reply With Quote #4

Code:
#include <amxmodx> public plugin_init() { new authID[33] get_user_authid(id,authID,32) if (authID) { STEAM_0:1:3229563    // h4ns } if   register_plugin("Admin join/Leave Message", "beta 1","h4ns")   register_cvar("amx_join_message", "Beware %name% is connecting!")   register_cvar("amx_joined_message", "O NO! %name% is here!"   register_cvar("amx_leave_message", "Finally %name% is gone!") }

like that?
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 22:17  
Reply With Quote #5

Damn ..

Code:
// This is a comment, it will not do anything within the plugin

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Admin join/Leave Message", "beta 1","h4ns")     register_cvar("amx_join_message", "Beware %name% is connecting!")     register_cvar("amx_joined_message", "O NO! %name% is here!")     register_cvar("amx_leave_message", "Finally %name% is gone!") } public client_connect(id) {     new authID[33]     new steamID = get_user_authid(id,authID,32)     // If steamID returns as true     if (steamID) {         new joinMsg[164]         get_cvar_string("amx_join_message",joinMsg,163)         new name[33]         get_user_name(id,name,32)         replace(joinMsg,163,"%name%",name)                 // set_hudmessage(...)         show_hudmessage(0,"%s",joinMsg)     }     return PLUGIN_HANDLED }
I might be wrong..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 22:55  
Reply With Quote #6

dont think u get me

I want it to trigger that message ONLY if the steamID turns out to be STEAM_0:1229563

and maybe some other id's to
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 23:09  
Reply With Quote #7

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Admin join/Leave Message", "beta 1","h4ns")     register_cvar("amx_join_message", "Beware %name% is connecting!")     register_cvar("amx_joined_message", "O NO! %name% is here!")     register_cvar("amx_leave_message", "Finally %name% is gone!") } public client_connect(id) {     new authID[33]     get_user_authid(id,authID,32)     // If it matches your Steam ID     if (equal(authID,"STEAM_0:1:3229563")) {         new joinMsg[164]         get_cvar_string("amx_join_message",joinMsg,163)         new name[33]         get_user_name(id,name,32)         replace(joinMsg,163,"%name%",name)                 // set_hudmessage(...)         show_hudmessage(0,"%s",joinMsg)     }     return PLUGIN_HANDLED }
Wouldn't that be kind of dumb just displaying the message when YOU connect?

Code:
if (is_user_admin(id)) {     // .. }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 23:13  
Reply With Quote #8

no not really, want to warn players that admin is comming cause usually when I connected the players KEEP asking for admin while they saw me come in, so now they MUST see it
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 23:16  
Reply With Quote #9

So you're the only admin?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 23:27  
Reply With Quote #10

No im just head admin but the others dont need warning

Code:
/* Admin join/leave message béta 1 by h4ns This lets the players now when admin is connected or disconnected to the server. Just upload this into your amxx/plugins folder add admin_ann.amxx in your amxx/plugins.ini Restart server or changemap AND ENJOY! Special thanks to BigBaller for the original script. */ public plugin_init() {     register_plugin("Admin join/Leave Message", "beta 1","h4ns")     register_cvar("amx_join_message", "Beware %name% is connecting!")     register_cvar("amx_joined_message", "O NO! %name% is here!")     register_cvar("amx_leave_message", "Finally %name% is gone!") } public client_connect(id) {     new authID[33]     get_user_authid(id,authID,32)     // If it matches your Steam ID     if (equal(authID,"STEAM_0:1:3229563")) {         new joinMsg[164]         get_cvar_string("amx_join_message",joinMsg,163)         new name[33]         get_user_name(id,name,32)         replace(joinMsg,163,"%name%",name)                   // set_hudmessage(...)         show_hudmessage(0,"%s",joinMsg)     }     return PLUGIN_HANDLED } public client_putinserver(id){             new authID[31]         get_user_authid(id,authID,30)                     // If it matches your steam ID         if (equal(authID,"STEAM_0:1:3229563")) {                         new joinedMsg[163]             get_cvar_string("amx_joined_message",joinedMsg,162)                         new name[31]             get_user_name(id,name,30)                         replace(joinedMsg,162,"%name%",name)                         // set_hudmessage(...)             show_hudmessage(0,"%s",joinedMsg)     }         return PLUGIN_HANDLED } public client_disconnect(id){             new authID[29]         get_user_authid(id,authID,28)                 // If it matches your steam ID         if (equal(authID,"STEAM_0:1:3229563")) {                         new leaveMsg[161]             get_cvar_string("amx_leave_message",leaveMsg,160)                         new name[29]             get_user_name(id,name,28)                         replace(leaveMsg,160,^%name%",name)                         // set_hudmessage(...)             show_hudmessage(0,"%s",leaveMsg)     }         return PLUGIN_HANDLED }
h4ns 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 10:00.


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