Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
Hi guys, is there any way to remove the underscore from a name and send the text from before it only?
Example,
Lewis_Ryan
from the above name, all I need sending to chat is
Lewis Without the _ and ryan
Is this possible? Thanks =]
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by RenSoprano
pawn Код:
RPName(playerid) {
new sz_playerName[MAX_PLAYER_NAME], i_pos;
GetPlayerName(playerid, sz_playerName, MAX_PLAYER_NAME); while ((i_pos = strfind(sz_playerName, "_", false, i_pos)) != -1) sz_playerName[i_pos] = ' '; return sz_playerName; }
This will remove your underscore
|
Nice rip from the NGRP script.
Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
Okay, thanks. How can I get the first half, before the underscore only. E.g Lewis_Ryan and I need Lewis ?
=]
Posts: 221
Threads: 90
Joined: Jun 2010
Reputation:
0
wow, fantastic! thank you so much!