Hallo,
Ich habe ein Problem mit meiner Saveplayer function... am anfang der function deklariere ich den integer plid mit der sInfo[pID][id] (in diesem Fall 22)
Nun führe ich die ganzen SQL abfrage zum speichern durch.
/e sorry für den schlecht formatierten pawn code aber irgendwie sind die zeilen zu lang
SavePlayer(pID)
{
if(sInfo[pID][eingeloggt]==0)return 1;
new plid = sInfo[pID][id];
format(query,sizeof(query),"UPDATE user SET level='%i',alevel='%i',skin='%i',fraktion='%i',money='%i',bank='%i',kanister='%i' WHERE id='%i'",sInfo[pID][level], sInfo[pID][alevel],sInfo[pID][skin], sInfo[pID][fraktion], sInfo[pID][money], sInfo[pID][bank],sInfo[pID][kanister],plid);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE user SET rentroom='%i',spawnchange='%i',paydaytime='%i',telefonbuch='%i',number='%i',job='%i',rank='%i' WHERE id='%i'" , sInfo[pID][rentroom], sInfo[pID][spawnchange],sInfo[pID][paydaytime],sInfo[pID][telefonbuch],sInfo[pID][number],sInfo[pID][job],sInfo[pID][rank],plid);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE user SET lotto='%i',drogen='%i',fische='%i',mats='%i',wanteds='%i',jailtime='%i',lastjail='%i' WHERE id='%i'",sInfo[pID][lottozahl],sInfo[pID][savedrogen],sInfo[pID][savefische],sInfo[pID][savemats],sInfo[pID][wanteds],sInfo[pID][jailtime],sInfo[pID][lastjail],plid);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE user SET spielstunden='%i',respekt='%i',uppoints='%i',spawnhealth='%i',donator='%i',ehe='%s',eventitems='%i' WHERE id='%i'",sInfo[pID][spielstunden],sInfo[pID][respekt],sInfo[pID][uppoints],sInfo[pID][spawnhealth],sInfo[pID][donator],sInfo[pID][ehe],sInfo[pID][eventitems],plid);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE user SET warns='%i', warntime='%i', donatortime='%i',donator='%i',invitesperre='%i',orgid='%i', orgrank='%i' WHERE id='%i'",sInfo[pID][warns],sInfo[pID][warntime],sInfo[pID][donatortime],sInfo[pID][donator],sInfo[pID][invitesperre],sInfo[pID][orgid],sInfo[pID][orgrank],plid);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE user SET savecodes='%i',kkasse='%i',tode='%i',kills='%i',verbrechenges='%i',knasttime='%i',sdmkills='%i' WHERE id='%i'",sInfo[pID][savecodes],sInfo[pID][kkasse],sInfo[pID][tode],sInfo[pID][kills],sInfo[pID][verbrechenges],sInfo[pID][knasttime],sInfo[pID][sdmkills],plid);
mysql_function_query(dbhandle,query,false,"","");
printf("%s",query);
format(query,sizeof(query),"UPDATE user SET jobsperre='%i',dlicense='%i',blicense='%i',tlicense='%i',flicense='%i',slicense='%i',alicense='%i' WHERE id='%i'",sInfo[pID][jobsperre],sInfo[pID][dlicense],sInfo[pID][blicense],sInfo[pID][tlicense],sInfo[pID][flicense],sInfo[pID][slicense],sInfo[pID][alicense],plid);
mysql_function_query(dbhandle,query,false,"","");
printf("%s",query);
format(query,sizeof(query),"UPDATE user SET wlicense='%i',blicensetimer='%i',tlicensetimer='%i',flicensetimer='%i',dlicensetimer='%i' WHERE id='%i'",sInfo[pID][wlicense],sInfo[pID][dlicensetimer],sInfo[pID][blicensetimer],sInfo[pID][tlicensetimer],sInfo[pID][flicensetimer],sInfo[pID][dlicensetimer],plid);
mysql_function_query(dbhandle,query,false,"","");
printf("%s",query);
format(query,sizeof(query),"UPDATE user SET slicensetimer='%i',alicensetimer='%i',wlicensetimer='%i',skill1='%i',skill2='%i',skill3='%i' WHERE id='%i'",sInfo[pID][slicensetimer],sInfo[pID][alicensetimer],sInfo[pID][wlicensetimer],sInfo[pID][skill1],sInfo[pID][skill2],plid);
mysql_function_query(dbhandle,query,false,"","");
printf("%s",query);
return 1;
}
Alles anzeigen
die prints stehen da damit ich die sql abfragen sehen kann weil sich plid plötzlich auf 0 setzt und dann ganz verschwindet? hat jemand ne ahnung?
Zitat von IchUPDATE user SET savecodes='0',kkasse='0',tode='6',kills='15',verbrechenges='5',knasttime='0',sdmkills='1' WHERE id='22'
UPDATE user SET jobsperre='0',dlicense='1',blicense='1',tlicense='1',flicense='1',slicense='1',alicense='1' WHERE id='22'
UPDATE user SET wlicense='1',blicensetimer='0',tlicensetimer='0',flicensetimer='0',dlicensetimer='0' WHERE id='0'
UPDATE user SET slicensetimer='0',alicensetimer='0',wlicensetimer='0',skill1='1',skill2='1',skill3='22' WHERE id=''