21.06.2018, 14:16
Code:
if(GetPVarInt(playerid,"Wanted") != pInfo[playerid][pWanted]) { new wlvl[9]; format(wlvl, 9, "%d", pInfo[playerid][pWanted]); PlayerTextDrawSetString(playerid, WLvlTD[playerid], wlvl); SetPVarInt(playerid,"Wanted", pInfo[playerid][pWanted]); new query[128], name[24]; GetPlayerName(playerid, name, 24); format(query, sizeof(query), "UPDATE `playerdata` SET `wanted` = '%d' WHERE `username` = '%s'", pInfo[playerid][pWanted], name); mysql_tquery(dbHandle, query); new starCount = 0, genTextStr[30]; if(pInfo[playerid][pWanted] > 0) { format(genTextStr, sizeof genTextStr, ""); for(new i = 0; i < pInfo[playerid][pWanted]; i++) { starCount++; if(starCount == 7) { break; } else { strcat(genTextStr, "[]", sizeof genTextStr); } } PlayerTextDrawSetString(playerid, wLvlStars[playerid], genTextStr); } if(pInfo[playerid][pWanted] == 0) { PlayerTextDrawSetString(playerid, wLvlStars[playerid], ""); }