Код:
command(breakin, playerid, params[])
{
#pragma unused params
new string[128];
if(Player[playerid][Group] >= 1)
{
if(Groups[Player[playerid][Group]][CommandTypes] == 4 || Groups[Player[playerid][Group]][CommandTypes] == 1)
{
for(new i = 0; i < sizeof(Businesses); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, Businesses[i][bExteriorX], Businesses[i][bExteriorY], Businesses[i][bExteriorZ]))
{
if(GetPlayerVirtualWorld(playerid) == 0)
{
if(random(4) < 2)
{
format(string, sizeof(string), "* %s has kicked the door down, breaking the door lock.", GetName(playerid));
NearByMessage(playerid, SCRIPTPURPLE, string);
Businesses[i][bLockStatus] = 0;
Player[playerid][InBusiness] = i;
SetPlayerVirtualWorld(playerid, 65000+i);
SetPlayerInterior(playerid, Businesses[i][bInteriorID]); //<========THIS LINE
SetPlayerPos(playerid, Businesses[i][bInteriorX], Businesses[i][bInteriorY], Businesses[i][bInteriorZ]);
}
else
{
format(string, sizeof(string), "* %s has kicked the door, attempting to break through, but has failed.", GetName(playerid));
NearByMessage(playerid, SCRIPTPURPLE, string);
}
}
}
}
for(new i = 0; i < sizeof(Houses); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ]))
{
if(GetPlayerVirtualWorld(playerid) == 0)
{
if(random(4) < 2)
{
format(string, sizeof(string), "* %s has kicked the door down, breaking the door lock.", GetName(playerid));
NearByMessage(playerid, SCRIPTPURPLE, string);
Houses[i][LockStatus] = 0;
SetPlayerVirtualWorld(playerid, 55000+i);
Player[playerid][InHouse] = i;
SetPlayerInterior(playerid, Houses[i][hInteriorID]);
SetPlayerPos(playerid, Houses[i][hInteriorX], Houses[i][hInteriorY], Houses[i][hInteriorZ]);
}
else
{
format(string, sizeof(string), "* %s has kicked the door, attempting to break through, but has failed.", GetName(playerid));
NearByMessage(playerid, SCRIPTPURPLE, string);
}
}
}
}
for(new i = 0; i < sizeof(Groups); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, Groups[i][HQExteriorX], Groups[i][HQExteriorY], Groups[i][HQExteriorZ]))
{
if(GetPlayerInterior(playerid) == Groups[i][HQExteriorID] && GetPlayerVirtualWorld(playerid) == 0)
{
if(random(4) < 2)
{
Groups[i][HQLock] = 0;
Player[playerid][InGroupHQ] = i;
SetPlayerVirtualWorld(playerid, 45000+i);
SetPlayerInterior(playerid, Groups[i][HQInteriorID]);
SetPlayerPos(playerid, Groups[i][HQInteriorX], Groups[i][HQInteriorY], Groups[i][HQInteriorZ]);
}
else
{
format(string, sizeof(string), "* %s has kicked the door, attempting to break through, but has failed.", GetName(playerid));
NearByMessage(playerid, SCRIPTPURPLE, string);
}
}
}
}
}
}
return 1;
}
. i accidentally add float to bInteriorID. didnt realize till you told me