16.12.2017, 14:11
Here you have:
You should update to the latest version by the way, those functions are from the R33 one. In case of you update your plugin the callback would look like this:
You might follow the next tutorial in order to update your MySQL plugin: https://sampforum.blast.hk/showthread.php?tid=644891
PHP код:
public OnPlayerDataLoaded(playerid)
{
if(!cache_get_row_count(DBConnect))
{
ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok","");
Kick(playerid);
}
else
{
cache_get_field_content(0, "Pass", PlayerInfo[playerid][pPass], DBConnect, 1024); // Why 1024 characters?!
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID", DBConnect);
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit");
}
return 1;
}
PHP код:
public OnPlayerDataLoaded(playerid)
{
new rows;
if(cache_get_row_count(rows))
{
if(!rows)
{
ShowPlayerDialog(playerid, Dialog_NoAcct, DIALOG_STYLE_MSGBOX, "Not Registerd on UCP, register there first.", "ok","");
Kick(playerid);
}
else
{
cache_get_value_name(0, "Pass", PlayerInfo[playerid][pPass], 1024); // Why 1024 characters?!
cache_get_value_name_int(0, "ID", PlayerInfo[playerid][pID]);
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT, "login", "enter password to login", "login", "quit");
}
}
return 1;
}

