26.10.2010, 04:02
Your code is a horrible mess. Furthermore, you don't need an IPC check, the player is connected to have used the command.
I assume that's what you originally wanted, it'd get the old name, put the clan tag in front, then change their name to it.
pawn Код:
COMMAND:clantag(playerid, params[]) { // If you're using zcmd, you don't need 'cmdtext[]'
if(!isnull(params)) {
// The command contains a string that we can parse just by 'params'
new
playerClanTagandName[MAX_PLAYER_NAME], // For formatting the new player name
playerName[MAX_PLAYER_NAME]; // Use the define/constant. It's 24, not 256.
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); // Getting the players name.
format(playerClanTagandName, MAX_PLAYER_NAME, "[%s]%s", params, playerName); // Formatting
SetPlayerName(playerid, playerClanTagandName); // Setting the new name
}
}