27.06.2014, 13:22
Alright it's working now, however I have question about /enter and /exit, this is my first time ever making house system so sorry for so many questions..
When I do /exit in house it'll flood the chat with all house IDs.
When I do /exit in house it'll flood the chat with all house IDs.
pawn Код:
CMD:enter(playerid,params[])
{
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][Enter][0], HouseInfo[i][Enter][1], HouseInfo[i][Enter][2]))
{
SetPlayerInterior(playerid, HouseInfo[i][Interior]);
SetPlayerVirtualWorld(playerid, HouseInfo[i][World]);
SetPlayerPos(playerid, HouseInfo[i][Inter][0], HouseInfo[i][Inter][1], HouseInfo[i][Inter][1]);
SendClientMessage(playerid, BLUE, "You have entered the house.");
new str[128];
format(str,sizeof(str), "entered house id %d", i);
SendClientMessage(playerid, 0xFF0000AA, str);
}
}
return 1;
}
CMD:exit(playerid,params[])
{
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][Inter][0], HouseInfo[i][Inter][1], HouseInfo[i][Inter][2]))
{
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, HouseInfo[i][Enter][0], HouseInfo[i][Enter][1], HouseInfo[i][Enter][1]);
SendClientMessage(playerid, BLUE, "You have left the house.");
new str[128];
format(str,sizeof(str), "left house id %d", i);
SendClientMessage(playerid, 0xFF0000AA, str);
}
}
return 1;
}