public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_SUBMISSION)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1596.950439, -1638.030151, 12.927757))
{
if(Gates[objectid] == 0)
{
Gates[objectid] = 1;
SendClientMessageToAll(0xFF8040FF, "LSPD Gates Opening");
MoveObject(LSGATE, 1589.042725, -1638.030151, 12.927757, 2);
}
}
}
else if (newkeys & KEY_JUMP)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1596.950439, -1638.030151, 12.927757))
{
if(Gates[objectid] == 1)
{
Gates[objectid] = 0;
SendClientMessageToAll(0xFF8040FF, "LSPD Gates Closing");
MoveObject(LSGATE, 1596.950439, -1638.030151, 12.927757, 2);
}
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys, objectid)
Originally Posted by Kevin Fallow / KevKo
Not sure if this will work properly or not, but try adding objectid onto OnPlayerKeyStateChange
pawn Код:
|
Originally Posted by Torran
To check if there open or not, And its used in some other bits also
|
Gates = 0;
new object;
object = CreateObject(...);
MoveObject(object, ...);
Originally Posted by Vetle
you need a variable that contains the id of the gate
pawn Код:
pawn Код:
pawn Код:
|
Originally Posted by Torran
Quote:
As for Comptons Eazy E, Will that work? Like for checking if its open or closed |
new object = 0; // I guess 0 means it's closed for you right?
object = 1;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (newkeys & KEY_SUBMISSION) { if(IsPlayerInRangeOfPoint(playerid, 10.0, 1596.950439, -1638.030151, 12.927757)) { if(Gates == 0) { Gates = 1; SendClientMessageToAll(0xFF8040FF, "LSPD Gates Opening"); MoveObject(LSGATE, 1589.042725, -1638.030151, 12.927757, 2); } } } else if (newkeys & KEY_JUMP) { if(IsPlayerInRangeOfPoint(playerid, 10.0, 1596.950439, -1638.030151, 12.927757)) { if(Gates == 1) { Gates = 0; SendClientMessageToAll(0xFF8040FF, "LSPD Gates Closing"); MoveObject(LSGATE, 1596.950439, -1638.030151, 12.927757, 2); } } } return 1; }