Set level cmd - 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: Set level cmd (
/showthread.php?tid=618061)
Set level cmd -
Yaa - 30.09.2016
Hello !!
when i try to use /setlevel the server crash and i got some things in logs
Quote:
[17:23:27] [debug] Server crashed while executing sap.amx
[17:23:27] [debug] AMX backtrace:
[17:23:27] [debug] #0 native fwrite () from samp-server.exe
[17:23:27] [debug] #1 0000ad40 in ?? (1392136, 1625152) from sap.amx
[17:23:27] [debug] #2 0000d124 in public cmd_setlevel (0, 1609540) from sap.amx
[17:23:27] [debug] #3 native CallLocalFunction () from samp-server.exe
[17:23:27] [debug] #4 000006c8 in public OnPlayerCommandText (0, 1609484) from sap.amx
[17:23:27] [debug] Native backtrace:
[17:23:27] [debug] #0 76faaeb3 in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[17:23:27] [debug] #1 00498bb8 in ?? () from samp-server.exe
[17:23:27] [debug] #2 0040531e in ?? () from samp-server.exe
|
The Cmd :
http://pastebin.com/Qhc3KXUN
Thanks
Yaa
Re: Set level cmd -
SyS - 30.09.2016
invalid file handling crashes your server make sure that you have the log file specified in your code in the scriptfiles/logs directory
Re: Set level cmd -
Yaa - 30.09.2016
Hi Sreyas !!
No i don't have this directory "scriptfiles/logs" and i didn't use it in my script
Re: Set level cmd -
SyS - 30.09.2016
Код:
Log("logs/makeadmin.log", string);
i saw that part in your script ^^ try making a directory like that ("logs" folder in scriptfiles)
and if that didnt work show that function Log(_)
Re: Set level cmd -
Konstantinos - 30.09.2016
In
Log function, it should be like:
pawn Код:
new File: fhandle = fopen(...);
if (fhandle) // file was opened
{
// file functions..
fclose(fhandle);
}
Most people do it like this (which is
wrong):
pawn Код:
new File: fhandle = fopen(...);
// file functions..
fclose(fhandle);
Re: Set level cmd -
Yaa - 30.09.2016
Quote:
Originally Posted by Konstantinos
In Log function, it should be like:
pawn Код:
new File: fhandle = fopen(...);
if (fhandle) // file was opened { // file functions.. fclose(fhandle); }
Most people do it like this (which is wrong):
pawn Код:
new File: fhandle = fopen(...);
// file functions.. fclose(fhandle);
|
What do u mean ?
Re: Set level cmd -
Yaa - 30.09.2016
Quote:
Originally Posted by Sreyas
Код:
Log("logs/makeadmin.log", string);
i saw that part in your script ^^ try making a directory like that ("logs" folder in scriptfiles)
and if that didnt work show that function Log(_)
|
lemme try this
Re: Set level cmd -
SyS - 30.09.2016
Quote:
Originally Posted by Yaa
What do u mean ?
|
he meant the output or input stream of a file should be done when if it exists (directory) or opened correctly and most people wont check whether file specified is opened for IO operations if that check is avoided it will crash the server (meaning of invalid file handling)
Re: Set level cmd -
Yaa - 30.09.2016
How i can remove this prints from my gamemode console ??
Iter_OnGameModeInit: 1000
Iter_OnGameModeInit: first
and i got smthings when player connect
Quote:
Iter_OnPlayerConnect: 0
[debug] Run time error 4: "Array index out of bounds"
[debug] Accessing element at index 14 past array upper bound 13
[debug] AMX backtrace:
[debug] #0 000598bc in ?? (0) from sap.amx
[debug] #1 0003a300 in public SSCANF_OnPlayerConnect (0) from sap.amx
[debug] #2 000027d0 in public Itter_OnPlayerConnect (0) from sap.amx
[debug] #3 native CallLocalFunction () from samp-server.exe
[debug] #4 00001644 in public OnPlayerConnect (0) from sap.amx
Iter_OnPlayerConnect end
|
Connect Code :
http://pastebin.com/w2mnZprB
Re: Set level cmd -
Yaa - 30.09.2016
Log("logs/makeadmin.log", string);
THANKS Sreyas it's FIXED !!!
now i need the last one
^^^^^^^^^^^^^^^^^^^^^^^^^^^^