Script errors
#1

Quote:

stock AddTextToFile(filename[], text[]) {
if(text[0] == EOS) return false;
new File: LSPD = fopen("factions/LSPD.ini", (fexist("factions/LSPD.ini") io_append : io_write));
if(!LSPD) return false;
fwrite(LSPD, text);
fclose(LSPD);

return true;
}

Quote:

error 001: expected token: ")", but found "-identifier-"
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found ")"

All errors are at this line
Quote:

new File: LSPD = fopen("factions/LSPD.ini", (fexist("factions/LSPD.ini") io_append : io_write));

Reply
#2

nvm this
Reply
#3

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
nvm this
What you mean?
Reply
#4

What are you actually trying to do?
Reply
#5

Quote:
Originally Posted by iAnonymous
Посмотреть сообщение
What are you actually trying to do?
I am trying to add player name to a file
Quote:

stock FacAddMemberToFile(playerid) {
new tmp[MAX_PLAYER_NAME + 2];
if(PlayerInfo[playerid][pFaction] == 1){
if(GetPlayerName(playerid, tmp, MAX_PLAYER_NAME)) {
strcat(tmp, "\r\n"); // new line after the name
return AddTextToFile("factions/LSPD.ini", tmp);}
}
return false;
}

Reply
#6

You are missing the question mark after the fexist check.
Reply
#7

EDIT: Fixed..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)