02.11.2010, 16:34
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <mysql>
#include <zcmd>
main ()
{
print("");
}
enum users()
{
Name[MAX_PLAYER_NAME],
Password[32],
}
new playerinfo[MAX_PLAYERS][users];
#define MYSQL_HOST "localhost"
#define MYSQL_USER "root"
#define MYSQL_PASS ""
#define MYSQL_DB "testphp"
public OnGameModeInit()
{
mysql_init();
mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB);
return 1;
}
public OnGameModeExit()
{
mysql_close();
return 1;
}
command(register, playerid, params[])
{
new string [128];
format(string, sizeof(string), "INSERT INTO Users (Name,Password) VALUES ('%s','%s')", playerinfo[playerid][Name], Password);
mysql_query(string);
}