[SAVE SCORE]
#1

How to save your score on /q ?
Reply
#2

Do you even have a Register and Login system in your gamemode?
Reply
#3

Quote:
Originally Posted by FabianoC
Посмотреть сообщение
How to save your score on /q ?
have the players score in a variable then save it with either SQLite, mySQL, Dini or Y_ini
you need to give us more details of what you use to save values like players money, health etc on your server. it could be any one of the above.... and also like king said you should already have a login register system in place.
Reply
#4

Firstly, you will need a login and register system i suggest if you are new to scripting in general to use y_ini infact the post above has a very good blank y_ini gamemode released on his website you should download it if you want to get started next you need the players vars for example PlayerInfo[playerid][pScore], then you will need to open your file, then inside, Score = GetPlayerScore, then depending on which you use;

pawn Код:
INI_WriteInt(File,"Score",Score);
I think that is correct long time since i used y_ini.
Reply
#5

It's actually quiet simpel, we got our Level (when you open TAB) to +1 lvl each time we kill someone, if we disconnect it resets to 0, but in the userfiles it saves, but when we reconnect it doesn't load the scores.

It's for a Unique DM script, any register / login system suggestions?
Reply
#6

Currently we are using this:

PHP код:
new Score[MAX_PLAYERS]; 
PHP код:
    if(!dini_Exists("Score.cfg"))
    {
        
dini_Create("Score.cfg");
    }
    return 
1;

In Onplayerconnect:

PHP код:
Score[playerid] = dini_Int("Score.cfg"Pname); 
In Onplayerdisconnect:

PHP код:
dini_IntSet("Score.cfg"PnameScore[playerid]); 
PHP код:
stock NewGetPlayerScore(playerid)
{
    
Score[playerid] = Score[playerid] + GetPlayerScore(playerid); 
    return 
Score[playerid]; 

Reply
#7

wait why i you using score.cfg? This wont save to your players file, i suggest you read some tutorials also if you don't mind please use [ pawn ] instead of [ php ]
Reply
#8

Quote:
Originally Posted by xMichaelx
Посмотреть сообщение
wait why i you using score.cfg? This wont save to your players file, i suggest you read some tutorials also if you don't mind please use [ pawn ] instead of [ php ]
Why can't i give -1 rep? This doesn't help actually...
Reply
#9

Your question was "How do i save score on /q" you gave very little information, my "wait why are you using score.cfg?" was because you have left out a lot of information, you need to include which file saving system you use for example y_ini, dini etc.. Without that information no one can really give the correct information, if you don't have a file saving system but want one i can link you to some tutorials which will show you all you need to know.

The [ pawn ]: This was an off topic comment basically makes the code more readable and the right colors, as when i read a code i scan read it, was just a comment please don't take it personally.

Thanks,

-Michael
Reply
#10

Quote:
Originally Posted by xMichaelx
Посмотреть сообщение
Your question was "How do i save score on /q" you gave very little information, my "wait why are you using score.cfg?" was because you have left out a lot of information, you need to include which file saving system you use for example y_ini, dini etc.. Without that information no one can really give the correct information, if you don't have a file saving system but want one i can link you to some tutorials which will show you all you need to know.

The [ pawn ]: This was an off topic comment basically makes the code more readable and the right colors, as when i read a code i scan read it, was just a comment please don't take it personally.

Thanks,

-Michael
Its Dini, it saves the kills in exactly the same way.

Why is it different for the Score?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)