View Single Post
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 09-19-2017 , 11:41   Re: Set pack position on end not working
Reply With Quote #5

Quote:
Originally Posted by Neuro Toxin View Post
You could try using Dynamic (linked in my signature) or a plan Trie.
This library looking good, but i dont wanna use it only for 1 callback.

Quote:
Originally Posted by Fyren View Post
The longer answer is I guess you can save the position of the last thing you wrote, then later set the position to that, then read that again to end up with the position being at the end. It also looks like SM's tracking of the datapack size will be wrong if you rewrite earlier portions of the datapack and not at the very end.
Probably use this method, but is there way to get rid of that warning: warning 204: symbol is assigned a value that is never used: "five"

PHP Code:
    // Create DataPack
    
DataPack pack CreateDataPack();
    
    
// Write data to DataPack
    
pack.WriteCell(client);
    
pack.WriteString("test");
    
DataPackPos pos pack.Position;
    
pack.WriteCell(5);
    
    
// Reset DataPack
    
pack.Reset();
    
    
// Read only client id
    
int client2 pack.ReadCell();
    
    
// Set position to end
    
pack.Position pos;
    
int five pack.ReadCell();
    
    
// Write new data to the end
    
pack.WriteCell(6); 

Last edited by hh2; 09-19-2017 at 11:41.
hh2 is offline