Jump to content

Punct.

Membru
  • Posts

    488
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Punct.

  1. Intru pe server, apare dialogul pentru login(D_Login) si indiferent de ce parola as scrie e corecta..
  2. Avand in vedere ca la acest sistem de login/register m-am inspirat dintr-un tutorial si ca nu ma pricep prea bine la MySQL.. nu prea inteleg... Dar.. am functia de mai jos care ar trebui sa verifice daca existia.. [pawn] public OnAccountCheck(playerid) { new rows, fields; cache_get_data(rows, fields, mysql); if(rows) //if there is row { cache_get_row(0, 2, PlayerInfo[playerid][pPassword]); //we will load their password into PlayerInfo[playerid][Password] to be used in logging in //0 is row, 2 is field. If you're wondering why row is 0; remember we used LIMIT 1 while checking player's account. LIMIT is a limitation of results to be shown. Since we used LIMIT 1, it'd be like; // ---> row> ID | Username | Password | IP | Level | .... and so on // ^ ^ ^ ^ ^ // fields 0 1 2 3 4 //So we're getting row 0, field 2 which is password PlayerInfo[playerid][pID] = cache_get_row_int(0, 0); //now let's load player's ID into PlayerInfo[playerid][iD] so we can use it later ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Inainte de a putea juca pe server trebuie sa te loghezi.\n Introdu parola contului tau.", "Login", "Kick"); //And since we found a result from the database, which means, there is an account; we will show a login dialog } else //if we didn't find any rows from the database, that means, no accounts were found { //So we show the a dialog register ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Alege o parola si introdu-o in casuta de mai jos.", "Register", "Kick"); } return 1; }[/pawn] Si.. dialogul de care zici .. apare acel dialog daca gaseste contul in baza de date.. daca nu, apare dialogul D_Register..
  3. Pai vroiam sa doar sa aflu cu ce functie pot face asta.. Se poate da T.C.. Multumesc!
  4. [pawn]case D_Login: { if(!response) Kick(playerid); //if they clicked Quit, we will kick them //new hpass[129]; //for password hashing //WP_Hash(hpass, 129, inputtext); //hashing inputtext if(strcmp(inputtext, PlayerInfo[playerid][pPassword]) == 0) //if(!strcmp(hpass, PlayerInfo[playerid][pPassword])) //remember we have loaded player's password into this variable, PlayerInfo[playerid][pPassword] earlier. Now let's use it to compare the hashed password with password that we load { //if the hashed password matches with the loaded password from database //mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]); mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' AND `Password` = '%e'", Name[playerid], inputtext); mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid); } else //if the hashed password didn't match with the loaded password(PlayerInfo[playerid][pPassword]) { ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Parola introdusa este incorecta.", "Login", "Kick"); } }[/pawn] La fel.. ma lasa sa ma conectez indiferent de ce parola as pune..
  5. Painu vreau sa se afiseze.. doar sa se retina pentru a-l compara cu un string.
  6. Sa zicem ca avem cateva TextDraw-uri Pe primul scrie A, iar pe al doilea scrie B, pe al treilea C, ... Atunci cand apesi pe primul, apoi pe al doilea, apoi pe al treilea sa se formeze un text "ABC" Atunci cand apesi al doilea, apoi pe primul, apoi pe al treilea sa se formeze un text "BAC" Atunci cand apesi pe al treilea, apoi pe primul, apoi pe al doilea, apoi pe primul sa se formeze un text "CAB" Atunci cand apesi pe al treilea, apoi pe al doilea, apoi pe primul sa se formeze un text "CBA" In functie de ordinea in care se apasa pe butoane sa se formeze un text cu ce scrie pe acele butoane
  7. Nu e bine asa?: [pawn]public OnAccountCheck(playerid) { new rows, fields; cache_get_data(rows, fields, mysql); if(rows) //if there is row { cache_get_row(0, 2, PlayerInfo[playerid][pPassword]); //we will load their password into PlayerInfo[playerid][Password] to be used in logging in //0 is row, 2 is field. If you're wondering why row is 0; remember we used LIMIT 1 while checking player's account. LIMIT is a limitation of results to be shown. Since we used LIMIT 1, it'd be like; // ---> row> ID | Username | Password | IP | Level | .... and so on // ^ ^ ^ ^ ^ // fields 0 1 2 3 4 //So we're getting row 0, field 2 which is password PlayerInfo[playerid][pID] = cache_get_row_int(0, 0); //now let's load player's ID into PlayerInfo[playerid][iD] so we can use it later ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Inainte de a putea juca pe server trebuie sa te loghezi.\n Introdu parola contului tau.", "Login", "Kick"); //And since we found a result from the database, which means, there is an account; we will show a login dialog } else //if we didn't find any rows from the database, that means, no accounts were found { //So we show the a dialog register ShowPlayerDialog(playerid, D_Register, DIALOG_STYLE_INPUT, "Register", "Alege o parola si introdu-o in casuta de mai jos.", "Register", "Kick"); } return 1; }[/pawn]
  8. Nume: Punct. Nume tutorial: Textdraw -> text Descriere: Facem doua textdraw-uri. Pe primul scriem "a" si pe al 2-lea "b". Cand dai click pe primul apoi pe al doilea sa se faca un cuvant.. ar veni "ab". Cand dai click pe al doilea apoi pe primul sa facem cuvantul "ba"
  9. Nick: Punct. Problema: Cand ma loghez pe server, orice parola as introduce in dialog ma logheaza. Erori / warnings: - Lini/script: [pawn] if(strcmp(inputtext, PlayerInfo[playerid][pPassword]) == 0) //if(!strcmp(hpass, PlayerInfo[playerid][pPassword])) //remember we have loaded player's password into this variable, PlayerInfo[playerid][pPassword] earlier. Now let's use it to compare the hashed password with password that we load { //if the hashed password matches with the loaded password from database mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Username` = '%e' LIMIT 1", Name[playerid]); mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid); } else //if the hashed password didn't match with the loaded password(PlayerInfo[playerid][pPassword]) { ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, "Login", "Parola introdusa este incorecta.", "Login", "Kick"); } [/pawn] Ai incercat sa rezolvi singur ?: da..
  10. Punct.

    Problema RCON

    Apare vreun mesaj cand te loghezi cu parola RCON?
  11. Punct.

    Problema RCON

    Apare vreun mesaj cand te loghezi?
  12. Punct.

    Ceas

    Ai un model de respectat!
  13. Punct.

    AJUTOR WOS!

    Uite aici server.cfg echo Executing Server Config... lanmode 0 rcon_password [nuintereseaza] password maxplayers 50 bind 188.212.100.137 port 7777 hostname WOS.Samp.ro gamemode0 (RRS-Beta) filterscripts plugins streamer.so sscanf.so mysql_static.so gvar.so Whirlpool.so announce 1 query 1 weburl www.Sa-MP.com maxnpc 10 onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000 Plugin-ul mysq_static.so il poti lua de AICI
  14. Punct.

    AJUTOR WOS!

    Posteaza server.cfg .. cred ca e de la un plugin
  15. Greu tare.. [pawn] CMD:gov(playerid, params[]) { new string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!IsACop(playerid) && !IsAGov(playerid) && !IsMedic(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an BCSD Officer/Government Official."); if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader."); if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[usage]: (/gov)ernment announcement [text]"); if(AntiAdv(playerid, params)) return 1; format(string, sizeof(string), "|___________ %s News Announcement ___________|", RPFNEx(playerid)); SendClientMessageToAll(COLOR_WHITE, string); if(IsACop(playerid)) format(string, sizeof(string), "** PSA from Sheriff %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsAMedic(playerid)) format(string, sizeof(string), "** PSA from Hospital Director %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsAGov(playerid)) format(string, sizeof(string), "**PSA from Mayor of Bone County %s %s: %s **", RPFRN(playerid), RPN(playerid), params); SendClientMessageToAll(COLOR_BLUE, string); return 1; }[/pawn] Nu stiu ce reprezinta RPFRN(playerid), RPN(playerid), deci nu modific pe la %s..
  16. Nu am inteles eu ce-i cu PSA, EMS, GOV de pe acolo... dar modifica de aici si vezi daca merge [pawn] CMD:gov(playerid, params[]) { new string[128]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(!IsACop(playerid) && !IsAGov(playerid) && !IsMedic(playerid) && !IsFBI(playerid) && !IsARES(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an BCSD Officer/Government Official."); if(!PlayerInfo[playerid][pFacLeader]) return SendClientMessage(playerid, COLOR_GREY, "You are not a faction leader."); if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[usage]: (/gov)ernment announcement [text]"); if(AntiAdv(playerid, params)) return 1; format(string, sizeof(string), "|___________ %s News Announcement ___________|", RPFNEx(playerid)); SendClientMessageToAll(COLOR_WHITE, string);if(IsACop(playerid)) format(string, sizeof(string), "** [Politie] %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsAMedic(playerid)) format(string, sizeof(string), "** [Medic] %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsAFBI(playerid)) format(string, sizeof(string), "** [FBI] %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsAFBI(playerid)) format(string, sizeof(string), "** [FBI] %s %s: %s **", RPFRN(playerid), RPN(playerid), params); else if(IsARES(playerid)) format(string, sizeof(string), "** [RES] %s %s: %s **", RPFRN(playerid), RPN(playerid), params); SendClientMessageToAll(COLOR_BLUE, string); return 1; } [/pawn]
  17. Nick: Punct. Problema: Daca cineva iese de pe server i se reseteaza conturl. Primeste valorile DEFAULT puse in baza de date. Erori / warnings: - Lini/script: [pawn] public GameModeInitExitFunc() { new string[182]; format(string, sizeof(string), "Server Restart, va rugam asteptati..."); foreach(Player, i) { SCM(i, c_alb, string); SCont(i); } SetTimer("GameModeExitFunc", 3000, 0); return 1; } public GameModeExitFunc() { KillTimer(vtimer); SSeif(); STeri(); SCars(); KillTimer(timerr); GameModeExit(); return 1; } /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ /* * OnGameModeExit * */ /*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/ public OnGameModeExit() { KillTimer(vtimer); for(new i=0; i<MAX_PLAYERS; i++) { TextDrawDestroy(FUEL); TextDrawDestroy(HP); TextDrawDestroy(Speed); TextDrawDestroy(Name_V); //TextDrawDestroy(Zones); } SSeif(); STeri(); SCars(); foreach(Player, i) { SCont(i); } KillTimer(timerr); return 1; } public SCont(playerid) { mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Level`='%d', `Money`='%d', `AdminLevel`='%d', `Kills`='%d', `Deaths`='%d', `HouseKey`='%d', `Spawn`='%d', `Tutorial`='%d', `Skin`='%d', `Job`='%d', `Curse`='%d', `Factiune`='%d', `Rank`='%d', `Lider`='%d', `Car`='%d' WHERE `ID`='%d'", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pHouseKey], PlayerInfo[playerid][pSpawn], PlayerInfo[playerid][pTutorial], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pCurse], PlayerInfo[playerid][pFactiune], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pLider], PlayerInfo[playerid][pCar], PlayerInfo[playerid][pID]); mysql_tquery(mysql, query, "", ""); return 1; } [/pawn] Ai incercat sa rezolvi singur ?: Da. Am incercat sa fac cu GameModeExitFunc si GameModeInitExitFunc
  18. Mai inchide o acolada ( } )
  19. Pune cateva linii sa vedem scriptul.. 90-100
  20. Nu ajut pentru RESPECT.. Dar pentru viitor: in stanga, sub nume este o sageata verde..
  21. Exista un biz care se ocupa cu asa ceva. Proprietarul trebuie sa schimbre pretul. /bizgunprice parca era comanda. GM-ul este prost aranjat, foarte multe lucruri inutile. Avand in vedere ca este rGaming edit iti dau un 3/10:P
  22. Punct.

    AJUTOR WOS!

    Numele topicului cam aiurea.. Ceva de la mysql.. sigur folosesti aceeasi versiune de mysql in tot scriptul?
  23. http://wiki.sa-mp.com/wiki/SetPlayerMapIcon http://wiki.sa-mp.com/wiki/MapIconStyle
  24. Rezolvat! Am uitat o " , "
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.