server closed when typing a command
#6

Of course the server closes.
You missunderstood how to use SSCANF

pawn Код:
COMMAND:shout(playerid, params[])
{
    if ( sscanf( params, "s", params[ 0 ] ) ) return SendClientMessage(playerid, Yellow, "Usage: /shout <message>");
    new string[128],Name[ 20 ];
    if ( ( GetTickCount( ) - LastShout[ playerid ] ) < 20 )
    {
        format(string, 128, "You have to wait %d seconds before shout", ( 20 - ( gGetTickCount( ) -LastShout[ playerid ] ) ) );
        SendClientMessage( playerid, Red, string );
        return 1;
    }
    GetPlayerName( playerid, Name, sizeof( Name ) );
    format( string, sizeof( string ), "( SHOUT ) %s(ID: %d) %s:", Name, playerid, params[ 0 ]);
    SendClientMessageToAll( White, string );
    LastShout[ playerid ] = GetTickCount( );
    return 1;
}
You used playerid as a paramtere, also used strng to get player's name...
Reply


Messages In This Thread
server closed when typing a command - by xir - 29.01.2011, 10:02
Re: server closed when typing a command - by Infamous - 29.01.2011, 10:10
Re: server closed when typing a command - by JamesC - 29.01.2011, 10:11
Re: server closed when typing a command - by xir - 29.01.2011, 10:12
Re: server closed when typing a command - by xir - 29.01.2011, 11:09
Re: server closed when typing a command - by Zh3r0 - 29.01.2011, 11:19
Re: server closed when typing a command - by xir - 29.01.2011, 22:16
Re: server closed when typing a command - by bigcomfycouch - 29.01.2011, 22:28

Forum Jump:


Users browsing this thread: 2 Guest(s)