function checkFile(name: player) :: boolean:
if file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist:
return false
else:
return true
function createFile(name: player):
if (checkFile({_name}) is false):
create file "../../../plugins/CommandLog/data/%{_name}%.log"
message "&aCreated %{_name}'s display name%'s log file." to console
function log(name: player, issue: text):
log "%{_name}% issued server command: /%{_issue}%" to "../../../plugins/CommandLog/data/%{_name}%.log"
on join:
createFile(player)
on command:
if event is not cancelled:
set {_cmd} to command
log(player, {_cmd})
Errors
Line 2: Can't understand this condition: 'file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist' (script.sk, line 2: if file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist:')
Line 4: 'else' has to be placed just after an 'if' or 'else if' section (script.sk, line 4: else:')
if file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist:
return false
else:
return true
function createFile(name: player):
if (checkFile({_name}) is false):
create file "../../../plugins/CommandLog/data/%{_name}%.log"
message "&aCreated %{_name}'s display name%'s log file." to console
function log(name: player, issue: text):
log "%{_name}% issued server command: /%{_issue}%" to "../../../plugins/CommandLog/data/%{_name}%.log"
on join:
createFile(player)
on command:
if event is not cancelled:
set {_cmd} to command
log(player, {_cmd})
Errors
Line 2: Can't understand this condition: 'file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist' (script.sk, line 2: if file "../../../plugins/CommandLog/data/%{_name}%.log" dosen't exist:')
Line 4: 'else' has to be placed just after an 'if' or 'else if' section (script.sk, line 4: else:')
Last edited: