SA-MP Forums Archive
Default skin became 48 instead of CJ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: Default skin became 48 instead of CJ (/showthread.php?tid=653984)



Default skin became 48 instead of CJ - DeNCHiK01 - 18.05.2018

Hello everyone!

I have interesting system behaviour on my server:
I have this server.cfg: https://pastebin.com/7UydPmM2

And when I'm connecting and pressing Spawn, this guy comes at the scene:
ID 48 skin becomes the default skin instead of CJ.

Finding the reason
Firstly, I thought it's cause of some includes. No.
Secondly, my gamemode, I made it empty (just a_samp.inc and main()), and that gave me no changes.
Plugins, I thought it's because of YSF: When I removed it from server.cfg CJ came back.
Also renaming the gamemode to the name with bigger amount of symbols helped too.
I didn't get why these things affects on it, but had started to write this topic.

The main reason
While I was writing this topic, I've tried to change the encoding of the config file from UTF8+BOM to Windows1251 and found that the problem is in the total amount of symbols in my server.cfg. Not the plugins, not the mode. Just the amount of symbols.

It sounds like magic, but this is how it is.

If config will be changed with any symbol(s), adding or removing, 48th skin would disappear.

How to simply reproduce it (if you think it's cause of my scripts or something else):
1) Download sa-mp server for windows from sa-mp.com and unzip it
2) Download my config from Pastebin and save it to "UTF8 with BOM" encoding (it's important!). Replace server config with mine.
3) Open new.pwn from /pawno and make it as empty as possible and as you wish. Save it with name test48skin.pwn and compile it. Move amx to gamemodes directory.
4) Launch the server, join it with password written in config and press spawn.

OS on the computer is Windows 7 x64.


Re: Default skin became 48 instead of CJ - Graber - 19.05.2018

This is an issue of your script or another plugin, this section is for SA-MP bugs only.


Re: Default skin became 48 instead of CJ - Rocket16 - 19.05.2018

Look for AddPlayerClass(48, in the pwn file and change it to 0.


Re: Default skin became 48 instead of CJ - DeNCHiK01 - 20.05.2018

Quote:
Originally Posted by AdrianGraber
Посмотреть сообщение
This is an issue of your script or another plugin, this section is for SA-MP bugs only.
My script contains this:
Код:
main()
{
}
No a_samp.inc even, it's just empty. Read topic carefully, please. Check my server.cfg in the topic, please, all the plugins are commented, so no plugins are used.
I think, I can encroach upon this section.

Quote:
Originally Posted by Rocket16
Посмотреть сообщение
Look for AddPlayerClass(48, in the pwn file and change it to 0.
According to what I said above, no AddPlayerClass, I'm not so stupid for this) (As I think, of course)


Re: Default skin became 48 instead of CJ - Graber - 22.05.2018

SA-MP doesn't support UTF-8, you'll get undefined results when using it. Use another encoding. Comments in server.cfg aren't also supported. Who knows what the samp server is getting from that!


Re: Default skin became 48 instead of CJ - DeNCHiK01 - 22.05.2018

Quote:
Originally Posted by AdrianGraber
Посмотреть сообщение
SA-MP doesn't support UTF-8, you'll get undefined results when using it. Use another encoding. Comments in server.cfg aren't also supported. Who knows what the samp server is getting from that!
The interesting thing is that with UTF-8 it works well, CJ appears as always, but with "UTF8 with bom" 48th appears.
So, thank you for you support. Anyway, I don't want to find the solution, how to remove it, it's pretty simple, just need to change something in config. But maybe it would be interestring for someone, what is the reason of this behaviour of SAMP on data I have, cause I don't know it.


Re: Default skin became 48 instead of CJ - Graber - 23.05.2018

I heard something about memory corruption when you put stuff in the echo, maybe it’s that since the UTF stuff will drive SAMP crazy


Re: Default skin became 48 instead of CJ - coool - 17.06.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
48 is the ASCII code for the '0' character. Did you do:

AddPlayerClass('0', ...

Instead of:

AddPlayerClass(0, ...
Hello Sir. Read some comments above. His script does not contain any `AddPlayerClass` only main()