27.01.2012, 03:47
(
Последний раз редактировалось Mac-10; 28.01.2012 в 01:25.
)
I have fixed this bug before, but not quite sure how to now..it's a basic GodFather based Gamemode and you cannot /enter into businesses, houses or any other places at all. Along with exit..It worked fine before no different change in code..Here is the Code Layout..
Feedback is Much Appreciated..Thanks.
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(2.0, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
{
if(HouseInfo[i][hLock] == 0 || GetPVarInt(playerid, "AdminDuty") == 1)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerVirtualWorld(playerid,i+100);
DOO_SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~Welcome ~n~~r~Home", 5000, 1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
PlayerInfo2[HouseEntered][playerid] = i;
}
else
{
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
}
}
}
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
////printf("House :%d",i);
if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
if(PlayerInfo2[HouseEntered][playerid] == i)
{
SetPlayerVirtualWorld(playerid,HouseInfo[i][hOutWorld]);
SetPlayerInterior(playerid,HouseInfo[i][hOutInt]);
DOO_SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,0);
PlayerInfo2[HouseEntered][playerid] = 255;
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealthEx(playerid,100.0);
}
}
return 1;
}
}
}