25.01.2014, 14:52
Hey all,
I'm trying to make a command which sell all the houses in the server,
this is the code but it's ain't sell it all..
I'm trying to make a command which sell all the houses in the server,
this is the code but it's ain't sell it all..
Код:
COMMAND:asellhouse(playerid, params[])
{
new id,
{
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if(GetPVarInt(playerid, "Admin") >= 9)
{
format(string, sizeof(string), "You have sold all the houses in the server!);
SendClientMessage(playerid,COLOR_GREY,string);
HouseInfo[id][hLock] = 1;
HouseInfo[id][hOwned] = 0;
HouseInfo[id][hMoney] = 0;
HouseInfo[id][hLock] = 0;
strmid(HouseInfo[id][hOwner], "The State", 0, strlen("The State"), 255);
DestroyDynamicPickup(HouseInfo[id][hPickupID]);
HouseInfo[id][hPickupID]=CreateDynamicPickup(1273, 1, HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ]);
format(string, sizeof(string), "housedata/%d.ini", id);
if(DOF2_FileExists(string)) DOF2_RemoveFile(string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command !");
}
}
return 1;
}


