Hallo,
da die Frage den Umfang von kleinen Scriptingfragen sprengt, lagere ich das ganze in diesen Thread aus:
So sieht der derzeitige LoadWeapons(playerid); stock aus:
stock LoadWeapons(playerid)
{
new query[256];
format(query,sizeof(query),"SELECT * FROM Waffen WHERE Name='%s'",PlayerName[playerid]);
mysql_query(query);
mysql_store_result();
new wstring[10],data[64];
new waffe, wammo;
if(mysql_num_rows()==0)
{
mysql_free_result();
format(query,sizeof(query),"INSERT INTO Waffen (Name) VALUES ('%s')",PlayerName[playerid]);
mysql_query(query);
return 1;
}
for(new i=1; i<=11; i++)
{
format(wstring,sizeof(wstring),"Waffe%i",i);
mysql_fetch_field_row(data,wstring);
waffe=strval(data);
format(wstring,sizeof(wstring),"Ammo%i",i);
mysql_fetch_field_row(data,wstring);
wammo=strval(data);
GivePlayerWeapon(playerid,waffe,wammo);
format(str,144,"UPDATE Waffen SET Ammo%i='0' WHERE Name='%s'",i,PlayerName[playerid]);
mysql_query(str);
}
mysql_fetch_field_row(data,"Armor");
mysql_free_result();
wammo=strval(data);
SetPlayerArmour(playerid,wammo);
SetPVarInt(playerid,"waffengeladen",1);
return 1;
}
Dieser stock kommt von Jeffry:
Das ist die MySQL-Log: