#include <a_samp>#include <dini>public OnPlayerConnect(playerid){ new str[MAX_PLAYER_NAME]; GetPlayerName(playerid, str, 24); if(dini_Exists(str)) SetPlayerScore(playerid, dini_Int(str, \"Score\")); return 1;}public OnPlayerDisconnect(playerid, reason){ new str[MAX_PLAYER_NAME]; GetPlayerName(playerid, str, 24); if(!dini_Exists(str)) dini_Create(str); dini_IntSet(str, \"Score\", GetPlayerScore(playerid)); return 1;}
Megírtam FS -ben, dini szükséges hozzá: #include <a_samp>#include <dini>public OnPlayerConnect(playerid){ new str[MAX_PLAYER_NAME]; GetPlayerName(playerid, str, 24); if(dini_Exists(str)) SetPlayerScore(playerid, dini_Int(str, \"Score\")); return 1;}public OnPlayerDisconnect(playerid, reason){ new str[MAX_PLAYER_NAME]; GetPlayerName(playerid, str, 24); if(!dini_Exists(str)) dini_Create(str); dini_IntSet(str, \"Score\", GetPlayerScore(playerid)); return 1;}
ladmin4v2 tudtommal menti
ladmin4v2 tudtommal menti a kileket, de mást nem.amúgy az eredeti ladmin nem menti, csak amelyikbe bele van írva.nekem is ez a gond vele. [/quote]Az eredeti ladmin menti a kill-eket, csak loginnál nem adja vissza, de folyamatosan menti csak bele kellene nézni egy regisztrációs fájlba valami szövegszerkesztõvel.Amúgy egy kis idézet a forrás fájlból: SavePlayer(playerid){ dUserSetINT(PlayerName2(playerid)).(\"money\",GetPlayerMoney(playerid)); dUserSetINT(PlayerName2(playerid)).(\"kills\",PlayerInfo[playerid][Kills]); dUserSetINT(PlayerName2(playerid)).(\"deaths\",PlayerInfo[playerid][Deaths]);[/quote]És ha már itt tartok akkor tovább folytatva loginkor be is tölti: 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\"));[/quote]Akkor mi hiányzik, az hogy nem állítja be játék közben a pontot? SetPlayerScore(playerid, PlayerInfo[playerid][Kills]);
SavePlayer(playerid){ dUserSetINT(PlayerName2(playerid)).(\"money\",GetPlayerMoney(playerid)); dUserSetINT(PlayerName2(playerid)).(\"kills\",PlayerInfo[playerid][Kills]); dUserSetINT(PlayerName2(playerid)).(\"deaths\",PlayerInfo[playerid][Deaths]);[/quote]És ha már itt tartok akkor tovább folytatva loginkor be is tölti: 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\"));[/quote]Akkor mi hiányzik, az hogy nem állítja be játék közben a pontot? SetPlayerScore(playerid, PlayerInfo[playerid][Kills]);
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\"));[/quote]Akkor mi hiányzik, az hogy nem állítja be játék közben a pontot? SetPlayerScore(playerid, PlayerInfo[playerid][Kills]);
SetPlayerScore(playerid, PlayerInfo[playerid][Kills]);
#include <a_samp>#include <dini>public OnPlayerConnect(playerid){ new pname[MAX_PLAYER_NAME]; new plyname[48]; GetPlayerName(playerid, pname, sizeof(pname)); format(plyname, sizeof(plyname), \"A MAPPA AHOVA MENTI A JATEKOSOKAT/%s.ini\",pname); if(!dini_Exists(plyname)) { dini_Create(plyname); dini_IntSet(plyname, \"score\", 0); SetPlayerScore(playerid, dini_Int(plyname, \"score\")); } else { SetPlayerScore(playerid, dini_Int(plyname, \"score\")); } return 1;}OnPlayerDisconnect(playerid){dini_IntSet(plyname, \"score\", GetPlayerScore(playerid));return 1;}
#include < a_samp >#include < dini >new iName[ MAX_PLAYER_NAME ], File[ 50 ];public OnPlayerConnect( playerid ){ GetPlayerName( playerid, iName, MAX_PLAYER_NAME ); format( File, sizeof( File ), \" Score/%s.ini \", iName); if( !dini_Exists( File ) ) { dini_Create( File ); dini_IntSet( File, \" Pont \", 0 ); SetPlayerScore(playerid, dini_Int( File, \" Pont \" ) ); } else return SetPlayerScore( playerid, dini_Int( File, \" Pont \" ) ); return 1;}public OnPlayerDisconnect( playerid ){ GetPlayerName( playerid, iName, MAX_PLAYER_NAME ); format( File, sizeof( File ), \" Score/%s.ini \", iName); dini_IntSet( File, \" Pont \", GetPlayerScore( playerid ) ); return 1;}
#include <a_samp>#include <dini>new file[128];stock getn(p){ new n[24]; GetPlayerName(playerid,n,24); return n;}public OnPlayerConnect(playerid){ format(file,128,\"%s.sav\",getn(playerid)) if(!dini_Exists(file)) { SetPlayerScore(playerid, dini_Int(playerid,\"Score\")); } else dini_Create(file), dini_IntSet(playerid,\"Score\", GetPlayerScore(playerid)); return 1;}public OnPlayerDisconnect(playerid,reason){ format(file,128,\"%s.sav\",getn(playerid)) dini_IntSet(file,\"Score\",GetPlayerScore(playerid)); return 1;}
#include <a_samp>#include <dini>new file[128];stock getn(p){ new n[24]; GetPlayerName(playerid,n,24); return n;}public OnPlayerConnect(playerid){ format(file,128,\"%s.sav\",getn(playerid)) if(!dini_Exists(file)) { SetPlayerScore(playerid, dini_Int(playerid,\"Score\")); } else dini_Create(file), dini_IntSet(playerid,\"Score\", GetPlayerScore(playerid)); return 1;}public OnPlayerDisconnect(playerid,reason){ format(file,128,\"%s.sav\",getn(playerid)) dini_IntSet(file,\"Score\",GetPlayerScore(playerid)); return 1;} A tied hibákat ír ki :S [/quote]Mivel hibás..Egyébként ha már minden játékos statját egyenként menteni akarod, akkor egy mappába kéne rakni, ne egybõl a scriptfiles-ben legyen többezer fájl...+ a if(!dini_Exists(file)) is keverve van...A format sor végén pedig nincs pontosvesszõ..Ráadásul dini_Int -nél mióta kell játékos ID-t lekérni? Arról nem is beszélve hogy a játékosID a fájl helye helyett van megadva... Ki írta ezt? Nagyon trehány munka már bocs Itt a javított verzió: #include <a_samp>#include <dini>new file[128];stock getn(p){ new n[24]; GetPlayerName(p,n,24); return n;}public OnPlayerConnect(playerid){ format(file,128,\"Score/%s.sav\",getn(playerid)); if(dini_Exists(file)) { SetPlayerScore(playerid, dini_Int(file,\"Score\")); } else { dini_Create(file); dini_IntSet(file,\"Score\", GetPlayerScore(playerid)); } return 1;}public OnPlayerDisconnect(playerid,reason){ format(file,128,\"Score/%s.sav\",getn(playerid)); dini_IntSet(file,\"Score\",GetPlayerScore(playerid)); return 1;}
#include <a_samp>#include <dini>new file[128];stock getn(p){ new n[24]; GetPlayerName(p,n,24); return n;}public OnPlayerConnect(playerid){ format(file,128,\"Score/%s.sav\",getn(playerid)); if(dini_Exists(file)) { SetPlayerScore(playerid, dini_Int(file,\"Score\")); } else { dini_Create(file); dini_IntSet(file,\"Score\", GetPlayerScore(playerid)); } return 1;}public OnPlayerDisconnect(playerid,reason){ format(file,128,\"Score/%s.sav\",getn(playerid)); dini_IntSet(file,\"Score\",GetPlayerScore(playerid)); return 1;}