Hey Leute
Brauche Hilfe Bedanke mich schonmal
AwardAchievement(playerid, achievementid)
{
new query[64], z[24], titel[24], inhalt[64], geld, punkte, icon[64];
format(query, sizeof(query), "SELECT * FROM erfolge WHERE ID = %i", achievementid);
mysql_query(query);
mysql_store_result();
mysql_fetch_field("titel", titel);
mysql_fetch_field("inhalt", inhalt);
mysql_fetch_field("icon", icon);
mysql_fetch_field("geld", z);
geld = strval(z);
mysql_fetch_field("punkte", z);
punkte = strval(z);
mysql_free_result();
GivePlayerMoney(playerid, geld);
PlayerTextDrawSetString(playerid, Titel[playerid], titel);
PlayerTextDrawSetString(playerid, Info[playerid], inhalt);
PlayerTextDrawSetString(playerid, Icon[playerid], icon);
new belohnung[48];
if (geld > 0)
{
format(belohnung, sizeof(belohnung), "~g~+ $%i", geld);
if(punkte > 0)
{
new punktebelohnung[24];
format(punktebelohnung, sizeof(punktebelohnung), " ~w~... ~g~+ %i Punkte", punkte);
strcat(belohnung, punktebelohnung);
}
}
else if (punkte > 0)
{
format(belohnung, sizeof(belohnung), "~g~+ %i Punkte", punkte);
}
else format(belohnung, sizeof(belohnung), " ");
PlayerTextDrawSetString(playerid, Belohnung[playerid], belohnung);
PlayerTextDrawShow(playerid, Box[playerid]);
PlayerTextDrawShow(playerid, MiniIcon[playerid]);
PlayerTextDrawShow(playerid, MiniInfo[playerid]);
PlayerTextDrawShow(playerid, Titel[playerid]);
PlayerTextDrawShow(playerid, Info[playerid]);
PlayerTextDrawShow(playerid, Belohnung[playerid]);
PlayerTextDrawShow(playerid, Icon[playerid]);
SetTimerEx("AchievementEnd", 5000, false, "i", playerid);
}