CMD:titulus(playerid,params[])
{
new titulus[64],szoveg[256];
if(sscanf(params,\"ss\",titulus,szoveg)) return SendClientMessage(playerid,-1,\"Használat: /titulus [Titulus] [szöveg]\");
{
new string[256];
new nev[MAX_PLAYER_NAME];
GetPlayerName(playerid,nev,sizeof(nev));
format(string,sizeof(string),\"%s %s: %s\",titulus,nev,szoveg);
SendClientMessageToAll(-1,string);
}
return 1;
}
Ilyenre gondolsz?Vagy olyanra,hogy van egy Titulus változó,és ha csak simán enterrel chatel,akkor kiírja a titulus a játékos elé ha van?
Igazad van bocsi, itt a jó.
#include < a_samp >
#include < zcmd >
#include < sscanf2 >
new pTitulus[ MAX_PLAYERS ][ 64 + 1 ];
CMD:titulus( playerid, params[] ) {
new Titulus[ 64 + 1 ];
if( sscanf(params, \"s[64]\", Titulus) ) return SendClientMessage( playerid, (-1), \"HASZNÁLAT: /titulus (szöveg)\" );
if( strlen(Titulus) > 64 ) return 1;
// ----------------
format( pTitulus[ playerid ], (64), \" < %s >\", Titulus );
return 1;
}
public OnPlayerText( playerid, text[] ) {
new g_szString[ 192 + 1 ];
format( g_szString, (192), \"%s(%d)%s: %s\", playerName(playerid), playerid, pTitulus[ playerid ], text );
SendClientMessageToAll( (-1), g_szString );
return 0;
}
stock playerName( playerid ) {
new plaName[ 24 + 1 ];
GetPlayerName( playerid, plaName, (24) );
return plaName;
}