23.12.2014, 08:40
Hello guys, I have got some troubles on sscanf.
I'd +rep for you if you got any idea.
sorry my bad English.
This is my register system using Mysql system. // give thanks for BlueG.
I have a easy metod.
Thanks for everyone who joinning this discussion.
I'd +rep for you if you got any idea.
sorry my bad English.
This is my register system using Mysql system. // give thanks for BlueG.
pawn Код:
new pState[56];
cache_get_field_content(0, "States", currentState, 1, sizeof(pState));
// I create a string and get info from Mysql.
// it contains info of Float:health, Float:armour, Float:postionX, Float:postionY, Float:postionZ, interiror, world.
// like "100.0, 100.0, 0.0, 0.0, 0.0, 0, 0";
// Now I create a enum called pStateInfo;
enum pStateInfo {
Float:health,
Float:armour,
Float:position[3],
interior,
world
}
new pCurrentState[pStateInfo];
// I want use sscanf for cutting this string.
sscanf(currentState, "", pCurrentState);
// but how I input this?
pawn Код:
new currentState[56];
cache_get_field_content(0, "States", currentState, 1, 56);
enum pCurrentInfo {
Float:health,
Float:armour,
Float:positionX,
Float:positionY,
Float:positionZ,
interior,
world
}
new pCurrentState[pCurrentInfo];
sscanf(currentState, "p<,>e<5f2i>", pCurrentState);