08.04.2013, 20:20
Here's a version without the loop (if the loop is the problem, but probably not)
You'll have to translate some of that stuff
pawn Код:
CMD:mymaja(playerid, params[])
{
new tmp = M2ngijaInfo[playerid][pHouse];
if(tmp == 0) return SendClientMessage(playerid, -1,""VIGA" You don't have a house !"); //if there's no house id 0...idk what your starting house id is
if(!MillelgiLigidal(2.3, playerid, Houses[tmp][Posx], Houses[tmp][Posy], Houses[tmp][Posz])) return SendClientMessage(playerid, -1,""VIGA" You aren't near your house !");
format(string, sizeof(string), "> Sa oled mььnud oma maja(ID:%d)!", tmp);
SendClientMessage(playerid, -1, string);
GivePlayerMoney(playerid, Houses[tmp][mHind]);
M2ngijaInfo[playerid][pHouse] = 0;
format(Houses[tmp][mOmanik], 32, "");
Houses[tmp][mOstetud] = 0;
format(query, sizeof(query), "UPDATE `houses` SET mOstetud = `%d`, mOmanik = `%s` WHERE KoduID = `%d`", Houses[tmp][mOstetud], Houses[tmp][mOmanik],tmp);
mysql_query(query);
DestroyDynamic3DTextLabel(Houses[tmp][LabelID]);
format(string, sizeof(string), "Hind %d /n MЬЬGIKS!", Houses[tmp][mHind]);
Houses[tmp][LabelID] = CreateDynamic3DTextLabel(string, -1, Houses[tmp][Posx],Houses[tmp][Posy],Houses[tmp][Posz], 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 10.0);
DestroyDynamicPickup(Houses[tmp][PickupID]);
CreateDynamicPickup(1273, 23, Houses[tmp][Posx], Houses[tmp][Posy], Houses[tmp][Posz], 0, 0, -1, 250);
return 1;
}