Originally Posted by M4D
i've explained with comments
pawn Код:
//>Define a new variable that store "States" Field info into it new pState[56]; //>Store data into "pState" Variable cache_get_field_content(0, "States", pState,/*connectionHandle*/, sizeof(pState)); //>Your Enum :D enum pStateInfo { Float:health, Float:armour, Float:position[3], interior, world } new pCurrentState[pStateInfo]; //now Separate Data from pState Variable into Enum Variables sscanf(pState, "fP<,>fP<,>fP<,>fP<,>fP<,>iP<,>i", pCurrentState[health], pCurrentState[armour], pCurrentState[position[0]], pCurrentState[position[1]], pCurrentState[position[2]], pCurrentState[interior], pCurrentState[world]); //now you finished...stored "States" field information into enum variables...
NOTE: Your information into "States" Field MUST be like this: 100.0,100.0,0.0,0.0,0.0,0,0
i mean DON't put "Space" between floats and ,
for example don't save them like this: 100.0, 100.0, 0.0, 0.0,................
if you want to save them like this you have to put a space after , between < and > in the sscanf function...
|