05.02.2015, 07:21
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:
And, the /skills command:
I've tried to re-make the command with 3 variables, to re-write the /skills command, nothing helped at all..
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);
Код:
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; }