01.12.2013, 18:18
(
Последний раз редактировалось Spydah; 01.12.2013 в 21:56.
)
pawn Код:
if (newkeys & KEY_SECONDARY_ATTACK)
{
if(InModShop[playerid] == 1)
{
if (newkeys & KEY_SECONDARY_ATTACK) return 0;
TogglePlayerControllable(playerid, 0);
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
RemoveDriverFromVehicle(playerid);
if(engine[GetPlayerVehicleID(playerid)] == 0)
{
RemoveDriverFromVehicle(playerid);
if(PlayerInfo[playerid][pCarlic] == 0)
{
SetPlayerDrunkLevel (playerid, 0);
}
}
}
if (PlayerToPoint(0.5, playerid,340.3497,169.3933,1019.9912))
{
SetPlayerPos(playerid, 340.2886,167.8946,1019.9912);
}
if (PlayerToPoint(0.5, playerid,340.2886,167.8946,1019.9912))
{
SetPlayerPos(playerid, 340.3497,169.3933,1019.9912);
}
for(new i = 0; i < sizeof(BuildingInfo); i++)
{
if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]))
TogglePlayerControlable(playerid,0);
SetTimer("businessenter", 1000, false); //Timer.
{
if(IsPlayerInAnyVehicle(playerid))
{
return 0;
}
SetPlayerInterior(playerid, BuildingInfo[i][ExitInterior]);
SetPlayerPos(playerid, BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]);
if(drink[playerid] == 1)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 23);
}
if(drink[playerid] == 2)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 20);
}
if(drink[playerid] == 3)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 22);
}
if(drink[playerid] == 4)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
}
}
else if (PlayerToPoint(2.0, playerid,BuildingInfo[i][bExitX], BuildingInfo[i][bExitY], BuildingInfo[i][bExitZ]))
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, BuildingInfo[i][bEnterX], BuildingInfo[i][bEnterY], BuildingInfo[i][bEnterZ]);
if(drink[playerid] == 1)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 23);
}
if(drink[playerid] == 2)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 20);
}
if(drink[playerid] == 3)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 22);
}
if(drink[playerid] == 4)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
}
}
}
for(new i = 0; i < sizeof(BusinessInfo); i++)
{
if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]))
{
if(BusinessInfo[i][bOwned] == 0 && AdminDuty[playerid] == 0)
{
GameTextForPlayer(playerid, "~>~~r~Locked Business~<~", 3000, 4);
return 1;
}
if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz1] != i)
{
GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
return 1;
}
if(BusinessInfo[i][bLocked] == 1 && PlayerInfo[playerid][pBiz2] != i)
{
GameTextForPlayer(playerid, "~>~~r~Locked~<~", 3000, 4);
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
return 0;
}
SetPlayerVirtualWorld(playerid, i);
SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
if(PlayerInfo[playerid][pBiz1] == i || PlayerInfo[playerid][pBiz2] == i && BusinessInfo[i][bLocked] == 1)
{
if(GetPlayerVirtualWorld(playerid) == BusinessInfo[i][EnterWorld])
{
SetPlayerVirtualWorld(playerid, i);
SetPlayerInterior(playerid, BusinessInfo[i][EnterInterior]);
SetPlayerPos(playerid, BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]);
if(drink[playerid] == 1)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 23);
}
if(drink[playerid] == 2)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 20);
}
if(drink[playerid] == 3)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 22);
}
if(drink[playerid] == 4)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
}
}
}
}
else if (PlayerToPoint(2.0, playerid,BusinessInfo[i][bExitX], BusinessInfo[i][bExitY], BusinessInfo[i][bExitZ]))
{
if(GetPlayerVirtualWorld(playerid) == i)
{
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, BusinessInfo[i][bEnterX], BusinessInfo[i][bEnterY], BusinessInfo[i][bEnterZ]);
if(drink[playerid] == 1)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 23);
}
if(drink[playerid] == 2)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 20);
}
if(drink[playerid] == 3)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid, 22);
}
if(drink[playerid] == 4)
{
SetPlayerSpecialAction(playerid, 0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
}
}
}
}
}
pawn Код:
forward businessenter(playerid);
pawn Код:
public businessenter(playerid)
{
TogglePlayerControlable(playerid,1);
return 1;
}
Try this.