Válogass
http://wiki.sa-mp.com/wiki/Mysql_tutorial <<--- Ezt ajánlom
http://forum.sa-mp.com/showthread.php?t=161726
http://wiki.sa-mp.com/wiki/MySQL + eszt...
http://sampforum.hu/index.php?topic=10781.0
http://www.andreas-market.com/forums/index.php?topic=737.0
Ezeket ismerem!
1.Elég egyszerû,ezeket írtam le hogy már tudom!
2.Itt csak összehasonlítják a 3 plugint!
3.Ez nem rossz,de csak a plugin függvényee vannak benne!
4.Ez ugyan az mint a 2.,csak magyarul!
5.Nem jön be a link!
De azért köszi!
Edit:
Megpróbáltam megírni,de valamiért nem csatalkozik:
Tábla:
CREATE TABLE `test`.`users` (
`username` VARCHAR( 50 ) NOT NULL ,
`text` VARCHAR( 254 ) NOT NULL
) ENGINE = MYISAM ;
Script:
[pawn]// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <a_mysql>
#include <sscanf2>
#define SQL_HOST \"localhost\"
#define SQL_USER \"root\"
#define SQL_PASS \"\"
#define SQL_DB \"test\"// You\'ll have to change this to the name of the database created in phpMyAdmin
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == \'\\0\') && (dcmd_%1(playerid, \"\"))) || (((%3)[(%2) + 1] == \' \') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" Blank Filterscript by your name here\");
print(\"--------------------------------------\\n\");
/*mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_ping() == 1)
{
mysql_debug(1);
printf(\"[MYSQL]: Connection to `%s` succesful!\", SQL_DB);
}
else
{
printf(\"[MYSQL]: [ERROR]: Connection to `%s` failed!\", SQL_DB);
}*/
return 1;
}
forward ConnectMySQL();
public ConnectMySQL()
{
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_ping() == 1)
{
mysql_debug(1);
printf(\"[MYSQL]: Connection to `%s` succesful!\", SQL_DB);
}
else
{
printf(\"[MYSQL]: [ERROR]: Connection to `%s` failed!\", SQL_DB);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(dbwrite,7,cmdtext);
return 0;
}
dcmd_dbwrite(playerid,params[])
{
new query[512 +1];
new message[256], PlayerName[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(sscanf(params, \"s[256]\",message)) return SendClientMessage(playerid, 0xAA3333AA, \"Használat: /dbwrite [Üzenet] \");
format(query, sizeof(query), \"INSERT INTO `users` (`username`, `text`) VALUES (\'%s\', MD5(\'%s\'))\", PlayerName, message);
mysql_query(query);
mysql_store_result();
return 1;
}[/pawn]
Ezaz mûködik