logging commands
#1

hello, today i added a command to log the commands a player uses evrything works fine but i got an npc in the server what uses a command and it spams the logs alot is there a way to not log it for npc's?

this is my script:

Код:
	new name22[MAX_PLAYER_NAME];
	new string22[128];
	GetPlayerName(playerid,name22,sizeof(name22));
	format(string22,sizeof(string22),"%s: %s",name22,cmdtext);
	WriteLog(CMDL,string22);
part of my log:

Код:
[14:45] daXSZbitch: /npcanim
[14:45] daXSZbitch: /npcanim
[14:45] daXSZbitch: /npcanim
[14:46] daXSZbitch: /npcanim
[14:46] daXSZbitch: /npcanim
[14:46] daXSZbitch: /npcanim
[14:47] daXSZbitch: /npcanim
[14:47] daXSZbitch: /npcanim
[14:47] daXSZbitch: /npcanim
[14:48] daXSZbitch: /npcanim
[14:48] daXSZbitch: /npcanim
[14:49] Micka: /pcar
[14:49] daXSZbitch: /npcanim
[14:49] daXSZbitch: /npcanim
[14:50] daXSZbitch: /npcanim
[14:50] Micka: /flip
[14:51] daXSZbitch: /npcanim
[14:51] daXSZbitch: /npcanim
[14:52] daXSZbitch: /npcanim
[14:52] daXSZbitch: /npcanim
[14:52] daXSZbitch: /npcanim
[14:53] samerX: /gggg
[14:53] daXSZbitch: /npcanim
thanks in advance
Reply
#2

Код:
if(!IsPlayerNPC(playerid))
{
  new name22[MAX_PLAYER_NAME];
  new string22[128];
  GetPlayerName(playerid,name22,sizeof(name22));
  format(string22,sizeof(string22),"%s: %s",name22,cmdtext);
  WriteLog(CMDL,string22);
}
Reply
#3

owyeah forgot about that function >.< it works now thanks alot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)