09.05.2014, 05:59
Hello Guys, i got a problem hope you can help me, my last thread wasn't answered and now its on thrash..
When im joining my server and increase my score for example "50" and then i quit then rejoin again, my score backs to "0" . I know this is because of the gamemode, it doesn't save some stats.. Please Help me
this is all i found on my gamemode about stats
this stats always giving me if i quit and rejoin.. i mean if i quit my money, score is gone, and join again this gives me, 5k bank cash and 7.5k hand cash
When im joining my server and increase my score for example "50" and then i quit then rejoin again, my score backs to "0" . I know this is because of the gamemode, it doesn't save some stats.. Please Help me
this is all i found on my gamemode about stats
Код:
//Saved Stats if(SavedWantedLevel[playerid] != 0) { SetPlayerWantedLevel(playerid,SavedWantedLevel[playerid]); SavedWantedLevel[playerid] =0; SendClientMessage(playerid,COLOR_RED,"You have left the server while wanted. Wanted level restored."); } if(SavedJailTime[playerid] != 0) { TextDrawShowForPlayer(playerid,JailTimer[playerid]); ResetPlayerWeapons(playerid); new rnd = random(sizeof(JailSpawnPoints)); JailTime[playerid] =SavedJailTime[playerid]; IsCuffed[playerid] =0; CuffTime[playerid] =0; TotalJailTime[playerid] =SavedJailTime[playerid]; SetPlayerInterior(playerid,10); SetPlayerPos(playerid,JailSpawnPoints[rnd][0],JailSpawnPoints[rnd][1],JailSpawnPoints[rnd][2]); SetPlayerFacingAngle(playerid,JailSpawnPoints[rnd][3]); TogglePlayerControllable(playerid,1); StopLoopingAnim(playerid); SetPlayerWantedLevel(playerid,0); SetPlayerToTeamColour(playerid); SavedJailTime[playerid] =0; SendClientMessage(playerid,COLOR_RED,"You have left the server while in jail. You must finish your sentence."); format(string,sizeof(string),"[AUTO JAIL] %s(%d) has been auto jailed for leaving the server while in jail. He will finish his sentence.",PlayerName(playerid),playerid); SendClientMessageToAll(COLOR_ADMIN,string); format(string,sizeof(string),"9[AUTO JAIL] %s(%d) has been auto jailed for leaving the server while in jail. He will finish his sentence.",PlayerName(playerid),playerid); IRC_GroupSay(gGroupID,IRC_CHANNEL,string); } //Set Variables IsSpawned[playerid] =1; return 1; }
Код:
if(dialogid == DIALOG_LOGIN) { if (response == 0) { SendClientMessage(playerid,COLOR_ERROR,"You must login before playing on this server."); ShowLoginScreen(playerid); return 1; } if (response == 1) { if (strlen(inputtext) == 0) { SendClientMessage(playerid,COLOR_ERROR,"Please enter your password for your account in the box below."); ShowLoginScreen(playerid); return 1; } if (udb_CheckLogin(PlayerName(playerid),inputtext)) { BankCash[playerid] =dUserINT(PlayerName(playerid)).("Bankcash"); GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("Money")-GetPlayerMoney(playerid)); SetPlayerScore(playerid,dUserINT(PlayerName(playerid)).("Score")-GetPlayerScore(playerid)); CanUseArmy[playerid] =dUserINT(PlayerName(playerid)).("Army"); CanUseCIA[playerid] =dUserINT(PlayerName(playerid)).("CIA"); AdminLevel[playerid] =dUserINT(PlayerName(playerid)).("Adminlevel"); IsRegularPlayer[playerid] =dUserINT(PlayerName(playerid)).("RegularPlayer"); NameBanned[playerid] =dUserINT(PlayerName(playerid)).("Nameban"); DrugHouseOwner[playerid] =dUserINT(PlayerName(playerid)).("DrugHouseOwner"); OttoOwner[playerid] =dUserINT(PlayerName(playerid)).("OttoOwner"); TerroristSkill[playerid] =dUserINT(PlayerName(playerid)).("TSkill"); RobSkill[playerid] =dUserINT(PlayerName(playerid)).("RobSkill"); HasPackC4[playerid] =dUserINT(PlayerName(playerid)).("HasPackC4"); HasPackRope[playerid] =dUserINT(PlayerName(playerid)).("HasPackRope"); HasPackMoney[playerid] =dUserINT(PlayerName(playerid)).("HasPackMoney"); SavedWantedLevel[playerid] =dUserINT(PlayerName(playerid)).("SavedWantedLevel"); SavedJailTime[playerid] =dUserINT(PlayerName(playerid)).("SavedJailTime"); new pIp[16]; GetPlayerIp(playerid, pIp, sizeof(pIp)); dUserSet(PlayerName(playerid)).("IP", pIp); PLAYERLIST_authed[playerid]=true; return SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have successfully logged in! Your previous stats have been restored."); } ShowLoginScreen(playerid); CheckPasswordAttempts(playerid); } return 1; }
Код:
if(dialogid == DIALOG_REGISTER) { if (response == 0) { SendClientMessage(playerid,COLOR_ERROR,"You must register before playing on this server."); ShowRegisterScreen(playerid); return 1; } if (response == 1) { if (udb_Exists(PlayerName(playerid))) { SendClientMessage(playerid,COLOR_ERROR,"This account already exists, please choose a different player name."); return 1; } if (strlen(inputtext)==0) { SendClientMessage(playerid,COLOR_ERROR,"Please enter your password in the box to register in this server."); ShowRegisterScreen(playerid); return 1; } if (udb_Create(PlayerName(playerid),inputtext)) { SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have registered, now please enter your password in the box to login."); ShowLoginScreen(playerid); PLAYERLIST_authed[playerid]=true; dUserSetINT(PlayerName(playerid)).("Money",7500); dUserSetINT(PlayerName(playerid)).("Bankcash",5000); dUserSetINT(PlayerName(playerid)).("Score",0); dUserSetINT(PlayerName(playerid)).("Adminlevel",0); dUserSetINT(PlayerName(playerid)).("Nameban",0); dUserSetINT(PlayerName(playerid)).("Army",0); dUserSetINT(PlayerName(playerid)).("CIA",0); dUserSetINT(PlayerName(playerid)).("RegularPlayer",0); dUserSetINT(PlayerName(playerid)).("Nameban",0); dUserSetINT(PlayerName(playerid)).("DrugHouseOwner",0); dUserSetINT(PlayerName(playerid)).("OttoOwner",0); dUserSetINT(PlayerName(playerid)).("TSkill",0); dUserSetINT(PlayerName(playerid)).("RobSkill",0); dUserSetINT(PlayerName(playerid)).("HasPackC4",0); dUserSetINT(PlayerName(playerid)).("HasPackRope",0); dUserSetINT(PlayerName(playerid)).("HasPackMoney",0); dUserSetINT(PlayerName(playerid)).("SavedJailTime",0); dUserSetINT(PlayerName(playerid)).("SavedWantedLevel",0); new pIp[16]; GetPlayerIp(playerid, pIp, sizeof(pIp)); dUserSet(PlayerName(playerid)).("IP", pIp); } return true; } return 1; }