[HELP] Please!
#1

Well i was wondering how i could do this, what i want to do is make a door open by a pressing 2 on your keyboard but everytime i try it just opens and i cant close it because its the same radius.

pawn Код:
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.
pawn Код:
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);
----=[[Below are the 1's i want on a Button]]=----
pawn Код:
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;
}
So you press 2 it opens then closes in the certain radius.

Thanks.

-Mike.
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

edit - whoa, they majorly updated the wiki page of this callback
Reply
#3

Quote:
Originally Posted by dice7
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

edit - whoa, they majorly updated the wiki page of this callback
Lol yeah
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)