Quote:
Originally Posted by Prumpuz
|
Thanks but why this two times with other ids?
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & 16 && IsPlayerInRangeOfPoint(playerid, 1, 1458.6327,643.8281,10.8203) && !IsPlayerInAnyVehicle(playerid))
{
if(gateopen == 1)
{
CloseGateOutside(playerid);
}
else {
OpenGateOutside(playerid);
}
}
if(newkeys & 16 && IsPlayerInRangeOfPoint(playerid, 1, 1469.0891,642.6558,10.8456) && !IsPlayerInAnyVehicle(playerid))
{
if(gateopen == 1)
{
CloseGateInside(playerid);
}
else {
OpenGateInside(playerid);
}
}
return 1;
}
stock CloseGateOutside(playerid)
{
SetPlayerPos(playerid, 1458.6327,643.8281,10.8203); //1 Buton
SetPlayerFacingAngle(playerid, 181.7816);
ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);
gateopen = 0;
return 1;
}
stock OpenGateOutside(playerid)
{
SetPlayerPos(playerid, 1458.6327,643.8281,10.8203);
SetPlayerFacingAngle(playerid, 181.7816);
ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
gateopen = 1;
return 1;
}
CloseGateInside(playerid)
{
SetPlayerPos(playerid, 1469.0891,642.6558,10.8456);
SetPlayerFacingAngle(playerid, 0.6966);
ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);
gateopen = 0;
return 1;
}
OpenGateInside(playerid)
{
SetPlayerPos(playerid, 1469.0891,642.6558,10.8456);
SetPlayerFacingAngle(playerid, 0.6966);
ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
gateo
Like this is for two doors or one? btw
First: MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
And: MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);
This for the position where is keypad
1: SetPlayerPos(playerid, 1469.0891,642.6558,10.8456);
2: SetPlayerPos(playerid, 1458.6327,643.8281,10.8203);
Because i didnt saw on video 2 doors
And other thing can you help me and to add only faction pleader = 14 to can open that door.
Thanks