Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnGameModeInit()
- {
- //Connecting to the MySQL database, default connection handle.
- SQL::Connect(mysql_host, mysql_user, mysql_pass, mysql_db);
- //Checking if the table 'players' exists
- //Checking if the table 'players' exists
- if(!SQL::ExistsTable(SQL_PLAYERS_TABLE))
- {
- //If not, then create a table called 'players'.
- new handle = SQL::Open(SQL::CREATE, SQL_PLAYERS_TABLE); //Opening a valid handle to create a table called 'players'
- SQL::AddTableColumn(handle, "p_id", SQL_TYPE_INT, 11, true); //Setting auto-increment for this field.
- SQL::AddTableColumn(handle, "p_name", SQL_TYPE_VCHAR, 24);
- SQL::AddTableColumn(handle, "p_password", SQL_TYPE_VCHAR, 64);
- SQL::AddTableColumn(handle, "p_score", SQL_TYPE_INT);
- SQL::AddTableColumn(handle, "p_posx", SQL_TYPE_FLOAT);
- SQL::AddTableColumn(handle, "p_posy", SQL_TYPE_FLOAT);
- SQL::AddTableColumn(handle, "p_posz", SQL_TYPE_FLOAT);
- SQL::Close(handle);//Closing the previous opened handle.
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement