public OnPlayerConnect(playerid){//Login/Registernew name[MAX_PLAYER_NAME],query[128];GetPlayerName(playerid,name,sizeof(name));format(query,sizeof(query),\"SELECT id FROM user WHERE username=\'%s\'\",name);mysql_function_query(dbhandle,query,true,\"OnUserCheck\",\"i\",playerid);return 1;}
savePlayer(playerid){if(sInfo[playerid][loggedin]==0) return 1;//Pénz,szint mentésnew query[1024];format(query,sizeof(query),\"UPDATE user SET level=\'%i\',money=\'%i\' WHERE id=\'%i\'\",sInfo[playerid][level],sInfo[playerid][penz],sInfo[playerid][id]);mysql_function_query(dbhandle,query,false,\"\",\"\");return 1;}
public OnPasswordResponse(playerid) //Bejelentkezés{new num_fields,num_rows;cache_get_data(num_rows,num_fields,dbhandle);if(num_rows==1){ //Jó jelszó sInfo[playerid][loggedin] = 1; sInfo[playerid][level] = cache_get_row(4,0,\"level\",dbhandle); SetPlayerScore(playerid,sInfo[playerid][level]); sInfo[playerid][id] = cache_get_row(1,0,\"id\",dbhandle);sInfo[playerid][penz] = cache_get_row(5,0,\"money\",dbhandle);SendClientMessage(playerid,COLOR_GREEN,\"Sikeresen Bejelentkeztél!\");}else{ //Rossz jelszó SendClientMessage(playerid,COLOR_RED,\"Rossz jelszó!\"); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,\"Bejelentkezés\",\"Kérlek írd be a jelszót!\",\"Rendben\",\"Mégse\");}return 1;}