Frage/Problem: Komischer weise kommen bei mir immer diese Warnings und habe keine Ahnung wieso...
Betroffene Quellcode:
[pwn=1 Fehler]
public OnHausesLoad()
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=getFreeHausID();
hInfo[id][h_x]=cache_get_field_content_float(i, "h_x", dbhandle);
hInfo[id][h_y]=cache_get_field_content_float(i, "h_y", dbhandle);
hInfo[id][h_z]=cache_get_field_content_float(i, "h_z", dbhandle);
hInfo[id][ih_x]=cache_get_field_content_float(i, "ih_x", dbhandle);
hInfo[id][ih_y]=cache_get_field_content_float(i, "ih_y", dbhandle);
hInfo[id][ih_z]=cache_get_field_content_float(i, "ih_z", dbhandle);
hInfo[id][h_interior]=cache_get_field_content_int(i, "h_interior", dbhandle);
new tmp_name[MAX_PLAYER_NAME];
cache_get_field_content(i, "besitzer", tmp_name, dbhandle);
strmid(hInfo[id][h_besitzer], tmp_name, 0, sizeof(tmp_name), sizeof(tmp_name));
hInfo[id][h_id]=cache_get_field_content_int(i, "id", dbhandle);
hInfo[id][h_preis]=cache_get_field_content_int(i, "h_preis", dbhandle);
updateHaus(id);
}
return 1;
}
[/pwn]
[pwn= 2Fehler]
updateHaus(id)
{
new string[128];
if(hInfo[id][h_pickup])
{
DestroyPickup(hInfo[id][h_pickup]);
}
if(hInfo[id][h_text])
{
Delete3DTextLabel(hInfo[id][h_text]);
}
if(!strlen(hInfo[id][h_besitzer]))
{
hInfo[id][h_pickup]=CreatePickup(1273, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
format(string,sizeof(string), "Zum Verkauf\nKosten: %i$\n/hauskaufen", hInfo[id][h_preis]);
hInfo[id][h_text]=Create3DTextLabel(string, COLOR_WHITE, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
}
else
{
hInfo[id][h_pickup]=CreatePickup(1239, 1, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], -1);
format(string,sizeof(string), "Besitzer: %s\n/enter", hInfo[id][h_besitzer]);
hInfo[id][h_text]=Create3DTextLabel(string, COLOR_GREEN, hInfo[id][h_x], hInfo[id][h_y], hInfo[id][h_z], 10, 0, 1);
}
return 1;
}
[/pwn]
[pwn= 3Fehler]
saveHaus(id)
{
new query[128];
format(query,
sizeof(query), "UPDATE haus SET besitzer='%s', h_preis='%i' WHERE
id='%i'", hInfo[id][h_besitzer], hInfo[id][h_preis], hInfo[id][h_id]);
mysql_function_query(dbhandle, query, false, "", "");
return 1;
}
[/pwn]
Fehlermeldung:
D:\SAMP-Server\gamemodes\ERP.pwn(162) : warning 219: local variable "id" shadows a variable at a preceding level
D:\SAMP-Server\gamemodes\ERP.pwn(162) : warning 204: symbol is assigned a value that is never used: "id"
D:\SAMP-Server\gamemodes\ERP.pwn(179) : warning 219: local variable "id" shadows a variable at a preceding level
D:\SAMP-Server\gamemodes\ERP.pwn(179) : warning 203: symbol is never used: "id"
D:\SAMP-Server\gamemodes\ERP.pwn(633) : warning 219: local variable "id" shadows a variable at a preceding level
D:\SAMP-Server\gamemodes\ERP.pwn(633) : warning 203: symbol is never used: "id"
Es sind zwar nur Warnings aber dennoch sieht es nicht schön aus.
Danke im Voraus.