PDA

View Full Version : MySql Skin saving (its been a week)


sscarface
15/02/2017, 04:09 PM
FIXED!

AndreiWow
15/02/2017, 04:53 PM
cache_get_value_int(0, "Skin", PlayerInfo[playerid][Skin]); - Just an example how it should look...

Vince
15/02/2017, 05:29 PM
Why do you create these absolutely humongous arrays?


msg[500] - not even used
query[1000] (1) - max length for that query is 78 characters
query[1000] (2) - max length for that query is 284 characters
playerserial[128] - a gpci string is 41 (40 + null terminator) characters
query[2316] - max length for that query is 84 characters


Do you get the "code size" warning on compilation? Because that is a severe red flag. Using more memory than is assigned will eventually lead to memory corruption which in turn will lead to all sorts of glitches.

sscarface
15/02/2017, 10:23 PM
@Andrei
Thanks.

@vince
I actually created this script before a year and i m scripting it again so. Have to fix it and no it doesn't show any warning or error. Thanks to you for letting me.

But both of your post really didn't help me.

Dokins
15/02/2017, 11:24 PM
It doesn't load players skin but it does save player skin into database.


Generally, skins don't set unless the player is spawned, try setting them OnPlayerSpawn.

Also I don't see where you are doing TogglePlayerSpectating(playerid, 1);


public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, 1);

sscarface
16/02/2017, 12:12 AM
Generally, skins don't set unless the player is spawned, try setting them OnPlayerSpawn.

Also I don't see where you are doing TogglePlayerSpectating(playerid, 1);


public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid, 1);


I do save player data including skin under PlayerDisconnect. Isn't same thing if i do save player skin after spawned or under PlayerDisconnect? Does it matter?