Find players name
Ok...heres what im doing:
Making a plugin that changes anyones name that is "Player" by default, it will change it to something else. I just need to know how to find if they persons name is player...other than that, I am almost done with this plugin...I am hoping to make it for all mods because i keep playing in DOD and CS servers that ask people with the name "Player" to change their name. Please and Thank you. |
Code:
|
Alternately, stop reinventing the wheel and use something like Restrict Names since it has the ability to do exactly what you're trying to do.
|
Well brad...you could just tell me nicely that it has already been made...
Thanks...i was hoping that i would be the first to make it. |
Sandurr, sizeof(name) will return 32. Putting 32 digits into a 32 sized array doesn't save space for the string terminator. sizeof(name)-1 would be correct.
|
Ermm...
Ermm....I havent saw the 'sizeof' function before. Where did you found it.
Can't find it in the doc. So i only make it like this. Quote:
|
I don't think sizeof is a native.
Anyway, yes, that would be the same. There isn't much of a point to using sizeof if you already know the size of the array, unless you plan on changing it and don't want to change two numbers at once. |
Re: Ermm...
Quote:
|
Re: Ermm...
Quote:
So the correct way to do this would be. new name[33]; You would also have to change your get_user_name. get_user_name(id, name, 32) |
The size of the name array has nothing to do with the player count.
|
| All times are GMT -4. The time now is 16:13. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.