Pulpisek 0 Odesláno: 28. Prosinec, 2013 Share Odesláno: 28. Prosinec, 2013 Zdravím chtěl bych v jednom FS udělat dvojí ukládání a nevím jak na to tak experimentuju. Ale furt výsledku. public OnPlayerConnect(playerid) { //----------------------------------------Ukládání jobů------------------------------------ new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); Job[playerid] = dini_Int(cesta,"JOBS"); if(Job[playerid] == 2) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič kamionu"); if(Job[playerid] == 1) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič společnosti PPL"); if(Job[playerid] == 0) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi nezaměstnany"); new cestas[50]; format(cestas,50,"autoskola/%s.sav",PlayerName(playerid)); if(dini_Exists(cestas)){ ridicak[playerid] = dini_Int(cesta,"ridic"); }else{ dini_Create(cestas); } if(ridicak[playerid] == 1) SendClientMessage(playerid, COLOR_ZELENA,"Už vlastníš řidický průkaz"); if(ridicak[playerid] == 0) SendClientMessage(playerid, COLOR_ZELENA,"Nevlastníš řidický průkaz."); return 1; } public OnPlayerDisconnect(playerid, reason) { //------------------------------Ukládání jobů--------------------------------------------------------- new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); if(!dini_Exists(cesta)) { dini_Create(cesta); } else { dini_IntSet(cesta,"JOBS",Job[playerid]); } //-------------------------------------Konec----------------------------------------------- new cestas[50]; format(cestas,50,"autoskola/%s.sav",PlayerName(playerid)); dini_IntSet(cestas,"ridic",ridicak[playerid]); return 1; } Takto to mám, tuším že je to strašná volovina. Tak už asi vím zatím dobrý dám vědět kdyby ne Link to comment Share on other sites More sharing options...
0 Akai 1 Odesláno: 28. Prosinec, 2013 Share Odesláno: 28. Prosinec, 2013 Z Disconnectu dej do Connectu tohle: if(!dini_Exists(cesta)) dini_Create(cesta); Link to comment Share on other sites More sharing options...
0 Pulpisek 0 Odesláno: 29. Prosinec, 2013 Author Share Odesláno: 29. Prosinec, 2013 A když to mám takto je to kravina ? public OnPlayerConnect(playerid) { //----------------------------------------Ukládání jobů------------------------------------ new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); Job[playerid] = dini_Int(cesta,"JOBS"); ridicak[playerid] = dini_Int(cesta,"ridicak"); if(Job[playerid] == 2) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič kamionu."); if(Job[playerid] == 1) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič společnosti PPL."); if(Job[playerid] == 0) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi nezaměstnany."); if(ridicak[playerid] == 0) return SendClientMessage(playerid, COLOR_ZELENA,"Nemáš řidický průkaz udělej si ho v autoškole v LV za 15 000$."); if(ridicak[playerid] == 1) return SendClientMessage(playerid, COLOR_ZELENA,"Máš řidický průkaz."); return 1; } public OnPlayerDisconnect(playerid, reason) { //------------------------------Ukládání jobů--------------------------------------------------------- new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); if(!dini_Exists(cesta)) { dini_Create(cesta); } else { dini_IntSet(cesta,"JOBS",Job[playerid]); dini_IntSet(cesta,"ridicak",ridicak[playerid]); } //-------------------------------------Konec----------------------------------------------- return 1; } Nejsme si jist a byl bych rád kdyby někdo mi to pomohl upravit. Nejspíš nejde moc dobře načítání. Protože mi nechce v conncetu zobrazit to že mám nebo nemám řidičák. Ale job mi to ukáže co stím ? Link to comment Share on other sites More sharing options...
0 Akai 1 Odesláno: 29. Prosinec, 2013 Share Odesláno: 29. Prosinec, 2013 Řekl jsem ti, co s tím máš udělat, ne?// public OnPlayerConnect(playerid) { //----------------------------------------Ukládání jobů------------------------------------ new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); if(!dini_Exists(cesta)) dini_Create(cesta); Job[playerid] = dini_Int(cesta,"JOBS"); if(Job[playerid] == 2) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič kamionu"); if(Job[playerid] == 1) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi zaměstnaný jako řidič společnosti PPL"); if(Job[playerid] == 0) return SendClientMessage(playerid, COLOR_ZELENA,"Jsi nezaměstnany"); new cestas[50]; format(cestas,50,"autoskola/%s.sav",PlayerName(playerid)); if(dini_Exists(cestas)){ ridicak[playerid] = dini_Int(cesta,"ridic"); }else{ dini_Create(cestas); } if(ridicak[playerid] == 1) SendClientMessage(playerid, COLOR_ZELENA,"Už vlastníš řidický průkaz"); if(ridicak[playerid] == 0) SendClientMessage(playerid, COLOR_ZELENA,"Nevlastníš řidický průkaz."); return 1; } public OnPlayerDisconnect(playerid, reason) { //------------------------------Ukládání jobů--------------------------------------------------------- new cesta[50]; format(cesta,50,"JOBS/%s.sav",PlayerName(playerid)); dini_IntSet(cesta,"JOBS",Job[playerid]); //-------------------------------------Konec----------------------------------------------- new cestas[50]; format(cestas,50,"autoskola/%s.sav",PlayerName(playerid)); dini_IntSet(cestas,"ridic",ridicak[playerid]); return 1; } Link to comment Share on other sites More sharing options...
Dotaz
Pulpisek 0
Zdravím chtěl bych v jednom FS udělat dvojí ukládání a nevím jak na to tak experimentuju. Ale furt výsledku.
Takto to mám, tuším že je to strašná volovina.
Tak už asi vím zatím dobrý dám vědět kdyby ne
Link to comment
Share on other sites
3 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