Raised This Month: $ Target: $400
 0% 

Steam Announce V1.1


Post New Thread Reply   
 
Thread Tools Display Modes
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-09-2012 , 03:53   Re: Steam Announce
Reply With Quote #11

Quote:
Originally Posted by DarthNinja View Post
PHP Code:
    new server 0;
    if (!
client || client == || client == server || !(client && client <= MaxClients) || (IsClientConnected(client) && IsFakeClient(client)))
    {
        return 
Plugin_Continue;
    } 
ಠ_ಠ
LOOOOOOL
Is this on purpose or what XD

About Happy DODs Player's request, you can simply do
PHP Code:
public OnClientPostAdminCheck(client
{     
  if(!
IsFakeClient(client))
  {
   
decl String:steamid[32],String:clientname[24];
    
   
GetClientName(clientclientnamesizeof(clientname));
   
GetClientAuthString(client,steamid,sizeof(steamid));

   
PrintToChatAll("\x01[CON] \x04%s : \x03%s"clientnamesteamid);
  }

__________________

Last edited by napalm00; 02-09-2012 at 03:58.
napalm00 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 02-09-2012 , 08:29   Re: Steam Announce
Reply With Quote #12

ty, as i said im noob to this. was just soemthing simple for me but figured to release it as it seemed useful as it was lightweight.
Rizla is offline
Happy DODs player
AlliedModders Donor
Join Date: Sep 2009
Old 02-09-2012 , 16:32   Re: Steam Announce
Reply With Quote #13

@ Rizla:

Hope you can add the new lines in a update for the ignoring BOTS.

And wonderfull job so far
Happy DODs player is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 02-09-2012 , 17:59   Re: Steam Announce V1.1
Reply With Quote #14

updated, see first post. let me know if any problems
Rizla is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-10-2012 , 02:04   Re: Steam Announce V1.1
Reply With Quote #15

The connect message won't work since you wrote
PHP Code:
public OnClientPostAdminCheck(client)
{
 if(
IsFakeClient(client)) 
 { 
instead of what I said:
PHP Code:
public OnClientPostAdminCheck(client)
{
 if(!
IsFakeClient(client)) 
 { 
The exclamation mark is a negation, so if the return of "IsFakeClient" is false, execute the code since the client is NOT a bot.

EDIT:
Also I suggest you to do the same for PlayerDisconnect
PHP Code:
public Action:event_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
 new 
client GetClientOfUserId(GetEventInt(event"userid")); 
 if(!
IsFakeClient(client))
 {
  new 
String:clientname[24];
  
GetClientName(clientclientnamesizeof(clientname));
  new 
String:steamid[35];
  
GetClientAuthString(client,steamid,sizeof(steamid));
    
  
PrintToChatAll("\x01[DC] \x04%s : \x03%s"clientnamesteamid);
 }
 return 
Plugin_Continue;

__________________

Last edited by napalm00; 02-10-2012 at 11:02. Reason: herpaderp
napalm00 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 02-10-2012 , 08:56   Re: Steam Announce V1.1
Reply With Quote #16

boll***s, i should have noticed that myself

fixed version re-released

Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
 //stuff
}
did it like that, assume thats ok?
Rizla is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-10-2012 , 10:01   Re: Steam Announce V1.1
Reply With Quote #17

Quote:
Originally Posted by Rizla View Post
boll***s, i should have noticed that myself

fixed version re-released

Code:
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if (client > 0)
{
 //stuff
}
did it like that, assume thats ok?
did you even read what I said?
__________________
napalm00 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 02-10-2012 , 10:30   Re: Steam Announce V1.1
Reply With Quote #18

you edited it, the original way you put up didnt work, and i was thinking of doing it that way, but i had a look around and found the way i did it (if that makes sense..)
Rizla is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 02-10-2012 , 10:43   Re: Steam Announce V1.1
Reply With Quote #19

Quote:
Originally Posted by Rizla View Post
you edited it, the original way you put up didnt work, and i was thinking of doing it that way, but i had a look around and found the way i did it (if that makes sense..)
That's because that event doesn't exist in TF2, and since I'm used to TF2 coding I forgot to add it (tf2 uses OnClientDisconnect(client)). It was easy to understand though, I simply wanted you to wrap the announce with an "IsFakeClient" check like you did in the connect event.
__________________
napalm00 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 02-10-2012 , 10:48   Re: Steam Announce V1.1
Reply With Quote #20

might want to have a look at your example again :p

all sorted tho, thanks for your advice
Rizla 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 23:18.


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