Raised This Month: $ Target: $400
 0% 

Parse out clan name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sun_Blood
Junior Member
Join Date: Jul 2006
Old 09-16-2007 , 14:39   Parse out clan name
Reply With Quote #1

Hello

How can I check if a player is a member of the |sun| clan?
for exampel I want to take this list and only get a match on the first 2 names

|sun|lala
|sun| lala
|gas|ala
|lps*|la


Code:
if (clan is "|sun|") {
//do somthing
}
Sun_Blood is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-16-2007 , 15:36   Re: Parse out clan name
Reply With Quote #2

Try this :

Code:
new g_tag[] = "|sun|" public client_connect(id) {     static name[32]     get_user_name(id, name, sizeof name - 1)     if( equali(name, g_tag, sizeof g_tag) )     {         //do stuff here     } }
ConnorMcLeod is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-16-2007 , 17:08   Re: Parse out clan name
Reply With Quote #3

Quote:
Originally Posted by connorr View Post
Try this :

Code:
new g_tag[] = "|sun|" public client_connect(id) {     static name[32]     get_user_name(id, name, sizeof name - 1)     if( equali(name, g_tag, sizeof g_tag) )     {         //do stuff here     } }
@connorr: That's not quite right ;). Just one native off!

You could've looked in my Clan Tryout System, or a host of other plugins. But the code is so easy, I'll just post it here (this is adapting off what connorr originally posted):

Code:
new gTag[] = "sun|"; public client_connect(id) {      new name[32];      get_user_name(id, name, sizeof(name)-1);      if (containi(name, gTag) > -1)      {            // Code here.      } }

You could also make it read from a file full of clan names, just as a suggestion for multiple clan tags.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-16-2007 , 17:15   Re: Parse out clan name
Reply With Quote #4

Oh i was thinking that equali was checking from name[0] to name[sizeof g_tag], in that case 5.
Please explain me what's wrong here.
Thanks.
ConnorMcLeod is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-16-2007 , 17:19   Re: Parse out clan name
Reply With Quote #5

Quote:
Originally Posted by connorr View Post
Oh i was thinking that equali was checking from name[0] to name[sizeof g_tag], in that case 5.
Please explain me what's wrong here.
Thanks.
PlayerNameHere|sun

'nuff said.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
djmd378
Senior Member
Join Date: Sep 2004
Old 09-16-2007 , 18:24   Re: Parse out clan name
Reply With Quote #6

I sorta kinda made this for what you want but just for the OwnageClan (Ownage | ) because of their servers where you connect and you are automatically renamed to have their tag and your keys rebind.


Anyways, just edit to your needs since I don't feel like it.
Attached Files
File Type: sma Get Plugin or Get Source (annoyance_remover.sma - 802 views - 811 Bytes)
__________________
djmd378 is offline
Sun_Blood
Junior Member
Join Date: Jul 2006
Old 09-17-2007 , 15:32   Re: Parse out clan name
Reply With Quote #7

Thanks for the response but there is one problem.
I failed to say in my first post (sorry) that the name of the players is already in a string.

So I have an array whit the nicks and I want to check if the user I am currently working whit is in the clan |sun|.

So
Code:
nickname[] = |sun|lalala
tag[] = |sun|

if (tag[i] is in nickname[i])  {
	//do code
}
Sun_Blood is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-17-2007 , 17:15   Re: Parse out clan name
Reply With Quote #8

Quote:
Originally Posted by Sun_Blood View Post
Thanks for the response but there is one problem.
I failed to say in my first post (sorry) that the name of the players is already in a string.

So I have an array whit the nicks and I want to check if the user I am currently working whit is in the clan |sun|.

So
Code:
nickname[] = |sun|lalala
tag[] = |sun|

if (tag[i] is in nickname[i])  {
	//do code
}
Look at my code I posted.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 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 16:08.


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