SA-MP Forums Archive
Skill loading problem - 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: Skill loading problem (/showthread.php?tid=561808)



Skill loading problem - Kruzz - 05.02.2015

I've made a farming skill system with sscanf(I also tried a normal one, with 3 variables), but the variables gone crazy.
I've done some debug, so I've got this:
When you login, the variables looks normally. (how i've set them)
After 1-5 seconds, they gone crazy, like 50, 55, 60 etc, for no reason.

The loading part:
Код:
new farmskill[128];
			cache_get_field_content( 0, "FarmingInfo", farmskill);
			sscanf(farmskill, dfSScanfSkillSyntax, PlayerInfo[playerid][pTest][0], PlayerInfo[playerid][pTest][1], PlayerInfo[playerid][pTest][2]);
			
			format(szMessage, sizeof(szMessage), "%d, %d, %d", PlayerInfo[playerid][pTest][0], PlayerInfo[playerid][pTest][1], PlayerInfo[playerid][pTest][2]);
			SCM(playerid, -1, szMessage);
And, the /skills command:

Код:
YCMD:skills(playerid, params[], help)
{
	SendClientMessage(playerid, -1, "-------------Skills-------------");
	if(PlayerInfo[playerid][pTest][0] < 6)
	{
		format(szMessage, sizeof(szMessage), "Farmer skill: %d/6 (%d bags of flour transported) - bags needed for next skill: %d", PlayerInfo[playerid][pTest][0], PlayerInfo[playerid][pTest][1], PlayerInfo[playerid][pTest][2]);
		SendClientMessage(playerid, -1, szMessage);
	}
	else
	{
		format(szMessage, sizeof(szMessage), "Farmer skill: %d/6 (%d bags of flour transported)", PlayerInfo[playerid][pTest][0], PlayerInfo[playerid][pTest][1]);
		SendClientMessage(playerid, -1, szMessage);
	}
	return 1;
}
I've tried to re-make the command with 3 variables, to re-write the /skills command, nothing helped at all..


Re: Skill loading problem - Kruzz - 05.02.2015

Solved...