Guest ShockyCZE Odesláno: 4. Duben, 2009 Share Odesláno: 4. Duben, 2009 Zdarec pawneři.Jelikož jsem tu před 4 měsícema založil podobné téma ale to to se mi nechtělo obnovovat tak píšu sem, a ještě k tomu bylo na ho*no Věk vám sem dám i s /register, /login abyste se v tom vyznali Je to taková hotová funkce.Pod include new Vek[MAX_PLAYERS];//nadefinujeme OnplayerConnect Vek[playerid] = 11;//Aby to začlo počítat od 11 můžete zmenit Příkaz /register dcmd_register(playerid,params[]) { if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[ ! ] Uspěšně registrován "); { Vek[playerid] = 11; } if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[ ! ] Účet už existuje '/login heslo'."); if (strlen(params)==0) return SystemMsg(playerid,"[ ! ] Nejsi registrován '/register heslo'"); if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"[ ! ] Nyní jsi už registrován '/login heslo'"); return true; } Příkaz login dcmd_login(playerid,params[]) { if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"[ ! ] Přihlásit se můžeš pouze jednou"); if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"[ ! ] Nejsi tu zaregistrován '/register heslo'"); if (strlen(params)==0) return SystemMsg(playerid,"[ ! ] Nezadal jsi heslo"); if (udb_CheckLogin(PlayerName(playerid),params)) { PLAYERLIST_authed[playerid]=true; new string[256]; Vek[playerid]=dUserINT(PlayerName(playerid)).("Vek"); format(string, sizeof(string), "Věk: %d",Vek[playerid]); SendClientMessage(playerid, COLOR_RED, string); return SystemMsg(playerid,"[ ! ] OK, jsi přihlášen ! "); } return SystemMsg(playerid,"[ ! ] Login selhal"); } OnPlayerDisconnect dUserSetINT(PlayerName(playerid)).("Vek",Vek[playerid]); Na konec modu public SkontrolujVek() { new string[256]; for(new i = 0;i< MAX_PLAYERS; i++)//pro všechny hráče { if(IsPlayerConnected(i)) { Vek[i]++; format(string, sizeof(string), "[VĚK] Nyní ti je %d let! ",Vek[i]); SendClientMessage(i,COLOR_GAMES, string); if(Vek[i] >= 50 )//od 50 + bude mít šanci umřít { new KdyChcipnes; KdyChcipnes = random(8); switch(KdyChcipnes) { case 0: { format(string, sizeof(string), "Hráč %s se zatím žije %d let ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 1: { format(string, sizeof(string), "Hráč %s se zatím žije %d let ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 2: { format(string, sizeof(string), "Hráč %s se zatím žije %d let ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 3: { format(string, sizeof(string), "Hráč %s se zatím žije %d let ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 4: { format(string, sizeof(string), "Hráč %s se zatím žije %d let ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 5: { SetPlayerHealth(i, -1); format(string, sizeof(string), "Hráč %s umřel při %d letech ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 6: { SetPlayerHealth(i, -1); format(string, sizeof(string), "Hráč %s umřel při %d letech ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } case 7: { SetPlayerHealth(i, -1); format(string, sizeof(string), "Hráč %s umřel při %d letech ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } } if(Vek[i] == 110 ) { SetPlayerHealth(i, -1); format(string, sizeof(string), "Hráč %s umřel při %d letech ",Jmeno(i),Vek[i]); SendClientMessageToAll(COLOR_GAMES, string); } } } } } OnGameModeInit SetTimer("SkontrolujVek",180000, 1);//po 3 minutách se bude přičítat věk Jěště příkaz /vek dcmd_vek(playerid, params[]) { new string[128]; #pragma unused params format(string, sizeof(string), "[ ! ] Právě ti je %d let", Vek[playerid]); SendClientMessage(playerid,COLOR_YELLOW, string); return 1; } A ted můžete používat věk jako podmínku . Barvy si nadefinujte v případě zmněnte. To je vše S pozdravem ShockyCZE Link to comment Share on other sites More sharing options...
Guest ShErRy [HeAd_Sh0t] Odesláno: 4. Duben, 2009 Share Odesláno: 4. Duben, 2009 no celkom podarene a aj dobri napad Link to comment Share on other sites More sharing options...
Paulie 0 Odesláno: 4. Duben, 2009 Share Odesláno: 4. Duben, 2009 jj je to good :thumbup: Link to comment Share on other sites More sharing options...
Guest ShockyCZE Odesláno: 4. Duben, 2009 Share Odesláno: 4. Duben, 2009 diky chlapy. Link to comment Share on other sites More sharing options...
癌癌癌 1 Odesláno: 4. Duben, 2009 Share Odesláno: 4. Duben, 2009 Myslim,že to je dobrej nápad a máš to docela good až na to zase že lamky to jenom zkopčej a nic se nepoučej ale jinak :thumbup: Link to comment Share on other sites More sharing options...
Guest prezdivka Odesláno: 12. Duben, 2009 Share Odesláno: 12. Duben, 2009 jj Mazec ! sice taková hovadinka ale dobrý ! Link to comment Share on other sites More sharing options...
Guest Blueen Odesláno: 17. Listopad, 2010 Share Odesláno: 17. Listopad, 2010 COOL "rr" Link to comment Share on other sites More sharing options...
Roox 1 Odesláno: 17. Listopad, 2010 Share Odesláno: 17. Listopad, 2010 Trochu starý topic... Link to comment Share on other sites More sharing options...
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