13.07.2011, 02:04
Quote:
Note that only handles up to two parts, so you could not retrieve a name such as Eryn_Martin_Miller
|
pawn Код:
stock GetPartOfName(playerid, part) {
new
name[MAX_PLAYER_NAME];
if(GetPlayerName(playerid, name, sizeof name)) {
new
i = 0,
idx = 0;
for( ; name[i]; ++i) {
if(name[i] == '_') {
if((--part) == 0) {
name[i] = EOS;
return name[idx];
}
idx = i + 1;
}
}
if((--part) == 0) {
name[i] = EOS;
return name[idx];
}
name[0] = EOS;
}
return name;
}