26.06.2018, 04:15
Hi everyone, I made this code to add the DFF names on each line, but it is not coming out correctly, when I add 2 lines to rename just rename 1, when I add 3 lines just rename 2 and so on.
Can anybody help me ?
Result: https://imgur.com/a/dRd1cxk
Can anybody help me ?
Код:
#define dummy "dummy"
stock RenameIPL(FileName[], Code[])
{
new File:File, String[1000], String2[1000];
format(String,sizeof(String),"Object Renamed/%s.txt", FileName);
format(String2,sizeof(String2),"%s\r\n", Code);
File = fopen(String, io_append);
fwrite(File, String2);
fclose(File);
return 1;
}
stock RenameDummy(ID, DFFName[50], Interior, Float:X,Float:Y,Float:Z, Float:RX,Float:RY,Float:RZ,Float:RR)
{
if(ID == 1001) {DFFName = "House1";}
if(ID == 1002) {DFFName = "House2";}
new String[1000];
format(String,sizeof(String),"%d, %s, %d, %f,%f,%f, %f,%f,%f,%f, -1", ID, DFFName, Interior, X,Y,Z, RX,RY,RZ,RR);
RenameIPL("IPL_Renamed", String);
return 1;
}
public OnGameModeInit()
{
RenameDummy(1001, dummy, 0, 2760.900400, 1219.700200, 11.200000, 0, 0, 0.71937011, 0.69462698);
RenameDummy(1002, dummy, 0, 2760.900400, 1219.700200, 11.200000, 0, 0, 0.71937011, 0.69462698);
return 1;
}

