Non Roleplay Name - First letter and last letter of name must be capital!
#1

Title says it all!

I don't know if this was asked already, I searched and I couldn't find it. I want it when a player connects and his First: first letter and his last letter of his name must be capitalized or he will be kicked!

How do you do that? I've seen it on a Couple of servers!
Reply
#2

Quote:
Originally Posted by Compton's Eazy E
Title says it all!

I don't know if this was asked already, I searched and I couldn't find it. I want it when a player connects and his First: first letter and his last letter of his name must be capitalized or he will be kicked!

How do you do that? I've seen it on a Couple of servers!
Not the last letter,the first letter of the Firstname,and the first letter of the Lastname.
The name will be like "Johnny_Capilu".
Reply
#3

Yes like that
Reply
#4

Bump
Reply
#5

Quote:
Originally Posted by Compton's Eazy E
Bump
Why bump!, Your topic cant always be thirst, Its called having patience
Reply
#6

Use brain, logic and conditions
I made one and it is really easy
Reply
#7

What if name is: Joebullet ... Your function will fail because you didn't check for if it has char _ at all... And numbers will be left
Reply
#8

Код:
stock RPName(name[],ret_first[],ret_last[])
{	
	new len = strlen(name),
	point = -1,
	bool:done = false;
	for(new i = 0; i < len; i++) {
		if((name[i] > 64 && name[i] < 91) || (name[i] > 96 && name[i] < 123) || name[i] == 95) { 
			if(name[i] == 95) {
				if(point != -1) return 0;
				else {
					if(i == 0) return 0;
					point = i + 1;
				}
			} 
			else if(point == -1) {
				if(name[0] < 65 || name[0] > 90) return 0;
				if(i>0) { 
					if(name[i]<97 || name[i]>122) 
					return 0; 
				}
				ret_first[i] = name[i]; 
			}
			else {
				if(name[point]<65 || name[point]>90) return 0;
				if(i>point+1) { 
					if(name[i]<97 || name[i]>122) 
					return 0; 
				}
				ret_last[i - point] = name[i];
				done = true;
			}
		} else return 0;
	}
	if(!done) return 0;
	return 1;
}
Reply
#9

Quote:
Originally Posted by Seif_ [adream-rp.com
]
Quote:
Originally Posted by JoeBullet
What if name is: Joebullet ... Your function will fail because you didn't check for if it has char _ at all... And numbers will be left
Actually this function capitalizes your RP name. If you don't have a function that checks if it's valid(usually people do...), search in the Useful Functions section, there are plenty.

Oh and I quote what he said:
Quote:

I want it when a player connects and his First: first letter and his last letter of his name must be capitalized or he will be kicked!

He can easily change it to get the player kicked, but having this is better, because there's a SA-MP glitch where it sometimes connects you with a lowered case letter while you made it upper case.
Man, I surely do know how to script 'cuz i do programming in C so this is just easy as cake... i am speaking if someone dont know
Reply
#10

Quote:
Originally Posted by aspire5630
Quote:
Originally Posted by Compton's Eazy E
Bump
Why bump!, Your topic cant always be thirst, Its called having patience
that was my only bump and it was passed 12 hour rule to bump a topic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)