#6

Quote:
Originally Posted by Joe Vagos
Посмотреть сообщение
i need it in scanf cause i have my own code so i need it in scanf to adpt in ma code
My dear this will work even if it isn't sscanf.... :/

Here you go:

pawn Код:
new ShoutTime[ MAX_PLAYERS ],
    MeTime[ MAX_PLAYERS ]; // top
   
#define ME_TIME     (10000) // 10 seconds at top
#define SHOUT_TIME  (10000) // 10 seconds at top

CMD:me( playerid, params[ ] )
{

    new szString[ 50 ];
    format( szString, sizeof( szString ), "Wait for %i seconds before using it again!", ( MeTime[ playerid ] - GetTickCount( ) )/1000 );

    if( MeTime[ playerid ] > GetTickCount( ) ) return SendClientMessage( playerid, -1, szString );

    MeTime[ playerid ] = GetTickCount( ) + ME_TIME; // he can't do it in the next 10 seconds

    new message[ 128 ];
    if( sscanf( params, "s[128]", message ) ) return SendClientMessage( playerid, -1, "/me [message]" );
   

    new szStr[ 128 ], szPname[ MAX_PLAYER_NAME ];

    GetPlayerName( playerid, szPname, sizeof( szPname ) );

    format( szStr, sizeof( szStr ), "* %s %s", szPname, message  );
    SendClientMessageToAll( -1, szStr );
    return 1;
}

CMD:shout( playerid, params[ ] )
{
    new szString[ 50 ];
    format( szString, sizeof( szString ), "Wait for %i seconds before using it again!", ( ShoutTime[ playerid ] - GetTickCount( ) )/1000 );

    if( ShoutTime[ playerid ] > GetTickCount( ) ) return SendClientMessage( playerid, -1, szString );

    ShoutTime[ playerid ] = GetTickCount( ) + SHOUT_TIME; // he can't do it in the next 10 seconds

    new message[ 128 ];
    if( sscanf( params, "s[128]", message ) ) return SendClientMessage( playerid, -1, "Usage: /shout [message]" );

    new szStr[ 128 ], szPname[ MAX_PLAYER_NAME ];

    GetPlayerName( playerid, szPname, sizeof( szPname ) );

    format( szStr, sizeof( szStr ), "* %s shouts %s", szPname, message  );
    SendClientMessageToAll( -1, szStr );
    return 1;
}
Reply


Messages In This Thread
hey - by Joe Vagos - 09.08.2012, 19:40
Re: hey - by FalconX - 09.08.2012, 20:03
Re: hey - by Joe Vagos - 09.08.2012, 20:06
Re: hey - by FalconX - 09.08.2012, 20:11
Re: hey - by Joe Vagos - 09.08.2012, 20:13
Re: hey - by FalconX - 09.08.2012, 20:16
Re: hey - by Joe Vagos - 09.08.2012, 20:40
Re: hey - by FalconX - 09.08.2012, 20:42
Re: hey - by Joe Vagos - 09.08.2012, 20:45
Re: hey - by FalconX - 09.08.2012, 20:54

Forum Jump:


Users browsing this thread: 1 Guest(s)