new LD; //----Lock down gate in the Diner
new Sec; //----Security door in the Diner
new Locked[MAX_PLAYERS]; //----LOCKDOWN used for all doors / gates.
Sec = CreateObject(1495, 2651.119873, -2745.723877, 4.287249, 0.0000, 0.0000, 89.3814);
LD = CreateObject(971, 2640.496582, -2745.657959, 0.713324, 0.0000, 0.0000, 180.3777);
if (strcmp("/opensec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
{
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 18.9076);
}
}
return 1;
}
if (strcmp("/closesec", cmdtext, true) == 0)
{
if(PlayerToPoint(2.0,playerid,2651.119873, -2745.723877, 4.287249))
{
if(TEAM_COP[playerid] == 1)
{
SetObjectRot(Sec, 0.0000, 0.0000, 89.3814);
}
}
return 1;
}
Originally Posted by dice7
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
edit - whoa, they majorly updated the wiki page of this callback |