Sweet 7 Odesláno: 31. Říjen, 2012 Share Odesláno: 31. Říjen, 2012 Cau, tohle mam v OnPlayerDisconnect ale ucet se mi proste nevytvori, pri tom se ma vytvorit kdyz je tam io_write pokud se nepletu.. (vyvola to ten printf) nevite nekdo jak to vyresit? new string[100]; format(string, sizeof(string), soubor, PlayerConnectName(playerid)); new File:SaveFile = fopen(string, io_write); new napis[500]; if(SaveFile) { format(napis, sizeof(napis), "Heslo=%s", Information[playerid][Heslo]); format(napis, sizeof(napis), "\nAdministrator=%d", Information[playerid][Administrator]); format(napis, sizeof(napis), "\nZabiti=%d", Information[playerid][Zabiti]); format(napis, sizeof(napis), "\nUmrti=%d", Information[playerid][umrti]); format(napis, sizeof(napis), "\nSkin=%d", GetPlayerSkin(playerid)); format(napis, sizeof(napis), "\nLevel=%d", Information[playerid][Level]); format(napis, sizeof(napis), "\nBody=%d", Information[playerid][body]); format(napis, sizeof(napis), "\nNahrano=%d", NahranyCas[playerid]); format(napis, sizeof(napis), "\nPenize=%d", GetPlayerMoney(playerid)); format(napis, sizeof(napis), "\nZamestnani=%d", Information[playerid][Zamestnani]); format(napis, sizeof(napis), "\nBanka=%d", Information[playerid][banka]); format(napis, sizeof(napis), "\nRidicak=%d", Information[playerid][Ridicak]); format(napis, sizeof(napis), "\nObcanka=%d", Information[playerid][Obcanka]); format(napis, sizeof(napis), "\nZbrojak=%d", Information[playerid][Zbrojak]); format(napis, sizeof(napis), "\nPolicejniZK=%d", Information[playerid][PolicejniZK]); format(napis, sizeof(napis), "\nMarihuana=%d", Information[playerid][Marihuana]); format(napis, sizeof(napis), "\nSeminko=%d", Information[playerid][seminko]); format(napis, sizeof(napis), "\nMobil=%d", Information[playerid][Mobil]); format(napis, sizeof(napis), "\nKurak=%d", Information[playerid][Kurak]); format(napis, sizeof(napis), "\nWC=%d", Potreby[playerid][WC]); format(napis, sizeof(napis), "\nJidlo=%d", Potreby[playerid][Jidlo]); format(napis, sizeof(napis), "\nPiti=%d", Potreby[playerid][Piti]); format(napis, sizeof(napis), "\nSpanek=%d", Potreby[playerid][spanek]); format(napis, sizeof(napis), "\nZavislost=%d", Potreby[playerid][Zavislost]); format(napis, sizeof(napis), "\nFirstPerson=%d", PlayerFirstPerson[playerid]); format(napis, sizeof(napis), "\nVezen=%d", Vezen[playerid]); format(napis, sizeof(napis), "\nCela=%d", Information[playerid][Cela]); format(napis, sizeof(napis), "\nVezeni=%d", Information[playerid][Vezeni]); format(napis, sizeof(napis), "\nChleba=%d", Potrava[playerid][Chleba]); format(napis, sizeof(napis), "\nMrazeneMaso=%d", Potrava[playerid][MrazeneMaso]); format(napis, sizeof(napis), "\nPeceneMaso=%d", Potrava[playerid][PeceneMaso]); format(napis, sizeof(napis), "\nJablko=%d", Potrava[playerid][Jablko]); format(napis, sizeof(napis), "\nHruska=%d", Potrava[playerid][Hruska]); format(napis, sizeof(napis), "\nBanan=%d", Potrava[playerid][banan]); format(napis, sizeof(napis), "\nDonut=%d", Potrava[playerid][Donut]); format(napis, sizeof(napis), "\nPizza=%d", Potrava[playerid][Pizza]); format(napis, sizeof(napis), "\nSusenka=%d", Potrava[playerid][susenka]); format(napis, sizeof(napis), "\nBramburky=%d", Potrava[playerid][bramburky]); format(napis, sizeof(napis), "\nVoda=%d", Napoje[playerid][Voda]); format(napis, sizeof(napis), "\nLimonada=%d", Napoje[playerid][Limonada]); format(napis, sizeof(napis), "\nCola=%d", Napoje[playerid][Cola]); format(napis, sizeof(napis), "\nPivo=%d", Napoje[playerid][Pivo]); format(napis, sizeof(napis), "\nVino=%d", Napoje[playerid][Vino]); format(napis, sizeof(napis), "\nVodka=%d", Napoje[playerid][Vodka]); format(napis, sizeof(napis), "\nRum=%d", Napoje[playerid][Rum]); format(napis, sizeof(napis), "\nWhiskey=%d", Napoje[playerid][Whiskey]); format(napis, sizeof(napis), "\nZapalky=%d", Veci[playerid][Zapalky]); format(napis, sizeof(napis), "\nRadio=%d", Veci[playerid][Radio]); format(napis, sizeof(napis), "\nNoviny=%d", Veci[playerid][Noviny]); format(napis, sizeof(napis), "\nCigareta=%d", Veci[playerid][Cigareta]); format(napis, sizeof(napis), "\nHlava=%d", Hlava[playerid]); format(napis, sizeof(napis), "\nBryle=%d", Bryle[playerid]); format(napis, sizeof(napis), "\nBatoh=%d", Batoh[playerid]); format(napis, sizeof(napis), "\nNovyKurak=%d", NovyKurak[playerid]); format(napis, sizeof(napis), "\nSkill_Pistole=%d", GetPVarInt(playerid,"WEAPONSKILL_PISTOL")); format(napis, sizeof(napis), "\nSkill_PistoleSilenced=%d", GetPVarInt(playerid,"WEAPONSKILL_PISTOL_SILENCED")); format(napis, sizeof(napis), "\nSkill_DesertEagle=%d", GetPVarInt(playerid,"WEAPONSKILL_DESERT_EAGLE")); format(napis, sizeof(napis), "\nSkill_Shotgun=%d", GetPVarInt(playerid,"WEAPONSKILL_SHOTGUN")); format(napis, sizeof(napis), "\nSkill_MicroUzi=%d", GetPVarInt(playerid,"WEAPONSKILL_MICRO_UZI")); format(napis, sizeof(napis), "\nSkill_MP5=%d", GetPVarInt(playerid,"WEAPONSKILL_MP5")); format(napis, sizeof(napis), "\nSkill_AK47=%d", GetPVarInt(playerid,"WEAPONSKILL_AK47")); format(napis, sizeof(napis), "\nSkill_M4=%d", GetPVarInt(playerid,"WEAPONSKILL_M4")); format(napis, sizeof(napis), "\nSkill_SniperRifle=%d", GetPVarInt(playerid,"WEAPONSKILL_SNIPERRIFLE")); format(napis, sizeof(napis), "\nMafiaID=%d", Mafia[playerid][iD]); format(napis, sizeof(napis), "\nMafiaSidlo=%d", Mafia[playerid][sidlo]); format(napis, sizeof(napis), "\nMafiaHodnost=%d", Mafia[playerid][Hodnost]); format(napis, sizeof(napis), "\nAutoID=%d", PlayerCar[playerid][iD]); format(napis, sizeof(napis), "\nAutoPoziceX=%f", PlayerCar[playerid][PoziceX]); format(napis, sizeof(napis), "\nAutoPoziceY=%f", PlayerCar[playerid][PoziceY]); format(napis, sizeof(napis), "\nAutoPoziceZ=%f", PlayerCar[playerid][PoziceZ]); format(napis, sizeof(napis), "\nAutoAngle=%f", PlayerCar[playerid][Angle]); format(napis, sizeof(napis), "\nAutoBarva1=%d", PlayerCar[playerid][barva1]); format(napis, sizeof(napis), "\nAutoBarva2=%d", PlayerCar[playerid][barva2]); format(napis, sizeof(napis), "\nAutoMajitel=%s", PlayerCar[playerid][Majitel]); format(napis, sizeof(napis), "\nAutoZamknute=%s", PlayerCar[playerid][Zamknute]); fwrite(SaveFile, napis); fclose(SaveFile); } else { printf("soubor %s neexistuje", string); } Link to comment Share on other sites More sharing options...
0 Hrb™ 48 Odesláno: 31. Říjen, 2012 Share Odesláno: 31. Říjen, 2012 A zkoušel jsi ho vytvořit při Connectu? 2 Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 31. Říjen, 2012 Globální moderátor Share Odesláno: 31. Říjen, 2012 1. Každý účet má svůj soubor? 2. těma řádkama co ukládáš tak uložíš je jednu věc - tu poslední 3. if(SaveFile) co je to za podmínku co to má dělat? 1 Link to comment Share on other sites More sharing options...
0 Sweet 7 Odesláno: 31. Říjen, 2012 Author Share Odesláno: 31. Říjen, 2012 Hrb - jak ho mam vytvorit? tohle by ho melo vytvorit, kdyz das to samy do connectu, tak to ma udelat uplne to samy jako ted Hip - 1. ano 2. ulozej se vsechny.. na win serveru to jde 3. zjistuje to jestli je soubor vytvoreny (pokud se soubor rovna 1) jeste jsem vam zapomel rict, ze na windows serveru to funguje uplne v pohode ale na linuxu jakoby to funkci fopen preskocilo Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 31. Říjen, 2012 Globální moderátor Share Odesláno: 31. Říjen, 2012 Hrb - jak ho mam vytvorit? tohle by ho melo vytvorit, kdyz das to samy do connectu, tak to ma udelat uplne to samy jako ted Hip - 1. ano 2. ulozej se vsechny.. na win serveru to jde 3. zjistuje to jestli je soubor vytvoreny (pokud se soubor rovna 1) jeste jsem vam zapomel rict, ze na windows serveru to funguje uplne v pohode ale na linuxu jakoby to funkci fopen preskocilo 1. najdi si stock CreateFile ... takhle se ti soubor nevytváří 2. nemůžou se ytvořit všechny to je blbost - ty vlastně jenom měníš string napis ale nic víc to nedělá uložíš pouze poslední naformátovaný string... 3. když budež pouzžívat stock tak to není potřeba ... 1 Link to comment Share on other sites More sharing options...
0 Sweet 7 Odesláno: 31. Říjen, 2012 Author Share Odesláno: 31. Říjen, 2012 1. najdi si stock CreateFile ... takhle se ti soubor nevytváří 2. nemůžou se ytvořit všechny to je blbost - ty vlastně jenom měníš string napis ale nic víc to nedělá uložíš pouze poslední naformátovaný string... 3. když budež pouzžívat stock tak to není potřeba ... vyuzivam vlastni file system.. trochu sem pohledal na netu a zjistil jsem, ze vic lidi resilo stejnej problem, ale s tim formatem si mi pomohl... vsem to prestalo blbnout kdyz vsechny ty blbosti hodily do jednoho formatu, jdu to vyzkouset Link to comment Share on other sites More sharing options...
0 Globální moderátor Hip 191 Odesláno: 31. Říjen, 2012 Globální moderátor Share Odesláno: 31. Říjen, 2012 vyuzivam vlastni file system.. trochu sem pohledal na netu a zjistil jsem, ze vic lidi resilo stejnej problem, ale s tim formatem si mi pomohl... vsem to prestalo blbnout kdyz vsechny ty blbosti hodily do jednoho formatu, jdu to vyzkouset použij strcat je to pro tebe v tomto případě lepší... resp. format + strcat zaroveň PS: spletl jsem si Poděkování s Citací.... 1 Link to comment Share on other sites More sharing options...
0 Sweet 7 Odesláno: 31. Říjen, 2012 Author Share Odesláno: 31. Říjen, 2012 použij strcat je to pro tebe v tomto případě lepší... resp. format + strcat zaroveň PS: spletl jsem si Poděkování s Citací.... diky za pomoc... uz jsem to vyresil, sice mi to zabralo 4 hodiny, protoze jsem tam musel predelavat takovejch veci, ze jsem rad ze jsem se v tom vyznal ale nakonec to funguje Link to comment Share on other sites More sharing options...
0 ATomas 291 Odesláno: 31. Říjen, 2012 Share Odesláno: 31. Říjen, 2012 Smaz if(SaveFile) To je podminka, pokud otevreni souboru probehlo v poradku, kdyz neexistuje tak asi ne ze ? Link to comment Share on other sites More sharing options...
Dotaz
Sweet 7
Cau, tohle mam v OnPlayerDisconnect ale ucet se mi proste nevytvori, pri tom se ma vytvorit kdyz je tam io_write pokud se nepletu.. (vyvola to ten printf) nevite nekdo jak to vyresit?
Link to comment
Share on other sites
8 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now