05.02.2014, 23:09
Hello, I was trying to create cmd to edit Level and Price of houses on my server. I used this code, but it doesn't work well, I can't find a problem, maybe someone else can help me with this please?
So here is this command, every time when I write down this commands I get just this txt back '/houseedit | Level/Price | ammount' and nothing else happens. Ty
Код:
if(strcmp(cmd, "/houseedit", true) == 0)
{
if(UserInfo[playerid][uAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not an Admin!");
return 1;
}
new string[128], choice[32], amount;
if(sscanf(cmdtext, "s[20]d", choice, amount))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "/houseedit | Level/Price | ammount");
}
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hEntranceX], HouseInfo[i][hEntranceY], HouseInfo[i][hEntranceZ]))
{
format(string, sizeof(string), "House: %d", i);
SendClientMessage(playerid, COLOR_GRAD2, string);
if(amount > 0)
{
if(strcmp(choice,"level",true) == 0)
{
HouseInfo[i][hLevel] = amount;
format(string, sizeof(string), "You have changed House ID(%d)'s price to %d!", i, amount);
SendClientMessage(playerid, COLOR_YELLOW, string);
SaveHouse(i);
LoadHouse();
}
else if(strcmp(choice,"price",true) == 0)
{
HouseInfo[i][hPrice] = amount;
format(string, sizeof(string), "You have changed House ID(%d)'s price to %d!", i, amount);
SendClientMessage(playerid, COLOR_YELLOW, string);
SaveHouse(i);
LoadHouse();
}
}
}
}
return 1;
}

