10.10.2009, 15:48
printf() function in npc control scripts doesn't print anything to console/log file no matter where it is placed...
Originally Posted by DiDok
printf() function in npc control scripts doesn't print anything to console/log file no matter where it is placed...
|
forward NPCLog(text[]);
public OnPlayerText(playerid,text[])
{
if(IsPlayerNPC(playerid))
{
//If you want to communicate a second function do something like this: EXAMPLE if(!strcmp(text,"NPCLog",false,6)||!strcmp(text,"NPCTimer",false,6))
if(!strcmp(text,"NPCLog",false,6))
{
new tmpstr[128];
format(tmpstr,sizeof(tmpstr),"%.*s",strfind(text," ",true),text);
CallLocalFunction(tmpstr,"s",text[strfind(text," ",true)+1]);
return 0;
}
}
return 1;
}
public NPCLog(text[])print(text);
//instead of print or printf
new tmpstr[128];
format(tmpstr,sizeof(tmpstr),"NPCLog <THIS IS YOUR LOG>");
SendChat(tmpstr);