Quote:
Originally Posted by whosyourdaddy
this is what im doing
|
When I say what is the source of the text, I mean what is szString holding? Where and what value is it assigned?
Here is the code with the text passed through to the task via param[]. Replace console_print with your Create_StatusText2 function as you see appropriate. I revised the code and removed 2 unneeded string variables.
PHP Code:
#include <amxmodx>
#pragma semicolon 1
public plugin_init()
{
register_plugin("scroll text" , "0.1" , "bugsy");
register_concmd("amx_showtext", "DisplayText" , ADMIN_ADMIN );
register_concmd("amx_stoptext", "StopText" , ADMIN_ADMIN );
}
public DisplayText(id)
{
new param[62];
param[0] = id;
format( param[1] , 60, "THIS WILL SCROLL TEXT, REMOVING ONE CHAR AT A TIME" );
if( strlen(param[1]) > 10 )
set_task( 0.5 , "Rotate" , 5128+id , param,62,"b");
else
console_print( id ,"%s" , param[1] );
return PLUGIN_HANDLED;
}
public StopText(id)
{
remove_task(5128+id);
return PLUGIN_HANDLED;
}
public Rotate(param[62])
{
//param[0] = player id
//param[1-61] = text
static iIdx;
if( iIdx )
console_print(param[0], "%s" , param[iIdx+1] );
else
console_print(param[0], "%s" , param[1] );
if( iIdx == (strlen(param[1])-1))
iIdx = 0;
else
iIdx++;
}
__________________