06.05.2017, 21:08
Hello guys i converted sandra's prop system to house system but have some issues
in game the pickup is showing but without info
PHP код:
CMD:addhouse(playerid, params[])
{
new price2;
if(sscanf(params, "d", price2))
return SendClientMessage(playerid, 0xFFFFFFAA, "Use: /addhouse [price]");
if(price2 < 10)
return SendClientMessage(playerid, 0xFF0000FF,"Error: Price must be higher than 10"); //change this price if you want..
// if(sell2 < 10) //i forgot they are just normal numbers. Strval is only used if you have a string, and you want to know it's value xd k wait a sec
// return SendClientMessage(playerid, 0xFF0000FF,"Error: Sell value must be higher than 10"); //change this value if you want..
static PropertyCount;
PropertyCount += 1;
if(!IsPlayerAdmin(playerid))
return 0;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
//AddProperty(X,Y,Z, price2); //this calls a function that creates the pickup and assigns the variables.
HouseInfo[PropertyCount][HouseExists] = 1;
HouseInfo[PropertyCount][HouseX] = X;
HouseInfo[PropertyCount][HouseY] = Y;
HouseInfo[PropertyCount][HouseZ] = Z;
HouseInfo[PropertyCount][HouseValue] = price2;
HouseInfo[PropertyCount][HouseOwner] = -1;
HouseInfo[houseid][HouseIsBought] = 0;
PropertyPickup[PropertyCount] = CreatePickup(1272, 1, X, Y, Z);
new entry[128], entry2[128];
new File:hFile;
format(entry, 128, "AddProperty(%.2f, %.2f, %.2f, %d);", X, Y, Z, price2); //it only add's it to a file, and this has to be read.
format(entry2, 128, "\r\n%s",entry);
hFile = fopen("SavedProperties.txt", io_append);
fwrite(hFile, entry2);
fclose(hFile);
return 1;
}