SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Bug Reports

Reply
 
Thread Tools Display Modes
Old 18/05/2018, 05:07 PM   #1
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 13
Reputation: 0
Default Default skin became 48 instead of CJ

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.

Last edited by DeNCHiK01; 21/05/2018 at 11:27 PM.
DeNCHiK01 is offline   Reply With Quote
Old 19/05/2018, 03:49 PM   #2
Graber
Big Clucker
 
Graber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 112
Reputation: 125
Default Re: Default skin became 48 instead of CJ

This is an issue of your script or another plugin, this section is for SA-MP bugs only.
Graber is offline   Reply With Quote
Old 20/05/2018, 12:23 AM   #3
Rocket16
Little Clucker
 
Join Date: Feb 2016
Posts: 38
Reputation: 9
Default Re: Default skin became 48 instead of CJ

Look for AddPlayerClass(48, in the pwn file and change it to 0.
__________________
Rocket16 is offline   Reply With Quote
Old 20/05/2018, 09:07 PM   #4
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 13
Reputation: 0
Default Re: Default skin became 48 instead of CJ

Quote:
Originally Posted by AdrianGraber View Post
This is an issue of your script or another plugin, this section is for SA-MP bugs only.
My script contains this:
Code:
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 View Post
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)
DeNCHiK01 is offline   Reply With Quote
Old 22/05/2018, 03:53 PM   #5
Graber
Big Clucker
 
Graber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 112
Reputation: 125
Default Re: Default skin became 48 instead of CJ

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!
Graber is offline   Reply With Quote
Old 22/05/2018, 05:19 PM   #6
DeNCHiK01
Little Clucker
 
Join Date: Jun 2013
Posts: 13
Reputation: 0
Default Re: Default skin became 48 instead of CJ

Quote:
Originally Posted by AdrianGraber View Post
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.
DeNCHiK01 is offline   Reply With Quote
Old 23/05/2018, 09:38 AM   #7
Graber
Big Clucker
 
Graber's Avatar
 
Join Date: Mar 2013
Location: Germany
Posts: 112
Reputation: 125
Default Re: Default skin became 48 instead of CJ

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
Graber is offline   Reply With Quote
Old 17/06/2018, 02:27 PM   #8
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,241
Reputation: 3185
Default Re: Default skin became 48 instead of CJ

48 is the ASCII code for the '0' character. Did you do:

AddPlayerClass('0', ...

Instead of:

AddPlayerClass(0, ...
Y_Less is online now   Reply With Quote
Old 17/06/2018, 04:32 PM   #9
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 586
Reputation: 39
Default Re: Default skin became 48 instead of CJ

Quote:
Originally Posted by Y_Less View Post
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()
__________________
coool is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skin changeCommand works but doesnt change skin SkillNasr Scripting Help 4 27/06/2016 08:16 PM
How i can add all default skins in skin selection CarRamper Scripting Help 1 18/06/2016 05:10 AM
deleting this object from my skin isnt working, using the default samp attachments.pwn niels44 Scripting Help 6 12/12/2012 08:20 PM


All times are GMT. The time now is 04:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.