help of score
#1

hey guys when im killing someone in my srv i will get score but when i relog it will gone so how can i save my scres in sript files ladmin\user\ini.sav
Reply
#2

Use an INI saver.
Reply
#3

Use Y_Ini or Dini for saving or if u r able to use mysql, then use that
Reply
#4

Do you have Register & Login System in your server?

If yes, you can save it on OnPlayerDisconnect() callback.

If not, create your own Register & Login System
Reply
#5

guys can i get code bcoz i dont know so much scripting and i have register and login system im using satdm
Reply
#6

First do
at the top of script
pawn Код:
#include <dini>
pawn Код:
enum pInfo
{
score
}
Then go on
pawn Код:
public OnPlayerConnect(playerid)
{
SetPlayerScore(playerid,0);
}
Now do for save stats
pawn Код:
SStats(playerid)
{
dini_IntSet(Pos(playerid),"Score",GetPlayerScore(playerid));
}
Now go for load stats
pawn Код:
LoadStats(playerid)
{
SetPlayerScore(playerid, dini_Int(Pos(playerid),"Score"));
}
After this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 for(new i=0; i<MAX_PLAYERS; i++)
 {
       PlayerInfo[i][Score] +=25;//or what you want
 }
}
in Last do
pawn Код:
public OnGameModeInit()
{
LoadStats(playerid);
}
Reply
#7

ty you so much +1 rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)