Guten Tag, leider speichert mein Mode mein Geld nicht Richtig. Woran könnte das Problem liegen
hier der ausschnitt von OnPlayerDisconnect
Code
savePlayer(playerid)
{//Speichern//
new query[128];
format(query,sizeof(query),"UPDATE accounts SET Money=`%i´");
}
public OnPlayerDisconnect(playerid, reason)
{
if(!IsPlayerNPC(playerid)) {
GetPlayerName(playerid,sendername,sizeof sendername);
new Hour,Minute,Second,Year,Month,Day,dt[16],ti[16],rs[32],query[256];
switch(reason) {
case 0: { format(rs,sizeof rs,"Timeout/Crash"); }
case 1: { format(rs,sizeof rs,"Quit"); }
case 2: { format(rs,sizeof rs,"Kick/Ban"); }
}
gettime(Hour,Minute,Second), getdate(Year,Month,Day);
format(dt,16,"%d.%d.%d",Day,Month,Year), format(ti,16,"%d:%d:%d",Hour,Minute,Second);
format(query, 256, "INSERT INTO `Logouts` (`Name`, `Date`, `Time`, `Reason`, `Sessiontime`) VALUES ('%s', '%s', '%s', '%s', '%d')",sendername,dt,ti,rs,Sessiontime[playerid]);
mysql_query(query);
savePlayer (playerid);
PlayerTextDrawHide(playerid, Moneystring[playerid]);
PlayerTextDrawHide(playerid, Statustext1[playerid]);
PlayerTextDrawHide(playerid, Statustext2[playerid]);
PlayerTextDrawHide(playerid, Tacho1[playerid]);
PlayerTextDrawHide(playerid, JobInfo0[playerid]);
PlayerTextDrawHide(playerid, JobInfo2[playerid]);
if(GetPVarInt(playerid,"Admincar") != -1){ DestroyVehicle(GetPVarInt(playerid,"Admincar")); }
DestroyVehicle(Jobtrailer[playerid]);
Delete3DTextLabel(Adminlabel[playerid]);
DestroyPlayerObject(playerid, ErzObj[0][playerid]);
DestroyPlayerObject(playerid, ErzObj[1][playerid]);
KillTimer(Mintimer[playerid]);
KillTimer(tutTimer[playerid]);
KillTimer(MariTimer[playerid]);
KillTimer(KokaTimer[playerid]);
currPL--;
for(new i;i<MaxVehikel;i++) {
if(!pCarInfo[i][cCreated])continue;
if((!strcmp(pCarInfo[i][cOwner],sendername,true))) {
SavePrivateVehicle(pCarInfo[i][cVeh]);
PVC[pCarInfo[i][cVeh]] = 0;
DestroyVehicle(pCarInfo[i][cVeh]);
KillTimer(pCarInfo[i][cSaveTimer]);
pCarInfo[i][cCreated] = false;
}
}
if(GetPVarInt(playerid,"SupportID") != -1) {
new Partner = GetPVarInt(playerid,"SupportID");
GetPlayerName(Partner,usedname,sizeof usedname);
SetPVarInt(Partner,"inSupport",0);
SetPVarInt(Partner,"SupportID",-1);
SetPVarInt(Partner,"TicketGeschrieben",0);
SetPVarInt(playerid,"inSupport",0);
SetPVarInt(playerid,"SupportID",-1);
format(query, 256, "UPDATE `Tickets` SET `Bearbeitung` = '1', `Status` = '3' WHERE `Besitzer` = '%s'",usedname);
mysql_query(query);
SendClientMessage(Partner,COLOR_YELLOW,"Dein Supportpartner hat das Spiel verlassen. Der Supportchat wurde geschlossen.");
}
if(GetPVarInt(playerid,"inCall") == 1) {
SetPVarInt(GetPVarInt(playerid,"CallID"),"inCall",0);
SetPVarInt(GetPVarInt(playerid,"CallID"),"CallID",-1);
SetPVarInt(playerid,"inCall",0);
SetPVarInt(playerid,"CallID",-1);
SetPVarInt(playerid,"Called",0);
SendClientMessage(GetPVarInt(playerid,"CallID"),COLOR_GREY,"Die Telefonverbindung wurde unterbrochen..");
}
//if(MariV[playerid] != 0){ pInfo[playerid][pUnreadyMari] += MariV[playerid]; }
//if(KokaV[playerid] != 0){ pInfo[playerid][pUnreadyKoka] += KokaV[playerid]; }
pInfo[playerid][pUnreadyMari] += MariV[playerid];
pInfo[playerid][pUnreadyKoka] += KokaV[playerid];
SkinSel[playerid] = 0;
amsg[playerid] = 0;
SupDuty[playerid] = 0;
TruckerjobCP[playerid] = 0;
ErzjobCP[playerid] = -1;
inJob[playerid] = 0;
Durchlauf[playerid] = 0;
Pingwarn[playerid] = 0;
Sessiontime[playerid] = 0;
Beintreffer[playerid] = 0;
Armtreffer[playerid] = 0;
UsedDrugs[playerid] = 0;
gSpectateID[playerid] = -1;
Findcar[playerid] = 0;
tutTime[playerid] = 0;
ECabholen[playerid] = 0;
MariV[playerid] = 0;
KokaV[playerid] = 0;
GM[playerid] = 0;
DeletePVar(playerid,"Eingeloggt");
DeletePVar(playerid,"Acc");
DeletePVar(playerid,"savepos");
DeletePVar(playerid,"backport");
DeletePVar(playerid,"inSupport");
DeletePVar(playerid,"SupportID");
DeletePVar(playerid,"Lieferkosten");
if(GetPVarInt(playerid,"TicketGeschrieben") == 1) {
format(query, sizeof query,"UPDATE `Tickets` SET `Status` = '3' WHERE `Besitzer` = '%s'",sendername);
mysql_query(query);
DeletePVar(playerid,"TicketGeschrieben");
} else {
DeletePVar(playerid,"TicketGeschrieben");
}
SetPVarInt(playerid,"ImportVeh",-1);
if(GetPVarInt(playerid,"Eingeloggt") == 1) { SavePlayer(playerid); }
}
return 1;
}
Alles anzeigen