Raised This Month: $ Target: $400
 0% 

Auto increment number


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 04-01-2014 , 09:13   Auto increment number
Reply With Quote #1

How would you do this in pawn when for example writing to files? Each entry in the file has it's own number. Like the "id" column which you usually see in SQL. First one 1,second 2.. and it keeps going. I can't figure out how, since this would reset when the server is restarted, you'd need to save something in a file? You could save the current number, if for example 2 entries have been added, and the map changes, it is going to write the number 2 to the txt, and when the next entry comes in the next map, it will read the txt file's number and take that and add 2++ as the incremented number for the next entry "3".. But it feels abit unecessary to make a .txt file just to type ONE single number. There's gotta be a better way?
__________________
PM me for private work.



Last edited by Buckshot; 04-01-2014 at 09:27.
Buckshot is offline
Send a message via Skype™ to Buckshot
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode