Set level cmd
#1

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
Reply
#2

invalid file handling crashes your server make sure that you have the log file specified in your code in the scriptfiles/logs directory
Reply
#3

Hi Sreyas !!

No i don't have this directory "scriptfiles/logs" and i didn't use it in my script
Reply
#4

Код:
 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(_)
Reply
#5

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);
Reply
#6

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 ?
Reply
#7

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
Reply
#8

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)
Reply
#9

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
Reply
#10

Log("logs/makeadmin.log", string);

THANKS Sreyas it's FIXED !!!

now i need the last one ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)