Not registering - Callback Parameter
#2

I think the main issue is that you give no arguments, yet give specifiers.
Код:
mysql_tquery(mysql, query, "OnAccountRegister", "d");
You're missing "playerid" at the end. Additionally, instead of placing code beneath this, you should place it into OnAccountRegister. This would become:
Код:
public OnAccountRegister(playerid)
{ 
      if(cache_insert_id() == -1)
            return 1; // row wasn't created, error handling goes here

      PlayerInfo[playerid][Logged] = 1;
      SendClientMessage(playerid, -1, "{FFFF00}[ACCOUNT]: {FFFFFF}Account succesfuly registered.");
      PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

      // whatever else
      return true;
}
This logically makes more sense and also allows you to properly handle errors, such as the row not being created. You could also further optimize this by making Logged a boolean, instead of an integer (assuming it's only using 0 and 1 as values).
Reply


Messages In This Thread
Not registering - Callback Parameter - by Stones - 14.05.2017, 13:23
Re: Not registering - Callback Parameter - by Abagail - 14.05.2017, 13:40
Re: Not registering - Callback Parameter - by Stones - 14.05.2017, 14:02
Re: Not registering - Callback Parameter - by Stones - 14.05.2017, 18:22
Re: Not registering - Callback Parameter - by Stones - 15.05.2017, 12:35
Re: Not registering - Callback Parameter - by Stones - 15.05.2017, 13:25

Forum Jump:


Users browsing this thread: 1 Guest(s)