SA-MP Forums Archive
a different idea? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: a different idea? (/showthread.php?tid=605788)



a different idea? - Saliim - 24.04.2016

Hi all, I use that:

Код:
	new
	    szName[MAX_PLAYER_NAME],
	    szBuffer[250]
	;
	GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
	format(szBuffer, sizeof(szBuffer), "{58FA82}[ID:%i]%s: "CC"Utilise "CC2"[/cmd]", playerid, szName, text);
	SendClientMessageToAll(GetPlayerColor(playerid), szBuffer);
example: Salim use /cmd

I put it in my commands but that's a lot of STRING


Re: a different idea? - CalvinC - 24.04.2016

You should only use 128 bits in your szBuffer string, that's the max for SCM.


Re: a different idea? - Darkwood17 - 24.04.2016

Quote:
Originally Posted by Saliim
Посмотреть сообщение
Hi all, I use that:

Код:
	new
	    szName[MAX_PLAYER_NAME],
	    szBuffer[250]
	;
	GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
	format(szBuffer, sizeof(szBuffer), "{58FA82}[ID:%i]%s: "CC"Utilise "CC2"[/cmd]", playerid, szName, text);
	SendClientMessageToAll(GetPlayerColor(playerid), szBuffer);
example: Salim use /cmd

I put it in my commands but that's a lot of STRING
You can use a function instead of writing this in every command:

Код:
CommandUsed(playerid, text[])
{
	new szName[MAX_PLAYER_NAME], szBuffer[128];
	GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
	format(szBuffer, sizeof(szBuffer), "{58FA82}[ID:%i]%s: "CC"Utilise "CC2"%s", playerid, szName, text);
	SendClientMessageToAll(GetPlayerColor(playerid), szBuffer);
}
Usage in commands:
Код:
CommandUsed(playerid, "/yourcommandname");



Re: a different idea? - Saliim - 24.04.2016

Thanks


Re: a different idea? - Saliim - 24.04.2016

Solved