Jump to content
  • 0

Problema chat


AnDy19

Question

8 answers to this question

Recommended Posts

public OnPlayerText(playerid,text[])
{
	if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
	{
	    SendClientMessage(playerid, 0xFF0000FF, "*{CC00FF} You can only send a message once every two seconds.");
	    return 0;
	}
		if(!IsPlayerAdmin(playerid))
	{
		if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text,  false))
		{
			SendClientMessage(playerid, 0xFF0000FF, "*{CC00FF} Please do not repeat yourself.");
			format(szPlayerChatMsg[playerid], 128, "%s", text);
		    return 0;
		}
	}

	format(szPlayerChatMsg[playerid], 128, "%s", text);
    iPlayerChatTime[playerid] = GetTickCount();

	new rand = random(sizeof(BubbleColors));
	SetPlayerChatBubble(playerid, text, BubbleColors[rand][0], 300.0, 5000);
	if(Language[playerid] == ROM)
    {
	    new MMM[256];
		format(MMM, sizeof(MMM)," %s ", playerid,text);
		SendPlayerMessageToAll(playerid, MMM);
    }
    if(Language[playerid] == ENG)
    {
	    new MMM[256];
		format(MMM, sizeof(MMM)," %s ", playerid,text);
		SendPlayerMessageToAll(playerid, MMM);
	}

Link to comment
Share on other sites

[pawn]public OnPlayerText( playerid, text[ ] )

{

if( IsPlayerFlooding( playerid ) && !IsPlayerAdmin( playerid ) )

{

    SendClientMessage( playerid, 0xFF0000FF, "*{CC00FF} You can only send a message once every two seconds." );

    return ( 0 );

}

if ( !IsPlayerAdmin( playerid ) )

{

if ( strlen( text ) == strlen( szPlayerChatMsg[ playerid ] ) && !strcmp( szPlayerChatMsg[ playerid ], text,  false ) )

{

SendClientMessage( playerid, 0xFF0000FF, "*{CC00FF} Please do not repeat yourself." );

format( szPlayerChatMsg[ playerid ], 128, "%s", text );

return ( 0 );

}

}

format( szPlayerChatMsg[ playerid ], 128, "%s", text );

    iPlayerChatTime[ playerid ] = GetTickCount( );

new rand = random( sizeof( BubbleColors ) );

SetPlayerChatBubble( playerid, text, BubbleColors[ rand ][ 0 ], 300.0, 5000 );

if(Language[playerid] == ROM)

{

new MMM[ 256 ];

format( MMM, sizeof( MMM )," %s ", text );

SendPlayerMessageToAll( playerid, MMM );

}

if ( Language[ playerid ] == ENG )

{

new MMM[ 256 ];

format( MMM, sizeof( MMM ),"%s", text );

SendPlayerMessageToAll( playerid, MMM );

}[/pawn]

Link to comment
Share on other sites

acum imi apare de 2 ori odata ce scriu eu si odata "

Si daca vrei poti sa imi spui knd scriu sa imi arate ex: nume jucator id jucator si ce a scris jucatorul?

Testeaza:

[pawn]public OnPlayerText( playerid, text[ ] )

{

if( IsPlayerFlooding( playerid ) && !IsPlayerAdmin( playerid ) )

{

    SendClientMessage( playerid, 0xFF0000FF, "*{CC00FF} You can only send a message once every two seconds." );

    return ( 0 );

}

if ( !IsPlayerAdmin( playerid ) )

{

if ( strlen( text ) == strlen( szPlayerChatMsg[ playerid ] ) && !strcmp( szPlayerChatMsg[ playerid ], text,  false ) )

{

SendClientMessage( playerid, 0xFF0000FF, "*{CC00FF} Please do not repeat yourself." );

format( szPlayerChatMsg[ playerid ], 128, "%s", text );

return ( 0 );

}

}

format( szPlayerChatMsg[ playerid ], 128, "%s", text );

    iPlayerChatTime[ playerid ] = GetTickCount( );

new rand = random( sizeof( BubbleColors ) );

SetPlayerChatBubble( playerid, text, BubbleColors[ rand ][ 0 ], 300.0, 5000 );

new Text[ 128 ];

    format( Text, 128, "[%d]: %s", playerid, text );

    SendPlayerMessageToAll( playerid, Text );[/pawn]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.