strcat
#1

why doesn't the strcat part shows ingame?

actually it only shows the %s has connected...


Код:
public OnPlayerConnect(playerid)
{
	new
		String[128],
		PlayerName[MAX_PLAYER_NAME];
		
	GetPlayerName(playerid, PlayerName, sizeof ( PlayerName ));
	
	format(String, sizeof ( String ), "{C3C3C3}GAME: %s has entered the server", PlayerName);
	
	SendClientMessageToAll(-1, String);
	
	new
		 String2[256];
	
	strcat(String2, "{FFCC00}Welcome to GTA Wargounds.");
	strcat(String2, "\n{FFCC00}If you need any help, don't hesitate to ask");
	strcat(String2, "\n{C3C3C3}Here are some commands to get you started");
	strcat(String2, "\n{C3C3C3}/cmds, /help, /rules");
	
	SendClientMessage(playerid,-1,String2);
	
	GameTextForPlayer(playerid, "~w~GTA ~r~ WARGROUNDS", 5000, 6);
	
	return true;
}
Reply
#2

Try this I'm sure it will work.

Код:
public OnPlayerConnect(playerid)
{
	new
		String[128],
		PlayerName[MAX_PLAYER_NAME];

	GetPlayerName(playerid, PlayerName, sizeof ( PlayerName ));

	format(String, sizeof ( String ), "{C3C3C3}GAME: %s has entered the server", PlayerName);

	SendClientMessageToAll(-1, String);

	new
		 String2[256];
	format(string2, sizeof(string2),"{FFCC00}Welcome to GTA Wargounds.\n");
	format(string2, sizeof(string2),"%s{FFCC00}If you need any help, don't hesitate to ask\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}Here are some commands to get you started\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}/cmds, /help, /rules\n",string2);


	SendClientMessage(playerid,-1,String2);

	GameTextForPlayer(playerid, "~w~GTA ~r~ WARGROUNDS", 5000, 6);

	return true;
}
Reply
#3

Quote:
Originally Posted by Nru
Посмотреть сообщение
Try this I'm sure it will work.

Код:
public OnPlayerConnect(playerid)
{
	new
		String[128],
		PlayerName[MAX_PLAYER_NAME];

	GetPlayerName(playerid, PlayerName, sizeof ( PlayerName ));

	format(String, sizeof ( String ), "{C3C3C3}GAME: %s has entered the server", PlayerName);

	SendClientMessageToAll(-1, String);

	new
		 String2[256];
	format(string2, sizeof(string2),"{FFCC00}Welcome to GTA Wargounds.\n");
	format(string2, sizeof(string2),"%s{FFCC00}If you need any help, don't hesitate to ask\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}Here are some commands to get you started\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}/cmds, /help, /rules\n",string2);


	SendClientMessage(playerid,-1,String2);

	GameTextForPlayer(playerid, "~w~GTA ~r~ WARGROUNDS", 5000, 6);

	return true;
}
PlayerName is an array, you need to define an index.


Код:
public OnPlayerConnect(playerid)
{
	new
		String[128],
		PlayerName[MAX_PLAYER_NAME];

	GetPlayerName(playerid, PlayerName[playerid], sizeof ( PlayerName[playerid] ));

	format(String, sizeof ( String ), "{C3C3C3}GAME: %s has entered the server", PlayerName[playerid]);

	SendClientMessageToAll(-1, String);

	new
		 String2[256];
	format(string2, sizeof(string2),"{FFCC00}Welcome to GTA Wargounds.\n");
	format(string2, sizeof(string2),"%s{FFCC00}If you need any help, don't hesitate to ask\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}Here are some commands to get you started\n",string2);
	format(string2, sizeof(string2),"%s{C3C3C3}/cmds, /help, /rules\n",string2);


	SendClientMessage(playerid,-1,String2);

	GameTextForPlayer(playerid, "~w~GTA ~r~ WARGROUNDS", 5000, 6);

	return true;
}
Also if you want to keep using PlayerName in the rest of your script, you should make PlayerName a global variable.
Reply
#4

Read note https://sampwiki.blast.hk/wiki/SendClientMessage
Reply
#5

SendClientMessage can only write to a single line. If you want multiple lines then you need to call SCM again with a different text in it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)