help to fix this +rep -
KillerStrike23 - 24.09.2014
well, at the beginning i was trying to create an account id system and no one helped me so i had to create it by my own and i tried to do it but it seems it wont work so any one can give me ideas here is my code
pawn Код:
stock Paccountid(playerid)
{
new string[4], stravl1[128];
new File:countfile = fopen("SFTDM/Server Logs/count.txt", io_write);
fread(countfile, string);
new count = strval(string) + 1;
PlayerInfo[playerid][Accountid] = count;
format(stravl1, sizeof stravl1, "%d", count);
fwrite(countfile, stravl1);
fclose(countfile);
return 1;
}
CMD:register ,,,,
dUserSetINT(PlayerName2(playerid)).("accountid",Paccountid(playerid));
i know there is some issues so please help
P.S at file count the numbers stays 1 it wont pull over!
Re: help to fix this +rep -
Ox1gEN - 24.09.2014
You are trying to make it so the account id will go up by one?
If so I also had this question which I did not know how to like create it but luckily there is mysql, and there is the AUTO_INCREMENT tick.
Re: help to fix this +rep -
KillerStrike23 - 24.09.2014
am trying to save the last account number in a txt file then when another player registers a +1 on the last number i got no another choice ....
Re: help to fix this +rep -
KillerStrike23 - 24.09.2014
bump*
Re: help to fix this +rep -
KillerStrike23 - 25.09.2014
another bump!
Re: help to fix this +rep -
IceBilizard - 25.09.2014
https://sampwiki.blast.hk/wiki/File_Functions
i hope this will help you
Re: help to fix this +rep -
KillerStrike23 - 25.09.2014
bro i had already searched in dat bullshit! i need a code !!!!!!
Re: help to fix this +rep -
YanLanger - 26.09.2014
KillerStrike Stop Bumping I know whats the feeling when no one answers but wait.
Re: help to fix this +rep -
Kane_Phoenix - 26.09.2014
#define FILE_PATH "count.txt"
CountFile()
{
new string[64];
new File:countfile = fopen(FILE_PATH, io_read);
if(countfile)
{
fread(countfile, string);
new count = strval(string);
count ++;
fclose(countfile);
countfile = fopen(FILE_PATH, io_write);
valstr(string,count);
fwrite(countfile,string);
fclose(countfile);
}
}
Re: help to fix this +rep -
KillerStrike23 - 26.09.2014
lol dude where is the +1 ?