Guten Tag,
ich habe ein problem bezüglich meines Abspeicherungs System was sich auf das Plugin von GStylez:R34 bezieht.
Es wird entweder unvollständig oder garnicht gespeichert:
Hier die Codes:
savePlayer(playerid)
{
//Speichern level,tode,kills,money
if(pInfo[playerid][peingeloggt]== 0)return 1;
new query[256];
new query2[512];
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',kills='%i',tode='%i',alevel='%i',fmember='%i',fleader='%i',frang='%i',bank='%i',warns='%i' WHERE id='%i'",pInfo[playerid][plevel],GetPlayerMoney(playerid),pInfo[playerid][pkills],pInfo[playerid][ptode],pInfo[playerid][padmin],pInfo[playerid][pfmember],pInfo[playerid][pfleader],pInfo[playerid][pfrang],pInfo[playerid][pbank],pInfo[playerid][pwarns],pInfo[playerid][db_id]);
format(query2,sizeof(query2),"UPDATE user SET driverlicense='%i',driverpoints='%i',bikelicense='%i',bikepoints='%i',trucklicense='%i',boatlicense='%i',flylicense='%i',gunlicense='%i',fishinglicense='%i' WHERE id='%i'",pInfo[playerid][pcarlic],pInfo[playerid][pcarpoints],pInfo[playerid][pbikelic],pInfo[playerid][pbikepoints],pInfo[playerid][ptrucklic],pInfo[playerid][pflylic],pInfo[playerid][pgunlic],pInfo[playerid][pfishlic],pInfo[playerid][db_id]);
mysql_tquery(dbhandle,query,"","");
mysql_tquery(dbhandle,query2,"","");
return 1;
}
enum playerInfo{
plevel,
pname,
pmoney,
padmin,
paduty,
peingeloggt,
pkills,
ptode,
pspawn,
pskin,
pcarlic,
pcarpoints,
pbikelic,
pbikepoints,
ptrucklic,
pboatlic,
pflylic,
pgunlic,
pfishlic,
pfmember,
pfleader,
pfrang,
pbanned,
pwarns,
pbank,
db_id,
pJob
}
ocmd:lic(playerid,params[])
{
new string[128],pID,licname[128],sendername[MAX_PLAYER_NAME],name[MAX_PLAYER_NAME];
GetPlayerName(pID,name,sizeof(name));
GetPlayerName(playerid,sendername,sizeof(sendername));
if(!isAdmin(playerid,2))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"Du bist nicht berechtigt!");
}
if(sscanf(params,"us",pID,licname))
{
SendClientMessage(playerid,COLOR_GREY,"Benutze: /lic [playerid] [licname]");
SendClientMessage(playerid,COLOR_GREY,"Auto, Flugzeug, Bike, Segeln, Waffe, Angeln, LKW, Alle");
return 1;
}
if(strcmp(licname,"Auto",true) == 0)
{
pInfo[pID][pcarlic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Führerschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Flugzeug",true) == 0)
{
pInfo[pID][pflylic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Flugschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Bike",true) == 0)
{
pInfo[pID][pbikelic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Motorradschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Segeln",true) == 0)
{
pInfo[pID][pboatlic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Segelschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Waffe",true) == 0)
{
pInfo[pID][pgunlic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Waffenschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Angeln",true) == 0)
{
pInfo[pID][pfishlic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den Angelschein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"LKW",true) == 0)
{
pInfo[pID][ptrucklic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s den Schein: %s gegeben!",AdminRang(playerid),sendername,name,licname);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst den LKWSchein.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
else if(strcmp(licname,"Alle",true) == 0)
{
pInfo[pID][pcarlic] = 1;
pInfo[pID][pflylic] = 1;
pInfo[pID][pbikelic] = 1;
pInfo[pID][pboatlic] = 1;
pInfo[pID][pgunlic] = 1;
pInfo[pID][pfishlic] = 1;
pInfo[pID][ptrucklic] = 1;
format(string,sizeof(string),"Admin Info: %s %s hat %s alle Scheine gegeben!",AdminRang(playerid),sendername,name);
SendClientMessage(pID,COLOR_LIGHTBLUE,"Du erhälst alle Scheine.");
ABroadCast(COLOR_LILA,string,1);
return 1;
}
savePlayer(pID);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
savePlayer(playerid);
SetTimerEx("resetplayerdata", 1000,false,"i",playerid);
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x]==0)continue;
if(cInfo[i][besitzer]!=pInfo[playerid][db_id])continue;
new query[128];
format(query,sizeof(query),"UPDATE autos SET locked='%i' WHERE id='%i'",cInfo[i][c_locked],cInfo[i][db_id]);
mysql_tquery(dbhandle,query,"","");
DestroyVehicle(cInfo[i][id_x]);
cInfo[i][id_x]=0;
}
savePlayer(playerid);
SetTimerEx("resetplayerdata", 1000,false,"i",playerid);
return 1;
}
Vielen dank im voraus