|
I believe there's a "button" include wich allows you to create buttons using 'AddButton' (I believe) but I don't know where to find it, I'm sure you can find it somewhere, It's also included in some RP scripts
|
|
There's a include called yom_buttons, but I don't think it's being shared anymore. However there's an example here on how to do it: https://sampforum.blast.hk/showthread.php?tid=231531 you could maybe learn from it.
|
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