08.05.2018, 15:11
Frist way: (here the messages will not mix each others and can't be repeated more than 1 time at 3 minutes)
Another way: (here one message can be repeated more than 1 time at 3 minutes)
I literally think that you will use the first way that i gave you here.
I don't think that you want messages to repeat. So use first. It is ofc your choice.
PHP код:
new
TEXT_STEP,
TD_AGAIN_X,
TD_AGAIN,
Text:your_TD[ MAX_PLAYERS ]
;
public OnGameModeInit( )
{
TD_AGAIN_X = SetTimer( "TDAgainX", 60 * 3, true );
return 1;
}
public OnPlayrSpawn( playerid )
{
TextDrawShowForPlayer( playerid, your_TD[ playerid ] );
return 1;
}
stock RandomTextDraw( )
{
foreach(new i: Player)
{
if( TEXT_STEP == 1 )
{
TextDrawSetString( your_TD[ i ], "Your first message here" );
}
if( TEXT_STEP == 0 )
{
TextDrawSetString( your_TD[ i ], "Your second message here" );
}
TextDrawShowForPlayer( playerid, your_TD[ i ] );
}
return 1;
}
function TDAgainX( )
{
TEXT_STEP = 1;
RandomTextDraw( );
KillTimer( TD_AGAIN_X );
TD_AGAIN = SetTimer( "TDAgain", 60 * 3, true );
}
function TDAgain( )
{
TEXT_STEP = 0;
RandomTextDraw( );
KillTimer( TD_AGAIN );
TD_AGAIN_X = SetTimer( "TDAgainX", 60 * 3, true );
}
PHP код:
new Text:your_TD[ MAX_PLAYERS ];
new RandomTextdraw[ ][ ] =
{
"Your first message",
"Your second message"
};
public OnGameModeInit( )
{
SetTimer( "RandomTextDrawTimer", 60 * 3, 1 );
return 1;
}
public OnPlayrSpawn( playerid )
{
TextDrawShowForPlayer( playerid, your_TD[ playerid ] );
return 1;
}
function RandomTextDrawTimer( )
{
foreach(new i: Player)
{
TextDrawSetString( your_TD[ i ], RandomTextdraw[ random( sizeof( RandomTextdraw ) ) ] );
}
return 1;
}
I don't think that you want messages to repeat. So use first. It is ofc your choice.