22.11.2009, 09:03
I am trying to make my own GM, but this command not work. It will only return Sever:unknown command. But if i am not at the House icon, he returns, the message.
pawn Код:
if(strcmp(cmd, "/buyhouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint( 3.0,playerid, HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ]))
{
/*if(PlayerMoney[playerid] < HouseInfo[h][hValue])
{
SendClientMessage(playerid, COLOR_GREY, "Du hast nicht genug Geld.");
return 1;
}*/
if(PlayerMoney[playerid] >= HouseInfo[h][hValue])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
HouseInfo[h][hLock] = 1;
HouseInfo[h][hOwned] = 1;
HouseInfo[h][hBank] = 0;
PlayerMoney[playerid] = PlayerMoney[playerid] -= HouseInfo[playerid][hValue];
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du hast ein Haus gekauft.");
OnHouseUpdate();
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"Du bist nicht in der nдhe eines Hauses.");
return 1;
}
}
}//not connected
return 1;
}