[MySQL]Orm system help
#1

Hi guys, I decided to learn how to use the orm system which this MySQL plugin has. I read the tutorial provided by AndreT and still couldn't get how to save player data.

I took the following code from the example scripts (by Pain123/maddinat0r), you can find them on the plugin page:
pawn Код:
enum E_PLAYERS
{
    ORM:ORM_ID,
   
    ID,
    Name[MAX_PLAYER_NAME],
    Password[129],
    Money
};
new Player[MAX_PLAYERS][E_PLAYERS];

public OnPlayerDisconnect(playerid,reason)
{
    MysqlRaceCheck[playerid]++;
    if(Player[playerid][IsLoggedIn] && Player[playerid][ID] > 0)
        orm_save(Player[playerid][ORM_ID]); //if Player[playerid][ID] has a valid value, orm_save sends an UPDATE query, else an INSERT query
    return 1;
}
So it doesn't save the money, either score or whatever else. I was told that the plugin creates the queries for me and I just need to use orm_update and orm_save like this:
pawn Код:
orm_update(playerid, pInfo[playerid][ID];
I still find using cache much easier than orm. If someone can explain me how to save the player data I will be really thankful.
Reply


Messages In This Thread
[MySQL]Orm system help - by x96664 - 09.01.2014, 16:10
Re: [MySQL]Orm system help - by sammp - 09.01.2014, 16:16
Re: [MySQL]Orm system help - by x96664 - 09.01.2014, 16:20
Re: [MySQL]Orm system help - by sammp - 09.01.2014, 17:04
Re: [MySQL]Orm system help - by x96664 - 09.01.2014, 17:33
Re: [MySQL]Orm system help - by sammp - 09.01.2014, 17:38
Re: [MySQL]Orm system help - by x96664 - 10.01.2014, 18:37
Re: [MySQL]Orm system help - by maddinat0r - 10.01.2014, 18:43
Re: [MySQL]Orm system help - by x96664 - 11.01.2014, 19:31

Forum Jump:


Users browsing this thread: 1 Guest(s)