marekK50 0 Odesláno: 7. Březen, 2012 Share Odesláno: 7. Březen, 2012 aojte, chcem sa spýtať, ako urobím príkaz /informácie a bude ukazovať nahraty čas atd. ? Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 10. Březen, 2012 Share Odesláno: 10. Březen, 2012 prikaz, format, premenne na cas, ukladanie casu do suboru, nacitanie casu zo suboru Link to comment Share on other sites More sharing options...
0 Hrb™ 48 Odesláno: 10. Březen, 2012 Share Odesláno: 10. Březen, 2012 Tak třeba takto. Když napíšeš /informace zobrazí se jméno, kolik nahrál hodin a minut. Zbytek si zkus přidat sám. Když tak napiš. Kdyby jsem měl něco špatně, tak mě opravte prosím. Děkuji k new: new minuta[MAX_PLAYERS]; new hodina[MAX_PLAYERS]; k forward: forward minutaa(playerid); k timeru: SetTimer("minutaa",60000,1); k public: public minutaa(playerid) { for(new i=0;i { if(IsPlayerConnected(i)) { minuta[playerid] = minuta[playerid]+1; if (minutka[playerid] > 59){ minuta[playerid] = 0; hodina[playerid] = hodina[playerid]+1; }}}} Do: OnPlayerCommandText: dcmd(informace,4,cmdtext); A potom kamkoliv do módu: dcmd_informace(playerid, params[]) // když napíšeme /info { #pragma unused params new string[100]; format(string,sizeof(string),"Jméno:%s\nHodin: %d\n Minut %d", // jak to půjde po sobě PlayerName(playerid),hodina[playerid],minuta[playerid]; ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Info",string,"Potvrdit",""); return 1; } A nakonec si to musíš ukládat: do OnPlayerConnect: minuta[playerid] = dUserINT(PlayerName(playerid)).("Minut:"); hodina[playerid] = dUserINT(PlayerName(playerid)).("Hodin:"); do OnPlayerDisconnect: if (PLAYERLIST_authed[playerid]) // Když je přihlášený { dUserSetINT(PlayerName(playerid)).("Hodin:",hodina[playerid]); dUserSetINT(PlayerName(playerid)).("Minut:",minuta[playerid]); } PLAYERLIST_authed[playerid] = false; // Dáme ho, že není odpojený Link to comment Share on other sites More sharing options...
Dotaz
marekK50 0
aojte, chcem sa spýtať, ako urobím príkaz /informácie a bude ukazovať nahraty čas atd. ?
Link to comment
Share on other sites
2 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