Enumerators Variables
#1

Hi everyone. I want to ask if somebody found any solution how to use enum variables to create table in mysql.
If the enum has pLevel, pMoney etc.. just create table with theese variables. Thanks in advance.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=462884
Reply
#3

Sorry my mistake for not giving enough details. The problem is that i need to pull all the variables automaticly then create table. I need it to be automated. Not me inserting variables one at a time.
Reply
#4

Quote:
Originally Posted by vikiopp
Посмотреть сообщение
Hi everyone. I want to ask if somebody found any solution how to use enum variables to create table in mysql.
If the enum has pLevel, pMoney etc.. just create table with theese variables. Thanks in advance.
Before You make a post make sure you search on the forum, because most of the questions are already here.
Reply
#5

Quote:
Originally Posted by vikiopp
Посмотреть сообщение
Sorry my mistake for not giving enough details. The problem is that i need to pull all the variables automaticly then create table. I need it to be automated. Not me inserting variables one at a time.
So you're saying that you want the script to create all the variables and create a new table when the server starts, right?
Reply
#6

Quote:
Originally Posted by Nizarh
Посмотреть сообщение
Before You make a post make sure you search on the forum, because most of the questions are already here.
I searched and not found the answer
Reply
#7

Quote:
Originally Posted by willbedie
Посмотреть сообщение
So you're saying that you want the script to create all the variables and create a new table when the server starts, right?
Well i need to pull the variables from the enum and with them create table.
Reply
#8

Quote:
Originally Posted by vikiopp
Посмотреть сообщение
Well i need to pull the variables from the enum and with them create table.
PHP код:
public OnGameModeInit()
{
    
SQL::Connect(mysql_hostmysql_usermysql_passmysql_db);
    if(!
SQL::ExistsTable(SQL_PLAYERS_TABLE))
    {
        new 
handle SQL::Open(SQL::CREATESQL_PLAYERS_TABLE); 
        
SQL::AddTableColumn(handle"pKills"SQL_TYPE_INT);
        
SQL::AddTableColumn(handle"pDeaths"SQL_TYPE_INT);
        
SQL::AddTableColumn(handle"pMuted"SQL_TYPE_INT);
        
SQL::AddTableColumn(handle"pSkin"SQL_TYPE_INT);
        
SQL::Close(handle);
    }

That's what i use to create a new table when i start my gamemode, i am using an include called easymysql though. I just posted this as it might be helpful
Reply
#9

Let me make this easier. Is there any way to print names of the variables from the enum. For creating the table i will work something out.
Reply
#10

anyone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)