SA-MP Forums Archive
Script errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Script errors (/showthread.php?tid=576842)



Script errors - hhaaoo123 - 07.06.2015

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));




Re: Script errors - JaydenJason - 07.06.2015

nvm this


Re: Script errors - hhaaoo123 - 07.06.2015

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


Re: Script errors - iAnonymous - 07.06.2015

What are you actually trying to do?


Re: Script errors - hhaaoo123 - 07.06.2015

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;
}




Re: Script errors - Vince - 07.06.2015

You are missing the question mark after the fexist check.


Re: Script errors - hhaaoo123 - 07.06.2015

EDIT: Fixed..