Majitel ffredyk 168 Odesláno: 18. Únor, 2010 Majitel Share Odesláno: 18. Únor, 2010 Muzete to brat jako takovy doplnek k predeslymu tutu.. Rekneme, ze chceme udelat registraci, ktera nastavy 3 floaty na "0", 2 integery na hodnoty, 1 string na heslo a jmeno souboru jako jmeno hrace.. + Cely soubor do vlastni slozky.. Nejdrive si do newu hodime dlasi promene: new Float:X, Float:Y, Float:Z, Ridicak, Skin, Logged[MAX_PLAYERS]; Ted muzem napsat do OnPlayerConnect nejakou zpravu at se hrac prihlasi... Dale do OnPlayerRequestSpawn napiseme kontrolu jestli je prihlaseny: if(!Logged[playerid]) return SendClientMessage(playerid,BARVA,"Njesi prihlaseny! Prihlas se!"); Ted se muzeme vrhnout na samotne prikazy.. Ja budu pouzivat DCMD pac jinak bych musel pouzivat chrfind funkci a par z vas by se v tom mohla zamotat.. Takze OnPlayerCommandText: dcmd(login,5,cmdtext); dcmd(register,8,cmdtext); A ted.. Muzeme na samotne DCMD definice... Login: dcmd_login(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"Slozka/%s.dat",Jmeno(playerid)); //Zformatovani cesty k souboru if(Logged[playerid]) return SendClientMessage(playerid,BARVA,"Uz jsi prihlaseny!"); //Kontrola jestli je hrac prihlasen if(!dini_Exists(cesta)) return SendClientMessage(playerid,BARVA,"Nejsi registrovany! Registruj se!"); //Kontrola jestli je hrac ubec registrovan else if(!strcmp(params,dini_Get(cesta,"HESLO"),true)) //Kontrola jestli se shoduji hesla ze souboru a napsaneho hracem { Float:X = dini_Float(cesta,"X"); //Precteni pozice X Float:Y = dini_Float(cesta,"Y"); //Precteni pozice Y Float:Z = dini_Float(cesta,"Z"); //Precteni pozice Z Ridicak = dini_Int(cesta,"RIDIC"); //Precteni jestli ma ridicak Skin = dini_Int(cesta,"SKIN"); //Precteni jaky mel skin Logged[playerid] = 1; //Nastaveni promene aby byl prihlaseny SpawnPlayer(playerid); //Spawn hrace SetPlayerPos(playerid,X,Y,Z); //Nastaveni pozice SetPlayerSkin(playerid,Skin); //Nastaveni skinu } else SendClientMessage(playerid,BARVA,"Hesla se neshoduji!"); //Hrac napsal spatne heslo return 1; } Vse jasne napsane.. Pokud byste neco nechapali napiste sem.. Register: dcmd_register(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"Slozka/%s.dat",Jmeno(playerid)); //Zformatovani cesty k souboru if(Logged[playerid]) return SendClientMessage(playerid,BARVA,"Uz jsi prihlaseny!"); //Kontrola jestli je hrac prihlasen if(dini_Exists(cesta)) return SendClientMessage(playerid,BARVA,"Uz jsi registrovany! Prihlas se!"); //Kontrola jestli je hrac registrovan else //Pokud neni registrovany { dini_FloatSet(cesta,"X","0"); //Nastaveni pozice X dini_FloatSet(cesta,"Y","0"); //Nastaveni pozice Y dini_FloatSet(cesta,"Z","0"); //Nastaveni pozice Z dini_IntSet(cesta,"RIDIC","0"); //Nastaveni ridicaku dini_IntSet(cesta,"SKIN","1"); //Nastaveni skinu SendClientMessage(playerid,BARVA,"Uspesne registrovan!"); //Hlaska o uspesne registraci dini_Set(cesta,"HESLO",params); } return 1; } Nezapomente si upravit slozku k souboru! Kdyby jste nemeli stock Jmeno: stock Jmeno(playerid) { new j[MAX_PLAYER_NAME]; GetPlayrName(playerid,j,sizeof(j)); return j; } Chyby: error 017: undefined symbol "BARVA" Zmente si barvu textu! error 017: undefined symbol "dcmd" Nahoru do modu: #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Proc davas dini_FloatSet(cesta,"X","0"); //Nastaveni pozice X dini_Float(cesta,"Y","0"); //Nastaveni pozice Y dini_Float(cesta,"Z","0"); //Nastaveni pozice Z dini_floatset? a pak jen dini_float ? To se musí že je to pozice XYZ a melo by to bejt stejny no já neznam dini funkce ... Link to comment Share on other sites More sharing options...
Majitel ffredyk 168 Odesláno: 18. Únor, 2010 Author Majitel Share Odesláno: 18. Únor, 2010 Jo.. ja si kopnul login a prepisoval.. hned upravim Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 áá práce se soubory dini to bude lepsi si udelat vlasni ... bb .. no dobrej TUTik Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 hmm nechapem co stim "HESLO" Link to comment Share on other sites More sharing options...
rEf 53 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Ake heslo? Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 precti si ten tut hore... Link to comment Share on other sites More sharing options...
rEf 53 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Omg já už si to dával hodněkrát do modu a šlo to v poho tk nvm co v tom lovíš... -- čtv 18. úno 2010 10:28:25 -- Toto? else if(!strcmp(params[],dini_Get(cesta,"HESLO"),true)) //Kontrola jestli se shoduji hesla ze souboru a napsaneho hracem Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 tak skus poslat jak to máš ty.. ja mám dcmd_register(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"bibinakwars/registrations/%s.dat",PlayerName(playerid)); //Zformatovani cesty k souboru if(PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,B_BILA,"[=!=] Už si prihlásený."); //Kontrola jestli je hrac prihlasen if(dini_Exists(cesta)) return SendClientMessage(playerid,B_BILA,"[=!=] Účet už existuje. Prihláste sa /login heslo."); //Kontrola jestli je hrac registrovan else //Pokud neni registrovany { SendClientMessage(playerid,B_CERVENA,"[=!=] Účet bol úspešne vytvorený. Prihláste sa /login heslo."); //Hlaska o uspesne registraci } return 1; } dcmd_login(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"bibinakwars/registrations/%s.dat",PlayerName(playerid)); //Zformatovani cesty k souboru if(PLAYERLIST_authed[playerid]) return SendClientMessage(playerid,B_BILA,"[=!=] Už si prihlásený."); //Kontrola jestli je hrac prihlasen if(!dini_Exists(cesta)) return SendClientMessage(playerid,B_BILA,"=!=] Účet neexistuje. Zaregistruj sa /register heslo."); //Kontrola jestli je hrac ubec registrovan else if(!strcmp(params[],dini_Get(cesta,"HESLO"),true)) //Kontrola jestli se shoduji hesla ze souboru a napsaneho hracem { adminlevel[playerid] = dini_Int(cesta,"adminlevel"); //ci ma adminlvl PLAYERLIST_authed[playerid] = 1; //Nastaveni promene aby byl prihlaseny } else SendClientMessage(playerid,B_BILA,"[=!=] Login neúspešný. Pravdepodobne zle zadané heslo."); //Hrac napsal spatne heslo return 1; } errory C:\samp-server\gamemodes\res-by-bibinak.pwn(1995) : warning 203: symbol is never used: "params" C:\samp-server\gamemodes\res-by-bibinak.pwn(2014) : error 029: invalid expression, assumed zero ten warning vim ze treba dat #pragma unused params ale nejak se mi to nezda ze pri registraci davas params, ne? Link to comment Share on other sites More sharing options...
rEf 53 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 dcmd_login(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"Slozka/%s.dat",Jmeno(playerid)); //Zformatovani cesty k souboru if(Logged[playerid]) return SendClientMessage(playerid,BARVA,"Uz jsi prihlaseny!"); //Kontrola jestli je hrac prihlasen if(!dini_Exist(cesta)) return SendClientMessage(playerid,BARVA,"Nejsi registrovany! Registruj se!"); //Kontrola jestli je hrac ubec registrovan else if(!strcmp(params[],dini_Get(cesta,"HESLO"),true)) //Kontrola jestli se shoduji hesla ze souboru a napsaneho hracem { Float:X = dini_Float(cesta,"X"); //Precteni pozice X Float:Y = dini_Float(cesta,"Y"); //Precteni pozice Y Float:Z = dini_Float(cesta,"Z"); //Precteni pozice Z Ridicak = dini_Int(cesta,"RIDIC"); //Precteni jestli ma ridicak Skin = dini_Int(cesta,"SKIN"); //Precteni jaky mel skin Logged[playerid] = 1; //Nastaveni promene aby byl prihlaseny SpawnPlayer(playerid); //Spawn hrace SetPlayerPos(playerid,X,Y,Z); //Nastaveni pozice SetPlayerSkin(playerid,Skin); //Nastaveni skinu } else SendClientMessage(playerid,BARVA,"Hesla se neshoduji!"); //Hrac napsal spatne heslo return 1; } dcmd_register(playerid,params[]) { new cesta[50]; //Vytvoreni stringu na cestu k souboru format(cesta,50,"Slozka/%s.dat",Jmeno(playerid)); //Zformatovani cesty k souboru if(Logged[playerid]) return SendClientMessage(playerid,BARVA,"Uz jsi prihlaseny!"); //Kontrola jestli je hrac prihlasen if(dini_Exist(cesta)) return SendClientMessage(playerid,BARVA,"Uz jsi registrovany! Prihlas se!"); //Kontrola jestli je hrac registrovan else //Pokud neni registrovany { dini_FloatSet(cesta,"X","0"); //Nastaveni pozice X dini_FloatSet(cesta,"Y","0"); //Nastaveni pozice Y dini_FloatSet(cesta,"Z","0"); //Nastaveni pozice Z dini_IntSet(cesta,"RIDIC","0"); //Nastaveni ridicaku dini_IntSet(cesta,"SKIN","1"); //Nastaveni skinu SendClientMessage(playerid,BARVA,"Uspesne registrovan!"); //Hlaska o uspesne registraci } return 1; } Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 jinak ma byt Dini_Exists ne? a ukaž registraci..PLS Link to comment Share on other sites More sharing options...
rEf 53 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Je snad někde napsaný že tam má být Dini_Exists? A máš to ve spoileru... Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 ja newim proste mi tam na ten riadok else if(!strcmp(params[],dini_Get(cesta,"HESLO"),true)) hadze furt error: C:\samp-server\gamemodes\res-by-bibinak.pwn(2014) : error 029: invalid expression, assumed zero Link to comment Share on other sites More sharing options...
rEf 53 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Njn ted koukam mam jinou registraci Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 mno ja som ti napisal len nejak neodpisuješ Link to comment Share on other sites More sharing options...
Guest Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 bibiniak aj ja mám cez dini ale som v škole doma ti ukážem ako to mám ja... Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 ja newim proste mi tam na ten riadok else if(!strcmp(params[],dini_Get(cesta,"HESLO"),true)) hadze furt error: C:\samp-server\gamemodes\res-by-bibinak.pwn(2014) : error 029: invalid expression, assumed zero Skus else if(!strcmp(params,dini_Get(cesta,"HESLO"),true))[/ Link to comment Share on other sites More sharing options...
Majitel ffredyk 168 Odesláno: 18. Únor, 2010 Author Majitel Share Odesláno: 18. Únor, 2010 V tutu sem objevil 2 chyby.. Jednu bibinakovo a druhou takovou funkcni.. /register neukaldal heslo.. Vse je opraveno Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Jednu sem stejně opravil já btw ffredyku ještě nefunguje funkce dini_Exist ... ale je dini_Exists .. jak sem se dočet .. Link to comment Share on other sites More sharing options...
Majitel ffredyk 168 Odesláno: 18. Únor, 2010 Author Majitel Share Odesláno: 18. Únor, 2010 Jednu sem stejně opravil já btw ffredyku ještě nefunguje funkce dini_Exist ... ale je dini_Exists .. jak sem se dočet .. Me dini_Exist jede v pohode xP stock dini_Exist(filename[]) { return fexist(filename); } Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 xP tak si si předělal includ Link to comment Share on other sites More sharing options...
Majitel ffredyk 168 Odesláno: 18. Únor, 2010 Author Majitel Share Odesláno: 18. Únor, 2010 xP tak si si předělal includ Nn.. Mozna ten co ho daval na stahnuti xD Link to comment Share on other sites More sharing options...
AvestX 5 Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 Tak ten pán co to vynalez tak dal jestli to stahuje moje IP tak se stahne stará verze že ? Link to comment Share on other sites More sharing options...
Guest BibinaK Odesláno: 18. Únor, 2010 Share Odesláno: 18. Únor, 2010 no ved som to hovoril ze tam je nekde error.. ze aby nebolo params pouzito v registraci xD Link to comment Share on other sites More sharing options...
zelva 0 Odesláno: 11. Březen, 2010 Share Odesláno: 11. Březen, 2010 hmm mohly by jste mi rict jak opravit tu registraci aby to ukladalo pls 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