Dark Nexus Posted December 27, 2003 Report Posted December 27, 2003 i am making a plugin that at somepoint needs to output a users name on the screen using objects. So i am going to run through the p->name array and get each character and then output that character. I need a way to figure how many array slots the players name takes up. Can i do this by looping until it encounters an empty array slot, or is there some way to determine the length before looping? any help would be appreciated
Dark Nexus Posted December 27, 2003 Author Report Posted December 27, 2003 hehe, was looking through how the bot recognized an invalid player name and came accross a nice function called STRLEN, thanx anyways
50% Packetloss Posted December 28, 2003 Report Posted December 28, 2003 the invalid player name function is wrong anyway. The % sign is a legal characer in a name. Also, for any char string the last character is null (aka '\0' or 0), so all that strlen does is run a "for" loop until it gets to the end of the string.
Recommended Posts