ocmd:chouse(playerid, params[])
{
new price, interior, typ;
if(!isPlayerAnAdmin(playerid,4))return SCM(playerid, ERROR_FARBE, ERROR_ADMIN);
if(sscanf(params,"ddd",price,interior,typ))return SCM(playerid, -1, "Tippe: /chouse [price] [interior] [typ]");
for(new i; i<MAX_HOUSE; i++)
{
if(hInfo[i][house_description][0] != EOS) continue;
new Float:x, Float:y, Float:z, string[64], string2[MAX_PLAYER_NAME], query[512];
GetPlayerPos(playerid, x, y, z);
format(string,sizeof(string), "Zum verkauf");
format(string2,sizeof(string2), "Niemand");
hInfo[i][house_id] = i;
hInfo[i][house_owner] = string2;
hInfo[i][house_description] = string;
hInfo[i][house_price] = price;
hInfo[i][house_interior] = interior;
hInfo[i][house_typ] = typ;
hInfo[i][house_x] = x;
hInfo[i][house_y] = y;
hInfo[i][house_z] = z;
format(query, sizeof(query), "INSERT INTO houses (id, owner, description, price, interior, posx, posy, posz, typ) VALUES ('%d', '%s', '%s', '%d', '%d', '%f', '%f', '%f', '%d')",
i, hInfo[i][house_owner], hInfo[i][house_description], hInfo[i][house_price], hInfo[i][house_interior], hInfo[i][house_x], hInfo[i][house_y], hInfo[i][house_z], hInfo[i][house_typ]);
mysql_tquery(handle, query);
format(string,sizeof(string), "Du hast erfolgreich das Haus(ID: %d) erstellt.",i);
printf("%s", query);
SCM(playerid, BABYBLAU, string);
break;
}
return 1;
}
Alles anzeigen