[BUG] a_npc printf
#1

printf() function in npc control scripts doesn't print anything to console/log file no matter where it is placed...
Reply
#2

Quote:
Originally Posted by DiDok
printf() function in npc control scripts doesn't print anything to console/log file no matter where it is placed...
because the npcs run with samp_npc.exe and so the npcmodes cant print anything to samp-server.exe
Reply
#3

Then why the hell it is in a_npc include? O.o
Reply
#4

Calm it... I'm pretty sure it prints to SAMP_NPC.EXE
Reply
#5

any answers to this question?
Reply
#6

I suppose you can try ******' method of cross communication between gamemode and npcmode.

gamemode
pawn Код:
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);
npcmode
pawn Код:
//instead of print or printf
new tmpstr[128];
format(tmpstr,sizeof(tmpstr),"NPCLog <THIS IS YOUR LOG>");
SendChat(tmpstr);
*Warning: Untested work can lead to unwanted behavior*
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)