LAdmin Score saving
#1

I am having a huge problem trying to get ladmin to save scores i have edited it like one guy gave an tutorial how to save ladmin scores but it still didnt work now i simply tried to do this but it gives me errors.....

Can someone please give me the correct way to save scores in LAdmin........

}
#if defined SAVE_SCORE
new file:LAdminfile, filepath[256], string[256], Score;
getscore(Score);
format(filepath,sizeof(filepath,"ladmin/users/Score/%s.txt",filename);
LAdminfile = fopen(filepath);
format(string,sizeof(string),"[%d] %s\r\n"Score,text);
fwrite(LAdminfile,string);
fclose(LAdminfile);
#endif

return 1;
}
Reply
#2

What version do you have?
Reply
#3

LAdmin4v2
Reply
#4

Where did you get it?
Reply
#5

off samp forums
Reply
#6

Quote:
Originally Posted by [$A$]W33D$P33D
Посмотреть сообщение
off samp forums
Link?
Reply
#7

Link is below at bottom of page
Reply
#8

Quote:
Originally Posted by [$A$]W33D$P33D
Посмотреть сообщение
"File no longer available"
Reply
#9

Ok this is my edit that i made and please have a look at it and tell me what i did wrong i know it doesnt compile now because i put the #define SAVE_SCORE in if u remove that it compiles it also has all the score saving edits in witch is correct but doesnt work.....

http://pastebin.com/c6xaKHzL
Reply
#10

pawn Код:
SetPlayerScore(playerid, dUserINT(PlayerName2(playerid)).("score"));
Add this to LoginPlayer(playerid)

pawn Код:
LoginPlayer(playerid)
{
    if(ServerInfo[GiveMoney] == 1) {ResetPlayerMoney(playerid); GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }
    dUserSetINT(PlayerName2(playerid)).("loggedin",1);
    PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
    PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
    PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
    PlayerInfo[playerid][hours] = dUserINT(PlayerName2(playerid)).("hours");
    PlayerInfo[playerid][mins] = dUserINT(PlayerName2(playerid)).("minutes");
    PlayerInfo[playerid][secs] = dUserINT(PlayerName2(playerid)).("seconds");
    SetPlayerScore(playerid, dUserINT(PlayerName2(playerid)).("score"));
    PlayerInfo[playerid][Registered] = 1;
    PlayerInfo[playerid][LoggedIn] = 1;
}
Reply
#11

I GET THIS ERROR NOW


F:\GTA-SA\Samp\filterscripts\ladmin4v2.pwn(6805) : error 001: expected token: "#endif", but found "-end of file-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.






LoginPlayer(playerid);
{
if(ServerInfo[GiveMoney] == 1) {ResetPlayerMoney(playerid); GivePlayerMoney(playerid, dUserINT(PlayerName2(playerid)).("money") ); }
dUserSetINT(PlayerName2(playerid)).("loggedin",1);
PlayerInfo[playerid][Deaths] = (dUserINT(PlayerName2(playerid)).("deaths"));
PlayerInfo[playerid][Kills] = (dUserINT(PlayerName2(playerid)).("kills"));
PlayerInfo[playerid][Level] = (dUserINT(PlayerName2(playerid)).("level"));
PlayerInfo[playerid][hours] = dUserINT(PlayerName2(playerid)).("hours");
PlayerInfo[playerid][mins] = dUserINT(PlayerName2(playerid)).("minutes");
PlayerInfo[playerid][secs] = dUserINT(PlayerName2(playerid)).("seconds");
SetPlayerScore(playerid, dUserINT(PlayerName2(playerid)).("score"));
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][LoggedIn] = 1;

}

if(PlayerInfo[playerid][Level] > 0)
{
format(string,sizeof(string),"ACCOUNT: You have been automatically logged in. (Level %d)", PlayerInfo[playerid][Level] );
SendClientMessage(playerid,green,string);
}
else SendClientMessage(playerid,green,"ACCOUNT: You have been automatically logged in.");
}
else SendClientMessage(playerid, green, "ACCOUNT: This nickname is registed, you can now login by typing /login [password]");
}
return 1;
}
Reply
#12

Remove this

pawn Код:
#if defined SAVE_SCORE
new file:LAdminfile, filepath[256], string[256], Score;
getscore(Score);
format(filepath,sizeof(filepath,"ladmin/users/Score/%s.txt",filename);
LAdminfile = fopen(filepath);
format(string,sizeof(string),"[%d] %s\r\n"Score,text);
fwrite(LAdminfile,string);
fclose(LAdminfile);
Reply
#13

I did
Reply
#14

It should look like this

pawn Код:
forward SaveToFile(filename[],text[]);
public SaveToFile(filename[],text[])
{
    #if defined SAVE_LOGS
    new File:LAdminfile, filepath[256], string[256], year,month,day, hour,minute,second;
    getdate(year,month,day); gettime(hour,minute,second);
   
    format(filepath,sizeof(filepath),"ladmin/logs/%s.txt",filename);
    LAdminfile = fopen(filepath,io_append);
    format(string,sizeof(string),"[%d.%d.%d %d:%d:%d] %s\r\n",day,month,year,hour,minute,second,text);
    fwrite(LAdminfile,string);
    fclose(LAdminfile);
    #endif

    return 1;
}
Reply
#15

LOL oops forgot about that thankyou i will go see if it works now will let u know....
Reply
#16

IDK it frustrates me so much ty for your help but it still doesnt save the score im loosing it
Reply
#17

it compiled but still nothing it doesnt save
Reply
#18

TY Man i got it to work you are awsome!!!!
Reply
#19

I am using the old version of Ladmin and its saving score without doing anything.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)