How to do....
#1

Can someone help me to make a code that if:

player X kills player Y with a Z

X = killer
Y = deather(?) --> I know im an idiot
Z = weapon name

I need it will save in a file "kills.txt"
how to do that
give me an example
tanks
Reply
#2

Well it automaticly saves into your server_log, I don't know any other ways.
In server_log you'd get something like this

[16:59:42] [kill] [JB]sicko killed Chio M4
Reply
#3

pawn Код:
//OnPlayerDeath.
new
  iArray[32];
GetWeaponName(reason,iArray,sizeof(iArray));
format(string,sizeof(string),"%s killed %s using %s.",killeridname,playeridname,iArray);
SendClientMessageToAll(color,string);
Reply
#4

Quote:
Originally Posted by MenaceX^
pawn Код:
//OnPlayerDeath.
new
  iArray[32];
GetWeaponName(reason,iArray,sizeof(iArray));
format(string,sizeof(string),"%s killed %s using %s.",killeridname,playeridname,iArray);
SendClientMessageToAll(color,string);
he wants it to be saved in a file tho..
Reply
#5

Quote:
Originally Posted by MenaceX^
pawn Код:
//OnPlayerDeath.
new
  iArray[32];
GetWeaponName(reason,iArray,sizeof(iArray));
format(string,sizeof(string),"%s killed %s using %s.",killeridname,playeridname,iArray);
SendClientMessageToAll(color,string);
It wont save in a file
and i dont want server log I need extra file
maybe to use dini?
Reply
#6

Bump
i know its not 12 hours but its 4th page
please help
Reply
#7

pawn Код:
new
  str[64];
format(str,str(str),"%s\r\n",string);
new File:hFile;
hFile=fopen("log.log",io_append);
fwrite(hFile,str);
fclose(str);
Reply
#8

Quote:
Originally Posted by MenaceX^
pawn Код:
new
  str[64];
format(str,str(str),"%s\r\n",string);
new File:hFile;
hFile=fopen("log.log",io_append);
fwrite(hFile,str);
fclose(str);
where to add that?
Reply
#9

Quote:
Originally Posted by nuriel8833
where to add that?
read his first post


public OnPlayerDeath
Reply
#10

So to connect the both codes together?

pawn Код:
new
  str[64];
new
  iArray[32];
GetWeaponName(reason,iArray,sizeof(iArray));
format(string,sizeof(string),"%s killed %s using %s.",killeridname,playeridname,iArray);
SendClientMessageToAll(color,string);

format(str,str(str),"%s\r\n",string);
new File:hFile;
hFile=fopen("log.log",io_append);
fwrite(hFile,str);
fclose(str);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)