Hallo liebe Leute meine Wanteds werden derzeit nicht in der Datenbank gespeichert. Bis vor kurzer Zeit gings noch xD. Nun habe ich aber kein Plan mehr.
Hier der Wanted geber Befehl
ocmd:su(playerid, params[])
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
new pID, Wanteds, reason[128], string[128];
if(sscanf(params, "uds",pID,Wanteds,reason)) return SendClientMessage(playerid,COLOR_RED,"Benutzung: /su [ID] [Anzahl] [Grund] ");
{
if(!IsPlayerConnected(pID))return SendClientMessage(playerid, COLOR_RED, "Dieser Spieler ist offline");
new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(pID, name2, sizeof(name2));
format(string, sizeof(string), "Info: Officer %s hat dir %d Wanted Punkte gegeben( Grund: %s )", name, Wanteds, reason);
SendClientMessage(pID, COLOR_RED, string);
format(string, sizeof(string), "Info: Du hast %s %d Wanted Punkte gegeben.", name2, Wanteds);
SendClientMessage(playerid, COLOR_RED, string);
PlayerWantedBarUpdate(pID);
PlayerInfo[pID][pWanted] += Wanteds;
new string2[128];
format(string2, sizeof(string2), "%s hat %s %s Wanteds gegeben. Grund: %s ", name,name2,Wanteds,reason);
SaveToLog("WantedLog", string2);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Du bist kein Polizist.");
return 1;
}
}
Spieler speichern
stock SaveUserStats(playerid)
{
//Wenn der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!PlayerInfo[playerid][pLoggedIn]) return 1;
//Ansonsten speichere sie
new query[256];
mysql_format(handle, query, sizeof(query), "UPDATE users SET Wanted = '%s',tban = '%d',Jobk = '%d',Leader = '%d',spawnchange = '%d', level = '%d', money = '%d',JobMoney = '%d',Job = '%d', Konto = '%d', kills = '%d', deaths = '%d', gesamtrp = '%d', pRP = '%d', paytime = '%d' WHERE id = '%d'",
PlayerInfo[playerid][pWanted],PlayerInfo[playerid][TBanned],PlayerInfo[playerid][pJobk],PlayerInfo[playerid][pLeader],PlayerInfo[playerid][spawnchange],PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pMoney], PlayerInfo[playerid][pJobMoney],PlayerInfo[playerid][pJob],PlayerInfo[playerid][pKonto], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pRPg],PlayerInfo[playerid][pRespektpunkte],PlayerInfo[playerid][pPaytime], PlayerInfo[playerid][p_id]);
SaveUserStats2(playerid);
mysql_pquery(handle, query);
return 1;
}
Spieler laden
PlayerInfo[playerid][pWanted] = cache_get_field_content_int(0,"Wanted",handle);