Amigo, й o R6-2.
tem uma forma melhor? a forma que eu tф usando nгo dб certo.
minha
OnPlayerRequestClass:
pawn Код:
public OnPlayerRequestClass(playerid)
{
new query[300], pname[24]/*, SkinBD[2]*/;
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "SELECT * FROM contas WHERE nick = '%s'", pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
PegaBD(playerid);
}
mysql_free_result();
return 1;
}
a funзгo
PegaBD(playerid):
pawn Код:
public PegaBD(playerid)
{
new temp[30];
mysql_fetch_field_row(temp, "idade"); format(PlayerInfo[playerid][pIdade], 3, temp);
mysql_fetch_field_row(temp, "sexo"); format(PlayerInfo[playerid][pSexo], 3, temp);
mysql_fetch_field_row(temp, "pais"); format(PlayerInfo[playerid][pPais], 3, temp);
mysql_fetch_field_row(temp, "idioma"); format(PlayerInfo[playerid][pIdioma], 3, temp);
mysql_fetch_field_row(temp, "skin"); format(PlayerInfo[playerid][pSkin], 3, temp);
mysql_fetch_field_row(temp, "skin_sec"); format(PlayerInfo[playerid][pSkinSec], 3, temp);
mysql_fetch_field_row(temp, "dinheiro"); format(PlayerInfo[playerid][pDinheiro], 3, temp); GivePlayerMoney(playerid, PlayerInfo[playerid][pDinheiro]);
mysql_fetch_field_row(temp, "celular"); format(PlayerInfo[playerid][pCelular], 3, temp);
mysql_fetch_field_row(temp, "level"); format(PlayerInfo[playerid][pLevel], 3, temp);
mysql_fetch_field_row(temp, "horas_jogadas"); format(PlayerInfo[playerid][pHorasJogadas], 11, temp);
mysql_fetch_field_row(temp, "admin"); format(PlayerInfo[playerid][pAdmin], 1, temp);
mysql_fetch_field_row(temp, "spawn"); format(PlayerInfo[playerid][pSpawn], 3, temp);
return 1;
}