Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.
Üzenetek - TheMesziErik
46
« Dátum: 2012. április 29. - 17:20:24 »
Pakolj még bele. Úgy lesz az igazi!
Oké! tippek: unwarn banwarn unbanwarn /aduty <- csak ötös adminnak (és 3dtextel mutatná, hogy adminszolgálatban) menthetné a szerveren töltött idõt.. /jail (nem néztem fõposztot, lehet már van) /unjail (nem néztem fõposztot, lehet már van) sok sikert. [/quote] Én is terveztem ezeket, köszi!
47
« Dátum: 2012. április 29. - 16:18:01 »
Akarok csinálni a mysql-os adminrendszeremhez egy include-t. Az OnPlayerConnect rész alatt lévõ mysql lekérdezést is átmásoljam az include-ba?
48
« Dátum: 2012. április 29. - 12:38:48 »
Helló! Lenne egy olyan kérdésem, hogy a MySQL csatlakozást is átrakjam az include-be, vagy csak a stock-okat?
49
« Dátum: 2012. április 29. - 09:16:35 »
Köszönöm a segítséget!
50
« Dátum: 2012. április 29. - 08:52:19 »
Helló! Hogyan tudnék include-t csinálni az adminrendszeremhez? Nézegettem az ladminét, de nem értem ezt a részt benne: #if defined _ladmin_included #endinput #endif #define _ladmin_included #pragma library ladmin
51
« Dátum: 2012. április 28. - 10:57:05 »
Esetleg be tudnád másolni a parancsot?
52
« Dátum: 2012. április 26. - 21:50:21 »
Az alapjait megcsináltam: #include <a_samp> #include <zcmd> #include <sscanf2> new BlockCMD[MAX_PLAYERS]; public OnPlayerText(playerid, text[]) { if(BlockCMD[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Nem használhatsz parancsot!\"); return 1; } CMD:lecsuk(playerid, params[]) { if(GetPlayerAdminLevel(playerid) <= 2) return SendClientMessage(playerid, COLOR_ERROR, \"Nem használhatod ezt a parancsot!\"); { new player, ido, indok; if(sscanf(params, \"uis[128]\", player, ido, indok)) return SendClientMessage(playerid, COLOR_ERROR, \"Használat: /lecsuk [Név/ID] [idõ] [indok]\"); else if(!IsPlayerConnected(gotoplayer)) return SendClientMessage(playerid, COLOR_ERROR, \"A játékos nincs csatlakozva!\"); { BlockCMD[player] = 1; SetPlayerPos(player, 780.4083, 1681.8748, 5.2813); } } return true; }
53
« Dátum: 2012. április 26. - 17:32:10 »
Ilyen találtam: Majd írd át az adatokat! index.php fájl: <html> <head> <title>Schumi - Upload Form</title> <script type=\"text/javascript\"> function UpMutat(id) { var e = document.getElementById(id); if(e.style.visibility == \'visible\') e.style.visibility = \'hidden\'; else e.style.visibility = \'visible\'; } </script> <style type=\"text/css\"> <!-- html, body { background-color: #000000; height: 100%; padding: 0; margin: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #FFFFCC; } .upstyle { position:absolute; width:99%; height: 98%; z-index:1; left: 0px; top: 0px; background-color: #000000; border-style: solid; border-width: 3px; border-color: FFFFCC; overflow: visible; visibility: hidden; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 21px; color: #FFFFCC; } --> </style> </head> <body> <div align=\"center\" class=\"upstyle\" id=\"uploading\"> <p align=\"center\"><br><br><b>Uploading file(s)!<br><br>Please wait!</p> </div> <center> <p>Upload files here, 5 files at a time. (512 MB/file, 1024 MB MAX)</p> <p> <form name=\"fileup\" method=\"post\" enctype=\"multipart/form-data\" action=\"upload.php\"> <input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br> <input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br> <input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br> <input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br> <input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br> <br> <input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"5120000000\"> <input type=\"submit\" id=\"sub\" value=\"submit\" name=\"submit\" onclick=\"UpMutat(\'uploading\');\"> </form> </center> </body> </html> upload.php fájl: <html> <body bgcolor=\"000000\"> <center> <font face=\"verdana\" size=\"3\" color=\"FFFFCC\"> <? //uses $_FILES[] global array //see manual for older PHP version info //This function will be used to get the extension from the filename Function get_extension($file,$length=-1){ $p = strrpos($file,\".\"); $p++; If($length!=-1){ $ext = substr($file,$p,$length); } If($length==-1){ $ext = substr($file,$p); } $ext = strtolower($ext); Return $ext; } //Not good practice, but here anyway //change to suit your needs //also some have to be set in the ini //for this to correctly work //512 MB max. méret Ini_set(\"upload_max_filesize\",\"512M\"); //turn on file uploads Ini_set(\"file_uploads\",\"1\"); //set your temp dir Ini_set(\"upload_tmp_dir\",\"/temp\"); //set post size large enough to accomidate //3 100meg files and some overhead Ini_set(\"post_max_size\",\"1024M\"); ?> </p> <? //check to see if we have submited yet If($_POST[\"submit\"]!=\"submit\"){ //not yet so lets make the form ?> <? } //see if we have submited and that the files array has been set If(($_POST[\"submit\"]==\"submit\")&&(is_array($_FILES[\'userfiles\']))){ $ftp_user_name=\"[email protected]\"; //change to ftp username $ftp_user_pass=\"valami_jelszo\"; //change to ftp password $ftp_server=\"ftp.valami.hu\"; //change to ftp url $ftp_dump_dir=\"/uploaded_files\"; //change to destination directory //go through all the files For($x=0;$x<count($_FILES[\'userfiles\'][\'name\']);$x++){ //now we do some file checking //check to see if file is there If($_FILES[\'userfiles\'][\'name\'][$x]!=\"none\"){ //file has a name //check filesize If($_FILES[\'userfiles\'][\'size\'][$x]!=0){ //file is larger than 0 bytes //Check to see if it is uploaded If(is_uploaded_file($_FILES[\'userfiles\'][\'tmp_name\'][$x])){ //file has been uploaded! //let the user know their file has be uploaded Echo \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" uploaded successfully!<br><br>\"; //conect to ftp server $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection If ((!$conn_id) || (!$login_result)) { Echo \"FTP connection has failed!<br><br>\"; Echo \"Attempted to connect to $ftp_server for user $ftp_user_name\"; Exit; } else { Echo \"Connected to $ftp_server! <br><br>\"; //set PASV mode If(!ftp_pasv($conn_id,TRUE)){ Echo \"Could not enter PASV mode!\"; } //rename to file#_date.Ext $filename = $_FILES[\'userfiles\'][\'name\'][$x]; //$filename.= \".\".Get_extension($_FILES[\'userfiles\'][\'name\'][$x],3); //change directory //If (@ftp_chdir($conn_id, $ftp_dump_dir)) { //maybe you want to make sure we are in the correct directory //Echo \"Current directory is now : \", ftp_pwd($conn_id), \"\\and\"; //} else { //you want to know if it didn\'t work //Echo \"Couldn\'t change directory\\and\"; //} //upload the file and let the user know what happened If(ftp_put($conn_id,$filename,$_FILES[\'userfiles\'][\'tmp_name\'][$x],FTP_BINARY)){ Echo \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" was sent successfully<br><br>\"; Echo \"File was named: \".$filename.\"<br>\"; }else{ Echo \"There was a problem sending file \".$_FILES[\'userfiles\'][\'name\'][$x].\"<br><br>\";; } } // close the FTP stream Ftp_close($conn_id); } Else echo\"File was not uploaded!<br><br>\"; } } Echo \"<br>\"; }//end for loop } //That\'s all folks! ?> <a href=\"index.php\" target=\"_self\">Back to Upload form!</a> </font> </center> <body> </html>
54
« Dátum: 2012. április 26. - 17:15:03 »
A string buffer méretét emeld fel nagyobbra, ez azért lesz, mivel nem tudja az egészet beleformázni.
Köszi! Már csak az a baj, hogy amikor adok magamnak kaját, és utána lekérem, akkor mutatja, de amikor kilépek a szerverrõl, akkor nem menti le a kaját. Dupla hozzászólás automatikusan összefûzve. ( 2012. április 27. - 14:04:02 )
Megtaláltam a hibát! Ebbõl: sscanf(string, \"p<|>s[24]s[145]s[16]ddddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja]); Kihagytam egy Integer-t(d-t).
55
« Dátum: 2012. április 26. - 15:55:26 »
Bemásolom az régit, amibe még nem raktam bele a Blind-et, Cigit, Kaját, és az újat. Régi: enum PlayerInfo { AdminLevel, Score, Money, Kills, Deaths } Új: enum PlayerInfo { AdminLevel, Score, Money, Kills, Deaths, Blind, Cigi, Kaja } Régi: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case REGISTER_DIALOG: { if(!response) return Kick(playerid); if(!IsValidText(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: A jelszó érvénytelen karaktereket tartalmaz! Írj be egy új jelszót.\"), RegisterDialog(playerid); if(strlen(inputtext) == 0) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Meg kell adnod egy jelszót!\"), RegisterDialog(playerid); { new string[310], HashedPW[129]; WP_Hash(HashedPW, sizeof (HashedPW), inputtext); format(string, sizeof(string), \"INSERT INTO `accounts` (Username, Password, IP, AdminLevel, Score, Money, Kills, Deaths) VALUES (\'%s\', \'%s\', \'%s\', \'0\', \'0\', \'%i\', \'0\', \'0\')\", PlayerName(playerid), HashedPW, PlayerIP(playerid), START_MONEY); mysql_query(string), LoginDialog(playerid); } return true; } case LOGIN_DIALOG: { if(!response) return Kick(playerid); else if(!IsValidText(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: A jelszó érvénytelen karaktereket tartalmaz! Írj be egy új jelszót.\"), LoginDialog(playerid); else if(strlen(inputtext) == 0) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Meg kell adnod egy jelszót!\"), LoginDialog(playerid); { new string[220], HashedPW[145], IP[16]; WP_Hash(HashedPW, sizeof (HashedPW), inputtext); format(string, sizeof(string), \"SELECT * FROM `accounts` WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", PlayerName(playerid), HashedPW); mysql_query(string); mysql_store_result(); if(mysql_num_rows() != 0) { new name[24]; IsPlayerLoggedIn[playerid] = 1; mysql_fetch_row(string, \"|\"); sscanf(string, \"p<|>s[24]s[145]s[16]ddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths]); format(string, sizeof(string), \"UPDATE `accounts` SET `IP` = \'%s\' WHERE Username= \'%s\'\", PlayerIP(playerid), PlayerName(playerid)); mysql_query(string); SetPlayerScore(playerid, PlayerData[playerid][score]); GivePlayerMoney(playerid, PlayerData[playerid][Money]); #if defined ANTI_BAN_EVADE format(string, sizeof(string), \"SELECT `Username` FROM `banned` WHERE `Username` = \'%s\'\", PlayerName(playerid)); mysql_query(string); mysql_store_result(); if(mysql_num_rows()) { format(string, sizeof(string), \"[AUTO BAN] %s has been banned for ban evading\", PlayerName(playerid)); SendClientMessageToAll(COLOR_INFO, string); BanPlayer(playerid, \"Anti-Cheat\", \"Ban Evading\"); } mysql_free_result(); #endif } else SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Helytelen jelszó. Írd be újra!\"), LoginDialog(playerid); mysql_free_result(); } return true; } } return false; } Új: public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case REGISTER_DIALOG: { if(!response) return Kick(playerid); if(!IsValidText(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: A jelszó érvénytelen karaktereket tartalmaz! Írj be egy új jelszót.\"), RegisterDialog(playerid); if(strlen(inputtext) == 0) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Meg kell adnod egy jelszót!\"), RegisterDialog(playerid); { new string[310], HashedPW[129]; WP_Hash(HashedPW, sizeof (HashedPW), inputtext); format(string, sizeof(string), \"INSERT INTO `accounts` (Username, Password, IP, AdminLevel, Score, Money, Kills, Deaths, Blind, Cigi, Kaja) VALUES (\'%s\', \'%s\', \'%s\', \'0\', \'0\', \'%i\', \'0\', \'0\', \'0\', \'0\', \'0\')\", PlayerName(playerid), HashedPW, PlayerIP(playerid), START_MONEY); mysql_query(string), LoginDialog(playerid); } return true; } case LOGIN_DIALOG: { if(!response) return Kick(playerid); else if(!IsValidText(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: A jelszó érvénytelen karaktereket tartalmaz! Írj be egy új jelszót.\"), LoginDialog(playerid); else if(strlen(inputtext) == 0) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Meg kell adnod egy jelszót!\"), LoginDialog(playerid); { new string[220], HashedPW[145], IP[16]; WP_Hash(HashedPW, sizeof (HashedPW), inputtext); format(string, sizeof(string), \"SELECT * FROM `accounts` WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", PlayerName(playerid), HashedPW); mysql_query(string); mysql_store_result(); if(mysql_num_rows() != 0) { new name[24]; IsPlayerLoggedIn[playerid] = 1; mysql_fetch_row(string, \"|\"); sscanf(string, \"p<|>s[24]s[145]s[16]ddddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja]); format(string, sizeof(string), \"UPDATE `accounts` SET `IP` = \'%s\' WHERE Username= \'%s\'\", PlayerIP(playerid), PlayerName(playerid)); mysql_query(string); SetPlayerScore(playerid, PlayerData[playerid][score]); GivePlayerMoney(playerid, PlayerData[playerid][Money]); #if defined ANTI_BAN_EVADE format(string, sizeof(string), \"SELECT `Username` FROM `banned` WHERE `Username` = \'%s\'\", PlayerName(playerid)); mysql_query(string); mysql_store_result(); if(mysql_num_rows()) { format(string, sizeof(string), \"[AUTO BAN] %s has been banned for ban evading\", PlayerName(playerid)); SendClientMessageToAll(COLOR_INFO, string); BanPlayer(playerid, \"Anti-Cheat\", \"Ban Evading\"); } mysql_free_result(); #endif } else SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Helytelen jelszó. Írd be újra!\"), LoginDialog(playerid); mysql_free_result(); } return true; } } return false; } Régi: stock SavePlayerAccount(playerid) { new string[170]; format(string, sizeof(string), \"UPDATE `accounts` SET `AdminLevel` = \'%d\', `Score` = \'%d\', `Money` = \'%d\', `Kills` = \'%d\', `Deaths` = \'%d\' WHERE Username= \'%s\'\", PlayerData[playerid][AdminLevel], GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerName(playerid)); mysql_query(string); } Új: stock SavePlayerAccount(playerid) { new string[170]; format(string, sizeof(string), \"UPDATE `accounts` SET `AdminLevel` = \'%d\', `Score` = \'%d\', `Money` = \'%d\', `Kills` = \'%d\', `Deaths` = \'%d\', `Blind` = \'%d\', `Cigi` = \'%d\', `Kaja` = \'%d\' WHERE Username= \'%s\'\", PlayerData[playerid][AdminLevel], GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja], PlayerName(playerid)); mysql_query(string); } Itt egy adatbázis hozzá: -- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Hoszt: localhost -- Létrehozás ideje: 2012. ápr. 26. 15:54 -- Szerver verzió: 5.5.16 -- PHP verzió: 5.3.8 SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\"; SET time_zone = \"+00:00\"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Adatbázis: `samp` -- -- -------------------------------------------------------- -- -- Tábla szerkezet: `accounts` -- CREATE TABLE IF NOT EXISTS `accounts` ( `Username` varchar(24) NOT NULL, `Password` varchar(128) NOT NULL, `IP` varchar(16) NOT NULL, `AdminLevel` int(1) NOT NULL, `Score` int(6) NOT NULL, `Money` int(9) NOT NULL, `Kills` int(6) NOT NULL, `Deaths` int(6) NOT NULL, `Blind` int(1) NOT NULL, `Cigi` int(2) NOT NULL, `Kaja` int(2) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- A tábla adatainak kiíratása `accounts` -- INSERT INTO `accounts` (`Username`, `Password`, `IP`, `AdminLevel`, `Score`, `Money`, `Kills`, `Deaths`, `Blind`, `Cigi`, `Kaja`) VALUES (\'TheMesziErik\', \'DE1E31E30846F64FEAA23E5D3EA5E05A19592AAA8D928729DAB49F0A72416F0461CA65AD7A57E947666E4C53EBCB1B118C72E914CF0B8A7E7E2D3765098DBA84\', \'127.0.0.1\', 7, 0, 30000, 0, 0, 0, 0, 0); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
56
« Dátum: 2012. április 25. - 20:37:22 »
format(string, sizeof(string), \"INSERT INTO `accounts` (`Username`, `Password`, `IP`, `AdminLevel`, `Score`, `Money`, `Kills`, `Deaths`, `Blind`, `Cigi`, `Kaja`) VALUES (\'%s\', \'%s\', \'%s\', \'0\', \'0\', \'%i\', \'0\', \'0\', \'0\', \'0\', \'0\')\", PlayerName(playerid), HashedPW, PlayerIP(playerid), START_MONEY);
Szerintem nincs értelme kicserélni, mert azóta ilyen, amióta beleítam a Blindet, Cigit és Kaját.
57
« Dátum: 2012. április 25. - 16:46:28 »
Törölve
58
« Dátum: 2012. április 25. - 16:40:50 »
Itt a belépés: if(!response) return Kick(playerid); else if(!IsValidText(inputtext)) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: A jelszó érvénytelen karaktereket tartalmaz! Írj be egy új jelszót.\"), LoginDialog(playerid); else if(strlen(inputtext) == 0) return SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Meg kell adnod egy jelszót!\"), LoginDialog(playerid); { new string[220], HashedPW[145], IP[16]; WP_Hash(HashedPW, sizeof (HashedPW), inputtext); format(string, sizeof(string), \"SELECT * FROM `accounts` WHERE `Username` = \'%s\' AND `Password` = \'%s\'\", PlayerName(playerid), HashedPW); mysql_query(string); mysql_store_result(); if(mysql_num_rows() != 0) { new name[24]; IsPlayerLoggedIn[playerid] = 1; mysql_fetch_row(string, \"|\"); sscanf(string, \"p<|>s[24]s[145]s[16]ddddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja]); format(string, sizeof(string), \"UPDATE `accounts` SET `IP` = \'%s\' WHERE Username= \'%s\'\", PlayerIP(playerid), PlayerName(playerid)); mysql_query(string); SetPlayerScore(playerid, PlayerData[playerid][score]); GivePlayerMoney(playerid, PlayerData[playerid][Money]); #if defined ANTI_BAN_EVADE format(string, sizeof(string), \"SELECT `Username` FROM `banned` WHERE `Username` = \'%s\'\", PlayerName(playerid)); mysql_query(string); mysql_store_result(); if(mysql_num_rows()) { format(string, sizeof(string), \"[AUTO BAN] %s bannolva lett\", PlayerName(playerid)); SendClientMessageToAll(COLOR_INFO, string); BanPlayer(playerid, \"Anti-Cheat\", \"Ban\"); } mysql_free_result(); #endif } else SendClientMessage(playerid, COLOR_ERROR, \"Hiba: Helytelen jelszó. Írd be újra!\"), LoginDialog(playerid); mysql_free_result(); }
59
« Dátum: 2012. április 25. - 16:14:10 »
Még mindig kiírja: sscanf warning: Format specifier does not match parameter count. De viszont ezt kiírja, ha kilépek: [MySQL] Error (0): Failed to exeute query. Unknown column \'Usern\' in \'where clause\'. Ide raktam de a Kaját: [pawn]enum PlayerInfo { AdminLevel, Score, Money, Kills, Deaths, Blind, Cigi, Kaja }[/pawn] Reg: [pawn]format(string, sizeof(string), \"INSERT INTO `accounts` (Username, Password, IP, AdminLevel, Score, Money, Kills, Deaths, Blind, Cigi, Kaja) VALUES (\'%s\', \'%s\', \'%s\', \'0\', \'0\', \'%i\', \'0\', \'0\', \'0\', \'0\', \'0\')\", PlayerName(playerid), HashedPW, PlayerIP(playerid), START_MONEY);[/pawn] Login: [pawn]sscanf(string, \"p<|>s[24]s[145]s[16]ddddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja]);[/pawn] Account mentés: [pawn]format(string, sizeof(string), \"UPDATE `accounts` SET `AdminLevel` = \'%d\', `Score` = \'%d\', `Money` = \'%d\', `Kills` = \'%d\', `Deaths` = \'%d\', `Blind` = \'%d\', `Cigi` = \'%d\', `Kaja` = \'%d\' WHERE Username= \'%s\'\", PlayerData[playerid][AdminLevel], GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja], PlayerName(playerid));[/pawn]
60
« Dátum: 2012. április 25. - 15:45:15 »
Helló! Beleírtam a scriptembe, hogy lementse a kaját. Írtam hozzá egy parancsot is, de warningot ír ki... Itt a hiba: sscanf warning: Format specifier does not match parameter count. Ha kilépek, akkor ilyet is ír: [MySQL] Error (0): Failed to exeute query. Unknown column \'Usern\' in \'where clause\'. Itt a sor, amire szerintem a hibát írja: sscanf(string, \"p<|>s[24]s[145]s[16]ddddddd\", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][blind], PlayerData[playerid][Cigi], PlayerData[playerid][Kaja]); És végül a parancs: CMD:kaja(playerid, params[]) { if(GetPlayerAdminLevel(playerid) <= 2) return SendClientMessage(playerid, COLOR_ERROR, \"Nem használhatod ezt a parancsot!\"); { new player, kaja; if(sscanf(params, \"ud\", player, kaja)) return SendClientMessage(playerid, COLOR_ERROR, \"Használat: /kaja [Név/ID] [Kaja]\"); else if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_ERROR, \"A játékos nincs csatlakozva!\"); { new string[128]; format(string, sizeof(string), \"Sikeresen adtál kaját %s-nak/nek!\", PlayerName(player)); SendClientMessage(playerid, COLOR_INFO, string); PlayerData[player][Kaja] = kaja; } } return true; }
|