Hallo liebe com,
habe ein Problem und zwar hab ich mir nen Befehl erstellt um die Mieter des Hauses in einer Liste anzeigen zu lassen:
Code
ocmd:showtenands(playerid,params[])
{
new statee=0,ix;
for(new i=0; i<sizeof hInfo; i++)
{
if(statee==1)continue;
if(IsPlayerInRangeOfPoint(playerid,2.0,hInfo[i][h_x],hInfo[i][h_y],hInfo[i][h_z]))
{
statee=1;
ix=i;
}
}
if(statee==0)return SendClientMessage(playerid,COLOR_RED,"Fehler: Du bist nicht nahe genug an einem Haus");
statee=0;
if(hInfo[ix][h_besitzer]==sInfo[playerid][p_id])
{
statee=1;
}
if(statee==0)return SendClientMessage(playerid,COLOR_RED,"Fehler: Du bist nicht der Besitzer dieses Hauses");
new query[164];
if(hInfo[ix][h_mieter_a]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_a]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,1);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"Mieter A: Frei");
}
if(hInfo[ix][h_mieter_b]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_b]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,2);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter B: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_c]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_c]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,3);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter C: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_d]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_d]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,4);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter D: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_e]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_e]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,5);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter E: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_f]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_f]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,6);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter F: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_g]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_g]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,7);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter G: Frei",ShowTenands[playerid]);
}
if(hInfo[ix][h_mieter_h]!=INVALID_OWNER)
{
format(query,sizeof query,"SELECT * FROM user WHERE id='%i'",hInfo[ix][h_mieter_h]);
mysql_function_query(dbhandle,query,true,"OnUserLoadTenands","ii",playerid,8);
}
else
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter H: Frei",ShowTenands[playerid]);
}
ShowPlayerDialog(playerid,DIALOG_SHOW_TENANDS,DIALOG_STYLE_MSGBOX,"Mieter deines Hauses:",ShowTenands[playerid],"Okay","");
return 1;
}
Alles anzeigen
und das Public zu der mysql_function_query:
Code
public OnUserLoadTenands(playerid,slot)
{
new name[MAX_PLAYER_NAME];
cache_get_field_content(0,"username",name,dbhandle,sizeof name);
if(slot==1)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"Mieter A: %s",name);
}
else
if(slot==2)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter B: %s",ShowTenands[playerid],name);
}
else
if(slot==3)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter C: %s",ShowTenands[playerid],name);
}
else
if(slot==4)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter D: %s",ShowTenands[playerid],name);
}
else
if(slot==5)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter E: %s",ShowTenands[playerid],name);
}
else
if(slot==6)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter F: %s",ShowTenands[playerid],name);
}
else
if(slot==7)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter G: %s",ShowTenands[playerid],name);
}
else
if(slot==8)
{
format(ShowTenands[playerid],sizeof ShowTenands[playerid],"%s\nMieter H: %s",ShowTenands[playerid],name);
}
return 1;
}
Alles anzeigen
angezeigt bekomme ich folgenden fehler:
Code
C:\Users\Riagine\Desktop\GTA\GTA Server\gamemodes\invisible.pwn(324) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Riagine\Desktop\GTA\GTA Server\gamemodes\invisible.pwn(324) : warning 215: expression has no effect
C:\Users\Riagine\Desktop\GTA\GTA Server\gamemodes\invisible.pwn(324) : error 001: expected token: ";", but found "]"
C:\Users\Riagine\Desktop\GTA\GTA Server\gamemodes\invisible.pwn(324) : error 029: invalid expression, assumed zero
C:\Users\Riagine\Desktop\GTA\GTA Server\gamemodes\invisible.pwn(324) : fatal error 107: too many error messages on one line
die Zeile 324 ist in dem fall bei dem Public die format funktion in Zeile 7. allerdings komme ich nicht drauf wo der Fehler liegen soll.
Vielen Dank schonmal für eure Hilfe