Skripta koju koristim: moja
Detaljan opis problema: Znaci imo sam onaj obicni sistem cuvanja i prebacio sam na yini i sve je dobro, znaci mozes se logirat, registrirat. Al da predjem na stvar, i sad ja hodam po serveru i dam si admina il bilo sto i to ne sacuva, a npr stavim da igracu dadne tokom registracije 500$ to radi i sacuva, a lijepo ima pod onplayerdisconnect i onplayerupdate da sacuva. Mapa u koju treba sacuvat postoji i napravi fajl kad se registriras. Molim one koji ne znaju da ne postaju bezveze.
Dio skripte: Ev od registracije kod ( to radi ) if(dialogid == 18)
{
if(response)
{
if(strlen(inputtext))
{
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "users/%s.ini", playername3);
new INI:File = INI_Open(string3);
PlayerInfo[playerid][pKey] = udb_hash(inputtext);
INI_SetTag(File,"data");
INI_WriteInt(File, "Key", PlayerInfo[playerid][pKey]);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "AdminLevel",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Ugovor",PlayerInfo[playerid][pUgovor]);
INI_WriteInt(File, "Donator(BEC)Points",PlayerInfo[playerid][pBEC]);
INI_WriteInt(File, "SmetlarSkill",PlayerInfo[playerid][pSmeSkill]);
INI_WriteInt(File, "RibarSkill",PlayerInfo[playerid][pRibSkill]);
INI_WriteInt(File, "VozacBusaSkill",PlayerInfo[playerid][pVbSkill]);
INI_WriteInt(File, "KosacTraveSkill",PlayerInfo[playerid][pKtSkill]);
INI_WriteInt(File, "BodyGuardSkill",PlayerInfo[playerid][pBgSkill]);
INI_WriteInt(File, "CistacUlicaSkill",PlayerInfo[playerid][pCuSkill]);
INI_WriteInt(File, "KamiondzijaSkill",PlayerInfo[playerid][pKamSkill]);
INI_WriteInt(File, "ZastitarSkill",PlayerInfo[playerid][pZasSkill]);
INI_WriteInt(File, "GrobarSkill",PlayerInfo[playerid][pGSkill]);
INI_WriteInt(File, "MehanicarSkill",PlayerInfo[playerid][pMSkill]);
INI_WriteInt(File, "BolnicarSkill",PlayerInfo[playerid][pBolSkill]);
INI_WriteInt(File, "MjestoSpawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "DoGladi",PlayerInfo[playerid][pDoGladi]);
INI_WriteInt(File, "Glad",PlayerInfo[playerid][pGlad]);
INI_WriteInt(File, "IzmeduRuta",PlayerInfo[playerid][pIzmeduRuta]);
INI_WriteInt(File, "ProveraSpawna",PlayerInfo[playerid][pProveraSpawna]);
INI_WriteInt(File, "PosedovanjeKuce",PlayerInfo[playerid][pPosedovanjeKuce]);
INI_WriteInt(File, "Rent",PlayerInfo[playerid][pRent]);
INI_WriteInt(File, "CarKey1",PlayerInfo[playerid][pCarkey1]);
INI_WriteInt(File, "CarKey2",PlayerInfo[playerid][pCarkey2]);
INI_WriteInt(File, "CarKey3",PlayerInfo[playerid][pCarkey3]);
INI_WriteInt(File, "Adrenalins",PlayerInfo[playerid][pAdrenalins]);
INI_WriteInt(File, "GameMasterLevel",PlayerInfo[playerid][pGameMaster]);
INI_WriteInt(File, "DonateRank",PlayerInfo[playerid][pDonateRank]);
INI_WriteInt(File, "Registered",PlayerInfo[playerid][pReg]);
INI_WriteInt(File, "Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect",PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
INI_WriteInt(File, "Bank",PlayerInfo[playerid][pAccount]);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File, "Arrested",PlayerInfo[playerid][pArrested]);
INI_WriteInt(File, "Phonebook",PlayerInfo[playerid][pPhoneBook]);
INI_WriteInt(File, "Sat",PlayerInfo[playerid][pSat]);
INI_WriteInt(File, "Job",PlayerInfo[playerid][pJob]);
INI_WriteInt(File, "Paycheck",PlayerInfo[playerid][pPayCheck]);
INI_WriteInt(File, "Jailed",PlayerInfo[playerid][pJailed]);
INI_WriteInt(File, "JailTime",PlayerInfo[playerid][pJailTime]);
INI_WriteInt(File, "Tamnica",PlayerInfo[playerid][pTamnica]);
INI_WriteInt(File, "Tamtime",PlayerInfo[playerid][pTamtime]);//pTamtime
INI_WriteInt(File, "TamMin",PlayerInfo[playerid][pTamMin]);//pTamMin
INI_WriteInt(File, "TamSec",PlayerInfo[playerid][pTamSec]);//pTamSec
INI_WriteInt(File, "Materials",PlayerInfo[playerid][pMats]);
INI_WriteInt(File, "Drugs",PlayerInfo[playerid][pDrugs]);
INI_WriteInt(File, "Cigarete",PlayerInfo[playerid][pCigarete]);
INI_WriteInt(File, "Credit",PlayerInfo[playerid][pCredit]);
INI_WriteInt(File, "Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File, "Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File, "Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File, "Char",PlayerInfo[playerid][pChar]);
INI_WriteInt(File, "ContractTime",PlayerInfo[playerid][pContractTime]);
INI_WriteFloat(File, "pSHealth",PlayerInfo[playerid][pSHealth]);
INI_WriteFloat(File, "pHealth",PlayerInfo[playerid][pHealth]);
INI_WriteInt(File, "Int",PlayerInfo[playerid][pInt]);
INI_WriteInt(File, "Local",PlayerInfo[playerid][pLocal]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "PhoneNr",PlayerInfo[playerid][pPnumber]);
INI_WriteInt(File, "Bizz",PlayerInfo[playerid][pPbiskey]);
INI_WriteFloat(File, "Pos_x",PlayerInfo[playerid][pPos_x]);
INI_WriteFloat(File, "Pos_y",PlayerInfo[playerid][pPos_y]);
INI_WriteFloat(File, "Pos_z",PlayerInfo[playerid][pPos_z]);
INI_WriteInt(File, "CarLic",PlayerInfo[playerid][pCarLic]);
INI_WriteInt(File, "FlyLic",PlayerInfo[playerid][pFlyLic]);
INI_WriteInt(File, "BoatLic",PlayerInfo[playerid][pBoatLic]);
INI_WriteInt(File, "FishLic",PlayerInfo[playerid][pFishLic]);
INI_WriteInt(File, "GunLic",PlayerInfo[playerid][pGunLic]);
INI_WriteInt(File, "PayDay",PlayerInfo[playerid][pPayDay]);
INI_WriteInt(File, "PayDayHad",PlayerInfo[playerid][pPayDayHad]);
INI_WriteInt(File, "MinutePayDay",PlayerInfo[playerid][pMinutePayDay]);
INI_WriteInt(File, "Warnings",PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Greats",PlayerInfo[playerid][pGreats]);
INI_Close(File);
new loginstring[280];
new loginname[150];
format(loginstring,sizeof(loginstring),"{FFFFFF}Odlicno {66EEFF}%s{FFFFFF}.\nRegistrirali ste se na {66EEFF}West Balkan RPG/DM{FFFFFF} server\nPrijavite se:",loginname);
ShowPlayerDialog(playerid,19,DIALOG_STYLE_INPUT,"{FFFFFF}PRIJAVA",loginstring,"Prijava","Izlaz");
}
else
{
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
new regstring[60];
format(regstring,sizeof(regstring),"{FFFFFF}Upisite zeljenu lozinku kako biste se registrirali.");
ShowPlayerDialog(playerid,18,DIALOG_STYLE_INPUT,"{FFFFFF}Registracija na server",regstring,"Registracija","Izlaz");
}
}
if(!response)
{
Kick(playerid);
}
}
A evo stock SacuvajIgraca stock SacuvajIgraca(playerid)
{
new string3[32];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "users/%s.ini", playername3);
new INI:File = INI_Open(string3);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
INI_SetTag(File,"data");
INI_WriteInt(File, "Key", PlayerInfo[playerid][pKey]);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "AdminLevel",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Ugovor",PlayerInfo[playerid][pUgovor]);
INI_WriteInt(File, "Donator(BEC)Points",PlayerInfo[playerid][pBEC]);
INI_WriteInt(File, "SmetlarSkill",PlayerInfo[playerid][pSmeSkill]);
INI_WriteInt(File, "RibarSkill",PlayerInfo[playerid][pRibSkill]);
INI_WriteInt(File, "VozacBusaSkill",PlayerInfo[playerid][pVbSkill]);
INI_WriteInt(File, "KosacTraveSkill",PlayerInfo[playerid][pKtSkill]);
INI_WriteInt(File, "BodyGuardSkill",PlayerInfo[playerid][pBgSkill]);
INI_WriteInt(File, "CistacUlicaSkill",PlayerInfo[playerid][pCuSkill]);
INI_WriteInt(File, "KamiondzijaSkill",PlayerInfo[playerid][pKamSkill]);
INI_WriteInt(File, "ZastitarSkill",PlayerInfo[playerid][pZasSkill]);
INI_WriteInt(File, "GrobarSkill",PlayerInfo[playerid][pGSkill]);
INI_WriteInt(File, "MehanicarSkill",PlayerInfo[playerid][pMSkill]);
INI_WriteInt(File, "BolnicarSkill",PlayerInfo[playerid][pBolSkill]);
INI_WriteInt(File, "MjestoSpawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "DoGladi",PlayerInfo[playerid][pDoGladi]);
INI_WriteInt(File, "Glad",PlayerInfo[playerid][pGlad]);
INI_WriteInt(File, "IzmeduRuta",PlayerInfo[playerid][pIzmeduRuta]);
INI_WriteInt(File, "ProveraSpawna",PlayerInfo[playerid][pProveraSpawna]);
INI_WriteInt(File, "PosedovanjeKuce",PlayerInfo[playerid][pPosedovanjeKuce]);
INI_WriteInt(File, "Rent",PlayerInfo[playerid][pRent]);
INI_WriteInt(File, "CarKey1",PlayerInfo[playerid][pCarkey1]);
INI_WriteInt(File, "CarKey2",PlayerInfo[playerid][pCarkey2]);
INI_WriteInt(File, "CarKey3",PlayerInfo[playerid][pCarkey3]);
INI_WriteInt(File, "Adrenalins",PlayerInfo[playerid][pAdrenalins]);
INI_WriteInt(File, "GameMasterLevel",PlayerInfo[playerid][pGameMaster]);
INI_WriteInt(File, "DonateRank",PlayerInfo[playerid][pDonateRank]);
INI_WriteInt(File, "Registered",PlayerInfo[playerid][pReg]);
INI_WriteInt(File, "Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect",PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
INI_WriteInt(File, "Bank",PlayerInfo[playerid][pAccount]);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File, "Arrested",PlayerInfo[playerid][pArrested]);
INI_WriteInt(File, "Phonebook",PlayerInfo[playerid][pPhoneBook]);
INI_WriteInt(File, "Sat",PlayerInfo[playerid][pSat]);
INI_WriteInt(File, "Job",PlayerInfo[playerid][pJob]);
INI_WriteInt(File, "Paycheck",PlayerInfo[playerid][pPayCheck]);
INI_WriteInt(File, "Jailed",PlayerInfo[playerid][pJailed]);
INI_WriteInt(File, "JailTime",PlayerInfo[playerid][pJailTime]);
INI_WriteInt(File, "Tamnica",PlayerInfo[playerid][pTamnica]);
INI_WriteInt(File, "Tamtime",PlayerInfo[playerid][pTamtime]);//pTamtime
INI_WriteInt(File, "TamMin",PlayerInfo[playerid][pTamMin]);//pTamMin
INI_WriteInt(File, "TamSec",PlayerInfo[playerid][pTamSec]);//pTamSec
INI_WriteInt(File, "Materials",PlayerInfo[playerid][pMats]);
INI_WriteInt(File, "Drugs",PlayerInfo[playerid][pDrugs]);
INI_WriteInt(File, "Cigarete",PlayerInfo[playerid][pCigarete]);
INI_WriteInt(File, "Credit",PlayerInfo[playerid][pCredit]);
INI_WriteInt(File, "Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File, "Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File, "Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File, "Char",PlayerInfo[playerid][pChar]);
INI_WriteInt(File, "ContractTime",PlayerInfo[playerid][pContractTime]);
INI_WriteFloat(File, "pSHealth",PlayerInfo[playerid][pSHealth]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
INI_WriteFloat(File, "pHealth",PlayerInfo[playerid][pHealth]);
INI_WriteInt(File, "Int",PlayerInfo[playerid][pInt]);
INI_WriteInt(File, "Local",PlayerInfo[playerid][pLocal]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "PhoneNr",PlayerInfo[playerid][pPnumber]);
INI_WriteInt(File, "Bizz",PlayerInfo[playerid][pPbiskey]);
INI_WriteFloat(File, "Pos_x",PlayerInfo[playerid][pPos_x]);
INI_WriteFloat(File, "Pos_y",PlayerInfo[playerid][pPos_y]);
INI_WriteFloat(File, "Pos_z",PlayerInfo[playerid][pPos_z]);
INI_WriteInt(File, "CarLic",PlayerInfo[playerid][pCarLic]);
INI_WriteInt(File, "FlyLic",PlayerInfo[playerid][pFlyLic]);
INI_WriteInt(File, "BoatLic",PlayerInfo[playerid][pBoatLic]);
INI_WriteInt(File, "FishLic",PlayerInfo[playerid][pFishLic]);
INI_WriteInt(File, "GunLic",PlayerInfo[playerid][pGunLic]);
INI_WriteInt(File, "PayDay",PlayerInfo[playerid][pPayDay]);
INI_WriteInt(File, "PayDayHad",PlayerInfo[playerid][pPayDayHad]);
INI_WriteInt(File, "MinutePayDay",PlayerInfo[playerid][pMinutePayDay]);
INI_WriteInt(File, "Warnings",PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Greats",PlayerInfo[playerid][pGreats]);
INI_Close(File);
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno)://
bump
Probaj da na disconnectu metnes taj deo gde cuva varijable
Evo ovako, moja preporuka, kada budeš pravio komandu za /makeadmin, poslije izvršenja komande, i svega toga, kada ti se postave sve variable, pozovi public SacuvajIgraca. Kada ti pozoveš public SacuvajIgraca, on istog trena sacuva ponovo sve variable koje je zapamtio. Jel me kontaš šta hoću da ti kažem?
[quote author=
Lenon link=topic=84754.msg572225#msg572225 date=1390032022]
postavi reposnse dialoga ID 19, postavi public za ucitavanje igraca..
[/quote]imas public (stock, neradi ni kad je jedno ni drugo) gore a evo id 19
if(dialogid == 19)
{
if(!response)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "----------------------------------------------[KICK]-------------------------------------------");
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Dobili ste kick sa servera od strane servera");
SendClientMessage(playerid, COLOR_WHITE, "RAZLOG: Odbijanje logina.");
SendClientMessage(playerid, COLOR_WHITE,"Vas West Balkan Admin Team");
SendClientMessage(playerid, COLOR_LIGHTRED, "------------------------------------------------------------------------------------------------");
Kick(playerid);
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(udb_hash(inputtext) == PlayerInfo[playerid][pKey])
{
new loginname[60];
new file[64];
GetPlayerName(playerid, loginname, sizeof(loginname));
format(file, 256, "users/%s.ini", loginname);
INI_ParseFile(file, "UcitajIgraca", .bExtra = true, .extra = playerid);
PlayerInfo[playerid][pAdjustable] = 0;
ResetPlayerMoney(playerid);
ConsumingMoney[playerid] = 1;
GivePlayerMoneyEx(playerid,PlayerInfo[playerid][pCash]);
CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
NewMoney[playerid] = PlayerInfo[playerid][pCash];
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
if(PlayerInfo[playerid][pReg] == 0)
{
PlayerInfo[playerid][pLevel] = 1;
PlayerInfo[playerid][pCash] = 2000;
PlayerInfo[playerid][pSHealth] = 0.0;
PlayerInfo[playerid][pHealth] = 100;
PlayerInfo[playerid][pPos_x] = 1219.1603;
PlayerInfo[playerid][pPos_y] = -1812.8612;
PlayerInfo[playerid][pPos_z] = 16.5938;
PlayerInfo[playerid][pInt] = 15;
PlayerInfo[playerid][pLocal] = 255;
PlayerInfo[playerid][pModel] = 7;
new randphone = 100000 + random(899999);//minimum 1000 max 9999 //giving one at the start
PlayerInfo[playerid][pPnumber] = randphone;
PlayerInfo[playerid][pPhousekey] = 255;
PlayerInfo[playerid][pPbiskey] = 255;
PlayerInfo[playerid][pPosedovanjeKuce] = -1;
PlayerInfo[playerid][pCarkey1] = -1;
PlayerInfo[playerid][pCarkey2] = -1;
PlayerInfo[playerid][pCarkey3] = -1;
PlayerInfo[playerid][pAccount] = 5000;
PlayerInfo[playerid][pMember] = 0;
PlayerInfo[playerid][pReg] = 1;
PlayerInfo[playerid][pGlad] = 100;
PlayerInfo[playerid][pDoGladi] = 0;
PlayerInfo[playerid][pTut] = 1;
PlayerInfo[playerid][pIzmeduRuta] = 5;
new string[80];
format(string, 250, "AdmWarn: Igrac %s se registrirao - pomozite mu ako je potrebno i provjerite jeli cheater.", ImeIgraca(playerid));
SendAdminMessage(COLOR_LIGHTRED, string);
GivePlayerMoneyEx(playerid, 1000);
}
SendClientMessage(playerid, COLOR_PDGOV, "SERVER:{FFFFFF} Uspjesno ste se ulogirali. Koristite {66EEFF}/help{FFFFFF} ako ste novi ili ne znate komande.");
gPlayerLogged[playerid] = 1;
SpawnPlayer(playerid);
SetPlayerSpawn(playerid);
SacuvajIgraca(playerid);
}
else
{
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
ShowPlayerDialog(playerid,19,DIALOG_STYLE_PASSWORD,"{FFFFFF}Login","{FFFFFF}Unesena sifra se nepoklapa sa vasim korisnickim racunom.\nUkucajte ponovo pravilnu sifru da biste se logirali.","Prijava","Izlaz");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 3)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "----------------------------------------------[KICK]-------------------------------------------");
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Dobili ste kick sa servera od strane servera");
SendClientMessage(playerid, COLOR_WHITE, "RAZLOG: 3 puta pogresna lozinka.");
SendClientMessage(playerid, COLOR_WHITE,"Vas West Balkan Admin Team");
SendClientMessage(playerid, COLOR_LIGHTRED, "------------------------------------------------------------------------------------------------");
Kick(playerid);
}
}
if(!strlen(inputtext))
{
new loginstring[250];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"{FFFFFF}Unesena sifra se nepoklapa sa vasim korisnickim racunom.\nUkucajte ponovo pravilnu sifru da biste se logirali.",loginname);
ShowPlayerDialog(playerid,19,DIALOG_STYLE_PASSWORD,"{FFFFFF}Login",loginstring,"Prijava","Izlaz");
gPlayerLogTries[playerid] += 1;
}
}
Citat: |LZ| Bugi poslato Januar 18, 2014, 10:07:13 PRE PODNE
Probaj da na disconnectu metnes taj deo gde cuva varijable
prvo procitaj sta sam napiso
Citat: FuDo a.k.a Dwayne Dude poslato Januar 18, 2014, 13:09:19 POSLE PODNE
Evo ovako, moja preporuka, kada budeš pravio komandu za /makeadmin, poslije izvršenja komande, i svega toga, kada ti se postave sve variable, pozovi public SacuvajIgraca. Kada ti pozoveš public SacuvajIgraca, on istog trena sacuva ponovo sve variable koje je zapamtio. Jel me kontaš šta hoću da ti kažem?
kontam vec to ima al nece sacuvat
Ja imam isti problem, dam pare sebi, izadjem sa servera , vratim se, nije sacuvalo.
Evo ti primjer:
YCMD:komanda(playerid, params[])
{
moja komanda bla bla;
SacuvajIgraca(playerid);
return 1;
}
Jel me kontaš šta hoću sad da ti kažem ovim?
Citat: FuDo a.k.a Dwayne Dude poslato Januar 18, 2014, 22:48:31 POSLE PODNE
Evo ti primjer:
YCMD:komanda(playerid, params[])
{
moja komanda bla bla;
SacuvajIgraca(playerid);
return 1;
}
Jel me kontaš šta hoću sad da ti kažem ovim?
Pa vec to ima jesam ti rekao.
Izvini, nisam dobro proÄitao.
Na vrh skripte stavi ovo:
#define PATH "users/%s.ini"
ubaci negdje ovaj stock:
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
pa onda svoj stock zamijeni sa ovim:
stock SacuvajIgraca(playerid)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File, "Key", PlayerInfo[playerid][pKey]);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "AdminLevel",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Ugovor",PlayerInfo[playerid][pUgovor]);
INI_WriteInt(File, "Donator(BEC)Points",PlayerInfo[playerid][pBEC]);
INI_WriteInt(File, "SmetlarSkill",PlayerInfo[playerid][pSmeSkill]);
INI_WriteInt(File, "RibarSkill",PlayerInfo[playerid][pRibSkill]);
INI_WriteInt(File, "VozacBusaSkill",PlayerInfo[playerid][pVbSkill]);
INI_WriteInt(File, "KosacTraveSkill",PlayerInfo[playerid][pKtSkill]);
INI_WriteInt(File, "BodyGuardSkill",PlayerInfo[playerid][pBgSkill]);
INI_WriteInt(File, "CistacUlicaSkill",PlayerInfo[playerid][pCuSkill]);
INI_WriteInt(File, "KamiondzijaSkill",PlayerInfo[playerid][pKamSkill]);
INI_WriteInt(File, "ZastitarSkill",PlayerInfo[playerid][pZasSkill]);
INI_WriteInt(File, "GrobarSkill",PlayerInfo[playerid][pGSkill]);
INI_WriteInt(File, "MehanicarSkill",PlayerInfo[playerid][pMSkill]);
INI_WriteInt(File, "BolnicarSkill",PlayerInfo[playerid][pBolSkill]);
INI_WriteInt(File, "MjestoSpawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "DoGladi",PlayerInfo[playerid][pDoGladi]);
INI_WriteInt(File, "Glad",PlayerInfo[playerid][pGlad]);
INI_WriteInt(File, "IzmeduRuta",PlayerInfo[playerid][pIzmeduRuta]);
INI_WriteInt(File, "ProveraSpawna",PlayerInfo[playerid][pProveraSpawna]);
INI_WriteInt(File, "PosedovanjeKuce",PlayerInfo[playerid][pPosedovanjeKuce]);
INI_WriteInt(File, "Rent",PlayerInfo[playerid][pRent]);
INI_WriteInt(File, "CarKey1",PlayerInfo[playerid][pCarkey1]);
INI_WriteInt(File, "CarKey2",PlayerInfo[playerid][pCarkey2]);
INI_WriteInt(File, "CarKey3",PlayerInfo[playerid][pCarkey3]);
INI_WriteInt(File, "Adrenalins",PlayerInfo[playerid][pAdrenalins]);
INI_WriteInt(File, "GameMasterLevel",PlayerInfo[playerid][pGameMaster]);
INI_WriteInt(File, "DonateRank",PlayerInfo[playerid][pDonateRank]);
INI_WriteInt(File, "Registered",PlayerInfo[playerid][pReg]);
INI_WriteInt(File, "Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect",PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
INI_WriteInt(File, "Bank",PlayerInfo[playerid][pAccount]);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File, "Arrested",PlayerInfo[playerid][pArrested]);
INI_WriteInt(File, "Phonebook",PlayerInfo[playerid][pPhoneBook]);
INI_WriteInt(File, "Sat",PlayerInfo[playerid][pSat]);
INI_WriteInt(File, "Job",PlayerInfo[playerid][pJob]);
INI_WriteInt(File, "Paycheck",PlayerInfo[playerid][pPayCheck]);
INI_WriteInt(File, "Jailed",PlayerInfo[playerid][pJailed]);
INI_WriteInt(File, "JailTime",PlayerInfo[playerid][pJailTime]);
INI_WriteInt(File, "Tamnica",PlayerInfo[playerid][pTamnica]);
INI_WriteInt(File, "Tamtime",PlayerInfo[playerid][pTamtime]);//pTamtime
INI_WriteInt(File, "TamMin",PlayerInfo[playerid][pTamMin]);//pTamMin
INI_WriteInt(File, "TamSec",PlayerInfo[playerid][pTamSec]);//pTamSec
INI_WriteInt(File, "Materials",PlayerInfo[playerid][pMats]);
INI_WriteInt(File, "Drugs",PlayerInfo[playerid][pDrugs]);
INI_WriteInt(File, "Cigarete",PlayerInfo[playerid][pCigarete]);
INI_WriteInt(File, "Credit",PlayerInfo[playerid][pCredit]);
INI_WriteInt(File, "Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File, "Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File, "Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File, "Char",PlayerInfo[playerid][pChar]);
INI_WriteInt(File, "ContractTime",PlayerInfo[playerid][pContractTime]);
INI_WriteFloat(File, "pSHealth",PlayerInfo[playerid][pSHealth]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
INI_WriteFloat(File, "pHealth",PlayerInfo[playerid][pHealth]);
INI_WriteInt(File, "Int",PlayerInfo[playerid][pInt]);
INI_WriteInt(File, "Local",PlayerInfo[playerid][pLocal]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "PhoneNr",PlayerInfo[playerid][pPnumber]);
INI_WriteInt(File, "Bizz",PlayerInfo[playerid][pPbiskey]);
INI_WriteFloat(File, "Pos_x",PlayerInfo[playerid][pPos_x]);
INI_WriteFloat(File, "Pos_y",PlayerInfo[playerid][pPos_y]);
INI_WriteFloat(File, "Pos_z",PlayerInfo[playerid][pPos_z]);
INI_WriteInt(File, "CarLic",PlayerInfo[playerid][pCarLic]);
INI_WriteInt(File, "FlyLic",PlayerInfo[playerid][pFlyLic]);
INI_WriteInt(File, "BoatLic",PlayerInfo[playerid][pBoatLic]);
INI_WriteInt(File, "FishLic",PlayerInfo[playerid][pFishLic]);
INI_WriteInt(File, "GunLic",PlayerInfo[playerid][pGunLic]);
INI_WriteInt(File, "PayDay",PlayerInfo[playerid][pPayDay]);
INI_WriteInt(File, "PayDayHad",PlayerInfo[playerid][pPayDayHad]);
INI_WriteInt(File, "MinutePayDay",PlayerInfo[playerid][pMinutePayDay]);
INI_WriteInt(File, "Warnings",PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Greats",PlayerInfo[playerid][pGreats]);
INI_Close(File);
return 1;
}
Sad bi trebalo da radi.
Citat: FuDo a.k.a Dwayne Dude poslato Januar 18, 2014, 23:11:19 POSLE PODNE
Izvini, nisam dobro proÄitao.
Na vrh skripte stavi ovo:
#define PATH "users/%s.ini"
ubaci negdje ovaj stock:
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
pa onda svoj stock zamijeni sa ovim:
stock SacuvajIgraca(playerid)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File, "Key", PlayerInfo[playerid][pKey]);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "AdminLevel",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Ugovor",PlayerInfo[playerid][pUgovor]);
INI_WriteInt(File, "Donator(BEC)Points",PlayerInfo[playerid][pBEC]);
INI_WriteInt(File, "SmetlarSkill",PlayerInfo[playerid][pSmeSkill]);
INI_WriteInt(File, "RibarSkill",PlayerInfo[playerid][pRibSkill]);
INI_WriteInt(File, "VozacBusaSkill",PlayerInfo[playerid][pVbSkill]);
INI_WriteInt(File, "KosacTraveSkill",PlayerInfo[playerid][pKtSkill]);
INI_WriteInt(File, "BodyGuardSkill",PlayerInfo[playerid][pBgSkill]);
INI_WriteInt(File, "CistacUlicaSkill",PlayerInfo[playerid][pCuSkill]);
INI_WriteInt(File, "KamiondzijaSkill",PlayerInfo[playerid][pKamSkill]);
INI_WriteInt(File, "ZastitarSkill",PlayerInfo[playerid][pZasSkill]);
INI_WriteInt(File, "GrobarSkill",PlayerInfo[playerid][pGSkill]);
INI_WriteInt(File, "MehanicarSkill",PlayerInfo[playerid][pMSkill]);
INI_WriteInt(File, "BolnicarSkill",PlayerInfo[playerid][pBolSkill]);
INI_WriteInt(File, "MjestoSpawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "DoGladi",PlayerInfo[playerid][pDoGladi]);
INI_WriteInt(File, "Glad",PlayerInfo[playerid][pGlad]);
INI_WriteInt(File, "IzmeduRuta",PlayerInfo[playerid][pIzmeduRuta]);
INI_WriteInt(File, "ProveraSpawna",PlayerInfo[playerid][pProveraSpawna]);
INI_WriteInt(File, "PosedovanjeKuce",PlayerInfo[playerid][pPosedovanjeKuce]);
INI_WriteInt(File, "Rent",PlayerInfo[playerid][pRent]);
INI_WriteInt(File, "CarKey1",PlayerInfo[playerid][pCarkey1]);
INI_WriteInt(File, "CarKey2",PlayerInfo[playerid][pCarkey2]);
INI_WriteInt(File, "CarKey3",PlayerInfo[playerid][pCarkey3]);
INI_WriteInt(File, "Adrenalins",PlayerInfo[playerid][pAdrenalins]);
INI_WriteInt(File, "GameMasterLevel",PlayerInfo[playerid][pGameMaster]);
INI_WriteInt(File, "DonateRank",PlayerInfo[playerid][pDonateRank]);
INI_WriteInt(File, "Registered",PlayerInfo[playerid][pReg]);
INI_WriteInt(File, "Sex",PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age",PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin",PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect",PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Money",PlayerInfo[playerid][pCash]);
INI_WriteInt(File, "Bank",PlayerInfo[playerid][pAccount]);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File, "Arrested",PlayerInfo[playerid][pArrested]);
INI_WriteInt(File, "Phonebook",PlayerInfo[playerid][pPhoneBook]);
INI_WriteInt(File, "Sat",PlayerInfo[playerid][pSat]);
INI_WriteInt(File, "Job",PlayerInfo[playerid][pJob]);
INI_WriteInt(File, "Paycheck",PlayerInfo[playerid][pPayCheck]);
INI_WriteInt(File, "Jailed",PlayerInfo[playerid][pJailed]);
INI_WriteInt(File, "JailTime",PlayerInfo[playerid][pJailTime]);
INI_WriteInt(File, "Tamnica",PlayerInfo[playerid][pTamnica]);
INI_WriteInt(File, "Tamtime",PlayerInfo[playerid][pTamtime]);//pTamtime
INI_WriteInt(File, "TamMin",PlayerInfo[playerid][pTamMin]);//pTamMin
INI_WriteInt(File, "TamSec",PlayerInfo[playerid][pTamSec]);//pTamSec
INI_WriteInt(File, "Materials",PlayerInfo[playerid][pMats]);
INI_WriteInt(File, "Drugs",PlayerInfo[playerid][pDrugs]);
INI_WriteInt(File, "Cigarete",PlayerInfo[playerid][pCigarete]);
INI_WriteInt(File, "Credit",PlayerInfo[playerid][pCredit]);
INI_WriteInt(File, "Leader",PlayerInfo[playerid][pLeader]);
INI_WriteInt(File, "Member",PlayerInfo[playerid][pMember]);
INI_WriteInt(File, "Rank",PlayerInfo[playerid][pRank]);
INI_WriteInt(File, "Char",PlayerInfo[playerid][pChar]);
INI_WriteInt(File, "ContractTime",PlayerInfo[playerid][pContractTime]);
INI_WriteFloat(File, "pSHealth",PlayerInfo[playerid][pSHealth]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
INI_WriteFloat(File, "pHealth",PlayerInfo[playerid][pHealth]);
INI_WriteInt(File, "Int",PlayerInfo[playerid][pInt]);
INI_WriteInt(File, "Local",PlayerInfo[playerid][pLocal]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "PhoneNr",PlayerInfo[playerid][pPnumber]);
INI_WriteInt(File, "Bizz",PlayerInfo[playerid][pPbiskey]);
INI_WriteFloat(File, "Pos_x",PlayerInfo[playerid][pPos_x]);
INI_WriteFloat(File, "Pos_y",PlayerInfo[playerid][pPos_y]);
INI_WriteFloat(File, "Pos_z",PlayerInfo[playerid][pPos_z]);
INI_WriteInt(File, "CarLic",PlayerInfo[playerid][pCarLic]);
INI_WriteInt(File, "FlyLic",PlayerInfo[playerid][pFlyLic]);
INI_WriteInt(File, "BoatLic",PlayerInfo[playerid][pBoatLic]);
INI_WriteInt(File, "FishLic",PlayerInfo[playerid][pFishLic]);
INI_WriteInt(File, "GunLic",PlayerInfo[playerid][pGunLic]);
INI_WriteInt(File, "PayDay",PlayerInfo[playerid][pPayDay]);
INI_WriteInt(File, "PayDayHad",PlayerInfo[playerid][pPayDayHad]);
INI_WriteInt(File, "MinutePayDay",PlayerInfo[playerid][pMinutePayDay]);
INI_WriteInt(File, "Warnings",PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Greats",PlayerInfo[playerid][pGreats]);
INI_Close(File);
return 1;
}
Sad bi trebalo da radi.
Evo sada cu probati.
EDIT: Ne radi.
Citat: David (Sabljak) A.k.A SABO(T) poslato Januar 19, 2014, 13:24:30 POSLE PODNE
Prema kojem tutorialu si pravio to spremanje?
Nisam pratio nikakav tutorijal.
Citat: David (Sabljak) A.k.A SABO(T) poslato Januar 19, 2014, 16:43:25 POSLE PODNE
Pogledaj par tutoriala za YINI register/login i te stvari, i ja sam to ucio kad sam poceo, ocito si nesto propustio..
Usporedio sam sa svim tutorijalima i bas sve je isto, nista nije propusteno, trazio sam i po samp forumu i jedan je imao isti problem nije mu znao ni Y_Less pomoc. -.-
Jedino sto mi preostaje je prebacit na dini.
Citat: .ılllı. Wlseco .ılllı. poslato Januar 19, 2014, 17:46:03 POSLE PODNE
Citat: David (Sabljak) A.k.A SABO(T) poslato Januar 19, 2014, 16:43:25 POSLE PODNE
Pogledaj par tutoriala za YINI register/login i te stvari, i ja sam to ucio kad sam poceo, ocito si nesto propustio..
Usporedio sam sa svim tutorijalima i bas sve je isto, nista nije propusteno, trazio sam i po samp forumu i jedan je imao isti problem nije mu znao ni Y_Less pomoc. -.-
Jedino sto mi preostaje je prebacit na dini.
Ma kakav dini ÄovjeÄe, jednostavno ponovo uradi registraciju.
Citat: Vegas. poslato Januar 19, 2014, 17:50:31 POSLE PODNE
Citat: .ılllı. Wlseco .ılllı. poslato Januar 19, 2014, 17:46:03 POSLE PODNE
Citat: David (Sabljak) A.k.A SABO(T) poslato Januar 19, 2014, 16:43:25 POSLE PODNE
Pogledaj par tutoriala za YINI register/login i te stvari, i ja sam to ucio kad sam poceo, ocito si nesto propustio..
Usporedio sam sa svim tutorijalima i bas sve je isto, nista nije propusteno, trazio sam i po samp forumu i jedan je imao isti problem nije mu znao ni Y_Less pomoc. -.-
Jedino sto mi preostaje je prebacit na dini.
Ma kakav dini ÄovjeÄe, jednostavno ponovo uradi registraciju.
Kad se registriras sacuva a kad npr /makeadmin ukucam i dadnem si admina ne cuva to je problem nije do registracije.
U komandi nakon davanja admina pozovi funkciju za saÄuvavanje i vidi.
Citat: Vegas. poslato Januar 19, 2014, 18:25:08 POSLE PODNE
U komandi nakon davanja admina pozovi funkciju za saÄuvavanje i vidi.
Citaj gore, vec ima.
mod od nule koji sam radio ja sebi, radio sam po ovom tutorialu http://forum.sa-mp.com/showthread.php?t=273088
pa ako ti nije mrsko raditi ponovo od poÄetka radi po ovom tutorialu.
Citat: FuDo a.k.a Dwayne Dude poslato Januar 19, 2014, 22:07:31 POSLE PODNE
mod od nule koji sam radio ja sebi, radio sam po ovom tutorialu http://forum.sa-mp.com/showthread.php?t=273088
pa ako ti nije mrsko raditi ponovo od poÄetka radi po ovom tutorialu.
Radio sam opet isto.
bump
negdje sam sad sluÄajno proÄitao da ti ima PATH "users/%s.ini/" ukloni ovu zadnju crticu, neka ti bude samo "users/%s.ini", i provjeri dobro da li je ispravan PATH i onda pokuÅ¡aj.
Citat: dirigent00 poslato Januar 24, 2014, 12:56:37 POSLE PODNE
negdje sam sad sluÄajno proÄitao da ti ima PATH "users/%s.ini/" ukloni ovu zadnju crticu, neka ti bude samo "users/%s.ini", i provjeri dobro da li je ispravan PATH i onda pokuÅ¡aj.
Sve je dobro.
bump